/**********************************************************
RunUO AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Red Squirrel on Feb-12-2011 07:52:34pm
Filepath: scripts\_custom\engines\debugger\debugcommands.cs
Lines of code: 69

Description: 

***********************************************************/


using Server;
using Server.Mobiles;
using System;
using System.Collections.Generic;
using System.IO;

namespace Server.Commands
{

	public class debug
	{
		public static void Initialize()
		{
			CommandSystem.Register( "debug", AccessLevel.Seer, new CommandEventHandler( debug_OnCommand ),true );
			CommandSystem.Register( "undebug", AccessLevel.Seer, new CommandEventHandler( undebug_OnCommand ),true );
			CommandSystem.Register( "consoledebug", AccessLevel.Seer, new CommandEventHandler( consoledebug_OnCommand ),true );
		}


		private static void debug_OnCommand( CommandEventArgs e )
		{		
			if(e.Arguments.Length==1)
			{
				string debug=e.Arguments[0];
				
				Debugger.AddDebug(debug);
				e.Mobile.SendMessage("Turned {0} debugging on",debug);
			} 
		}
		

		private static void consoledebug_OnCommand( CommandEventArgs e )
		{		
			if(e.Arguments.Length==1)
			{
				string debug=e.Arguments[0];
				
				if(debug=="true" || debug=="yes" || debug=="1" || debug=="on")
				{
					Debugger.consoledebug = true;
					e.Mobile.SendMessage("Displaying debug info to console: ON",debug);
				}
				else
				{
					Debugger.consoledebug = false;
					e.Mobile.SendMessage("Displaying debug info to console: OFF",debug);
				}
			}			
			else e.Mobile.SendMessage("Console debug is: ",Debugger.consoledebug ? "ON" : "OFF");
		}



		private static void undebug_OnCommand( CommandEventArgs e )
		{		
			if(e.Arguments.Length==0)
			{
				Debugger.RemoveAllDebug();
				e.Mobile.SendMessage("Removed all debugging");
			}			
			else if(e.Arguments.Length==1)
			{
				string debug=e.Arguments[0];

				Debugger.RemoveDebug(debug);
				e.Mobile.SendMessage("Turned {0} debugging off",debug);
			}
		}		
		
		
		public class showdebug
		{
			public static void Initialize()
			{
				CommandSystem.Register( "showdebug", AccessLevel.GameMaster, new CommandEventHandler( showdebug_OnCommand ),true );
			}

			private static void showdebug_OnCommand( CommandEventArgs e )
			{		
				Debugger.ShowDebug(e.Mobile);
			}		
		}
	}
}
