|
||
|
|||||||
| Network Modifications This forum is for modifications to the networking code of RunUO |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
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 |
|
|
|
|
|
|
#2 (permalink) |
|
Forum Novice
|
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;
}
}
}
}
|
|
|
|
|
|
#3 (permalink) |
|
Forum Novice
|
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. |
|
|
|
|
|
#4 (permalink) |
|
Forum Novice
|
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 |
|
|
|
|
|
#7 (permalink) | |
|
Account Terminated
|
Quote:
At this point it doesn't exist, since nobody has released one that works with the current version. |
|
|
|
|
|
|
#8 (permalink) |
|
Forum Novice
|
Flying Chimera
this might be something for you - but you have to do open a remote desktop session to your server to use it. |
|
|
|
|
|
#9 (permalink) | |
|
Quote:
i like it it lets you do a ton of things.. |
||
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|