RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

a system controll center

cuy782002

Wanderer
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
 

JesseTCG

Sorceror
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;
			}
		} 
	}
}
 

Arahil

Sorceror
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.
 

JesseTCG

Sorceror
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
 

cuy782002

Wanderer
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
 

Kwwres10

Wanderer
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. :D

-NoX
 

Phantom

Knight
cuy782002 said:
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.
 
Top