Go Back   RunUO - Ultima Online Emulation > RunUO > Core Modifications > Network Modifications

Network Modifications This forum is for modifications to the networking code of RunUO

Reply
 
Thread Tools Display Modes
Old 07-03-2005, 01:50 PM   #1 (permalink)
 
Join Date: Dec 2004
Location: USA michigan
Age: 30
Posts: 171
Send a message via Yahoo to cuy782002
Lightbulb a system controll center

im trying to look into making a system conrtoll system for my server. there has got to be a way to access the admin controll panel with out being ingame

this is what im wanting to do have a icon in the data forlder to d click on it and the admin controll system appers to brodcast msg or save/restart.

if there is anyone that could point me in the right direction on making this system i would be greatfull im still learning how to do the system scripting so bare with me


thank you
cuy782002 is offline   Reply With Quote
Old 07-14-2005, 12:43 AM   #2 (permalink)
Forum Novice
 
Join Date: Mar 2003
Location: PA, USA
Age: 32
Posts: 131
Send a message via MSN to JesseTCG
Default Heres something I have been working on...

SpeechLogoutAndLoginRecorder.cs

Code:
using System;
using System.IO;
using Server;
using Server.Network;
using System.Collections;

namespace Server.Misc
{
	public class LogRecorder
	{
		public static void Initialize()
		{
			//Login & Logout
			EventSink.Login += new LoginEventHandler( EventSink_Login );
			EventSink.Logout += new LogoutEventHandler( EventSink_Logout );
			EventSink.Speech += new SpeechEventHandler( OnSpeech );
			if ( !Directory.Exists( "logs" ) ) Directory.CreateDirectory( "logs" );
			if ( !Directory.Exists( "logs/Login" ) ) Directory.CreateDirectory( "logs/Login" ); 
			if ( !Directory.Exists( "logs/Logout" ) ) Directory.CreateDirectory( "logs/Logout" );  
			if ( !Directory.Exists( "logs/Chat" ) ) Directory.CreateDirectory( "logs/Chat" ); 
		}
		private static void EventSink_Login( LoginEventArgs args )
		{
			Stream fileStream = null;
			StreamWriter writeAdapter = null;
			Mobile m = args.Mobile;
			try
			{
				fileStream = File.Open("logs/Login/"+args.Mobile.Name+".log", FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
				writeAdapter = new StreamWriter(fileStream);
				writeAdapter.WriteLine(args.Mobile.Name + " " + DateTime.Now + "  Login" );
				writeAdapter.Close();
			}
			catch
			{
				Console.WriteLine( "Record Error......{0} Login",args.Mobile.Name );
				return;
			}
		}
		private static void EventSink_Logout( LogoutEventArgs args )
		{
			Stream fileStream = null;
			StreamWriter writeAdapter = null;
			Mobile m = args.Mobile;
			try
			{
				fileStream = File.Open("logs/Logout/"+args.Mobile.Name+".log", FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
				writeAdapter = new StreamWriter(fileStream);
				writeAdapter.WriteLine(args.Mobile.Name + " " + DateTime.Now + "  Logout" );
				writeAdapter.Close();
			}
			catch
			{
				Console.WriteLine( "Record Error......{0} Logout",args.Mobile.Name );
				return;
			}
		}
		public static void OnSpeech( SpeechEventArgs e ) 
		{ 
			string msg = String.Format( "({0}): {1}", e.Mobile.Name, e.Speech ); 
			Stream fileStream = null;
			StreamWriter writeAdapter = null;
			try
			{
				fileStream = File.Open( String.Format( "logs/chat/{0}.log", DateTime.Now.ToLongDateString() ), FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
				writeAdapter = new StreamWriter(fileStream);
				writeAdapter.WriteLine("< " + msg + " >" + " at " + DateTime.Now );
				writeAdapter.Close();
				Console.WriteLine("Speech: " + msg + " at " + DateTime.Now );
			}
			catch
			{
				Console.WriteLine( "Record Error......{0}",msg );
				return;
			}
		} 
	}
}
JesseTCG is offline   Reply With Quote
Old 07-14-2005, 02:58 AM   #3 (permalink)
Forum Novice
 
Join Date: Oct 2003
Location: Vienna, Austria
Age: 21
Posts: 127
Send a message via ICQ to Arahil
Default

besides that this forum is for core modifications (while this script can just be copied to the scripts folder) your code is pretty slow...
opening a filewriter every time someone is saying something, writing it to the console as well and all the string formatting might cost quite a lot of performance...

and, just as a side node, you should really handle the exceptions better. you just get noticed that there's an error - but not why and where exactly.
Arahil is offline   Reply With Quote
Old 07-14-2005, 09:34 AM   #4 (permalink)
Forum Novice
 
Join Date: Mar 2003
Location: PA, USA
Age: 32
Posts: 131
Send a message via MSN to JesseTCG
Default The Script...

Just to set the record striaght. I only posted this script bc he asked for help and a idea. I know my scripting is not perfect, but its a start to help him, bc I also have been looking for a console command that would enable me to command while logged out of the client. Next time I will post in the area designated for it. As for the other errors, Ill have you know that our servers save in under 1 second with a full spawn, so I don't think it is that much of a issue. Just try it before you buy it.. lol. Thanks Guys... I wont post off topic again....

Jesse
JesseTCG is offline   Reply With Quote
Old 07-20-2005, 01:33 PM   #5 (permalink)
 
Join Date: Dec 2004
Location: USA michigan
Age: 30
Posts: 171
Send a message via Yahoo to cuy782002
Default

well im not realy looking for a recorder im looking for a program to give me access to my server with out logen to the server some thing like the admin gump
cuy782002 is offline   Reply With Quote
Old 07-20-2005, 01:57 PM   #6 (permalink)
 
Join Date: Dec 2004
Location: dnaL sdrawkcaB
Posts: 636
Send a message via AIM to Kwwres10 Send a message via MSN to Kwwres10
Default

Jesse, that script is so amazingly old. I thought I had the last copy, but you must have also obtained it. Please do not take credit for things that ARE NOT YOURS.

Good try though.

-NoX
Kwwres10 is offline   Reply With Quote
Old 07-20-2005, 03:39 PM   #7 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Quote:
Originally Posted by cuy782002
im trying to look into making a system conrtoll system for my server. there has got to be a way to access the admin controll panel with out being ingame

this is what im wanting to do have a icon in the data forlder to d click on it and the admin controll system appers to brodcast msg or save/restart.

if there is anyone that could point me in the right direction on making this system i would be greatfull im still learning how to do the system scripting so bare with me


thank you
If you want it you will have to code it.

At this point it doesn't exist, since nobody has released one that works with the current version.
Phantom is offline   Reply With Quote
Old 07-21-2005, 02:42 AM   #8 (permalink)
Forum Novice
 
Join Date: Oct 2003
Location: Vienna, Austria
Age: 21
Posts: 127
Send a message via ICQ to Arahil
Default

Flying Chimera
this might be something for you - but you have to do open a remote desktop session to your server to use it.
Arahil is offline   Reply With Quote
Old 07-24-2005, 10:51 AM   #9 (permalink)
 
Join Date: Jul 2005
Posts: 148
Send a message via ICQ to xXSXFGFXXx
Default

Quote:
Originally Posted by Arahil
Flying Chimera
this might be something for you - but you have to do open a remote desktop session to your server to use it.
yeah i'd suggest that, its kinda like the dedicated server console for counter strike i like it it lets you do a ton of things..
xXSXFGFXXx is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5