Overwrite

Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
Unstable Kitsune
2023-11-28 23:20:26 -05:00
parent 3cd54811de
commit b918192e4e
11608 changed files with 2644205 additions and 47 deletions

View File

@@ -0,0 +1,69 @@
using System;
using System.Collections;
using Server;
using Server.Commands;
using Server.Network;
namespace Knives.Utils
{
public class Errors
{
private static ArrayList s_ErrorLog = new ArrayList();
private static ArrayList s_Checked = new ArrayList();
public static ArrayList ErrorLog{ get{ return s_ErrorLog; } }
public static ArrayList Checked{ get{ return s_Checked; } }
public static void Initialize()
{
CommandSystem.Register("Errors", AccessLevel.Counselor, new CommandEventHandler(OnErrors));
EventSink.Login += new LoginEventHandler( OnLogin );
}
private static void OnErrors( CommandEventArgs e )
{
if ( e.ArgString == null || e.ArgString == "" )
ErrorsGump.SendTo( e.Mobile );
else
Report( e.ArgString + " - " + e.Mobile.Name );
}
private static void OnLogin( LoginEventArgs e )
{
if ( e.Mobile.AccessLevel != AccessLevel.Player
&& s_ErrorLog.Count != 0
&& !s_Checked.Contains( e.Mobile ) )
ErrorsNotifyGump.SendTo( e.Mobile );
}
public static void Report( string error )
{
s_ErrorLog.Add( String.Format( "<B>{0}</B><BR>{1}<BR>", DateTime.Now, error ) );
s_Checked.Clear();
Notify();
}
private static void Notify()
{
foreach( NetState state in NetState.Instances )
{
if ( state.Mobile == null )
continue;
if ( state.Mobile.AccessLevel != AccessLevel.Player )
Notify( state.Mobile );
}
}
public static void Notify( Mobile m )
{
if ( m.HasGump( typeof( ErrorsGump ) ) )
ErrorsGump.SendTo( m );
else
ErrorsNotifyGump.SendTo( m );
}
}
}

View File

@@ -0,0 +1,66 @@
using System;
using Server;
using Server.Network;
using Server.Gumps;
namespace Knives.Utils
{
public class ErrorsGump : GumpPlus
{
private static string s_Help = " Errors reported by either this chat system or other staff members! Administrators have the power to clear this list. All staff members can report an error using the [errors <text> command.";
public static void SendTo( Mobile m )
{
new ErrorsGump( m );
Errors.Checked.Add( m );
}
private const int Width = 400;
private const int Height = 400;
public ErrorsGump( Mobile m ) : base( m, 100, 100 )
{
m.CloseGump( typeof( ErrorsGump ) );
NewGump();
}
protected override void BuildGump()
{try{
AddBackground( 0, 0, Width, Height, 0xE10 );
AddButton( Width-20, Height-20, 0x5689, 0x5689, "Help", new TimerCallback( Help ) );
int y = 0;
AddHtml( 0, y+=15, Width, 45, HTML.White + "<CENTER>Error Log", false, false );
AddBackground( 30, y+=20, Width-60, 3, 0x13BE );
string str = HTML.Black;
foreach( string text in Errors.ErrorLog )
str += text;
AddHtml( 20, y+=20, Width-40, Height-y-50, str, true, true );
if ( Owner.AccessLevel >= AccessLevel.Administrator )
{
AddButton( Width/2-30, Height-40, 0x98B, 0x98B, "Clear log", new TimerCallback( ClearLog ) );
AddHtml( Width/2-23, Height-37, 51, 20, HTML.White + "<CENTER>Clear", false, false );
}
}catch{ Errors.Report( String.Format( "ErrorsGump-> BuildGump-> |{0}|", Owner ) ); } }
private void Help()
{
NewGump();
InfoGump.SendTo( Owner, 300, 300, HTML.White + s_Help, true );
}
private void ClearLog()
{
Errors.ErrorLog.Clear();
Owner.SendMessage( "The error log is now clear." );
}
}
}

View File

@@ -0,0 +1,35 @@
using System;
using Server;
using Server.Gumps;
using Server.Network;
namespace Knives.Utils
{
public class ErrorsNotifyGump : GumpPlus
{
public static void SendTo( Mobile m )
{
new ErrorsNotifyGump( m );
}
public ErrorsNotifyGump( Mobile m ) : base( m, 100, 100 )
{
m.CloseGump( typeof( ErrorsNotifyGump ) );
Override = false;
NewGump();
}
protected override void BuildGump()
{
AddItem( 0, 2, 0x25C6 );
AddButton( 33, 40, 0x1523, 0x1523, "Errors", new TimerCallback( Errors ) );
}
private void Errors()
{
ErrorsGump.SendTo( Owner );
}
}
}