- Replaced the TraceStabled command with a cleaner approach.

- Fixed ShardTime to actually return the server's time, not UTC.
- Changed the ShardTime format to something more standard.
This commit is contained in:
eos 2012-12-04 22:35:55 +00:00
parent 93a24b8af9
commit 533d7fe14d
6 changed files with 21 additions and 45 deletions

View file

@ -59,7 +59,6 @@ namespace Server.Commands.Generic
Register( new Factions.FactionKickCommand( Factions.FactionKickType.Unban ) );
Register( new BringToPackCommand() );
Register( new TraceLockdownCommand() );
Register( new TraceStabledCommand() );
}
private static List<BaseCommand> m_AllCommands = new List<BaseCommand>();
@ -1119,46 +1118,4 @@ namespace Server.Commands.Generic
LogFailure( "No house was found." );
}
}
public class TraceStabledCommand : BaseCommand
{
public TraceStabledCommand()
{
AccessLevel = AccessLevel.Administrator;
Supports = CommandSupport.Simple;
Commands = new string[] { "TraceStabled" };
ObjectTypes = ObjectTypes.Mobiles;
Usage = "TraceStabled";
Description = "Shows all mobiles that have a targeted pet in their stable.";
}
public override void Execute( CommandEventArgs e, object obj )
{
BaseCreature bc = obj as BaseCreature;
if ( bc == null )
{
LogFailure( "That is not a pet." );
}
else if ( !bc.IsStabled )
{
LogFailure( "That pet is not stabled." );
}
else
{
ArrayList list = new ArrayList();
foreach ( Mobile m in World.Mobiles.Values )
{
if ( m.Stabled.Contains( bc ) )
list.Add( m );
}
if ( list.Count == 0 )
LogFailure( "No mobiles were found." );
else
e.Mobile.SendGump( new InterfaceGump( e.Mobile, new string[] { "Object" }, list, 0, null ) );
}
}
}
}

View file

@ -2,7 +2,7 @@
namespace Server.Commands
{
public class Time
public class ShardTime
{
public static void Initialize()
{
@ -13,7 +13,7 @@ namespace Server.Commands
[Description( "Returns the server's local time." )]
private static void Time_OnCommand( CommandEventArgs e )
{
e.Mobile.SendMessage( DateTime.UtcNow.ToString( "MMM ddd d HH:mm yyyy" ) );
e.Mobile.SendMessage( DateTime.Now.ToString() );
}
}
}

View file

@ -295,6 +295,7 @@ namespace Server.Items
pet.ControlOrder = OrderType.Follow;
pet.IsStabled = false;
pet.StabledBy = null;
from.Stabled.Remove( pet );
if ( from is PlayerMobile )

View file

@ -237,6 +237,7 @@ namespace Server.Mobiles
private List<Mobile> m_Friends;
private bool m_IsStabled;
private Mobile m_StabledBy;
private bool m_HasGeneratedLoot; // have we generated our loot yet?
@ -268,6 +269,13 @@ namespace Server.Mobiles
}
}
[CommandProperty( AccessLevel.GameMaster, AccessLevel.Administrator )]
public Mobile StabledBy
{
get { return m_StabledBy; }
set { m_StabledBy = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public bool IsPrisoner
{

View file

@ -3044,7 +3044,10 @@ namespace Server.Mobiles
BaseCreature bc = list[i] as BaseCreature;
if ( bc != null )
{
bc.IsStabled = true;
bc.StabledBy = this;
}
}
CheckAtrophies( this );
@ -4480,6 +4483,7 @@ namespace Server.Mobiles
pet.SummonMaster = null;
pet.IsStabled = true;
pet.StabledBy = this;
pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy
@ -4507,6 +4511,7 @@ namespace Server.Mobiles
if ( pet == null || pet.Deleted )
{
pet.IsStabled = false;
pet.StabledBy = null;
if ( Stabled.Contains( pet ) )
Stabled.Remove( pet );
@ -4527,6 +4532,7 @@ namespace Server.Mobiles
pet.MoveToWorld( Location, Map );
pet.IsStabled = false;
pet.StabledBy = null;
pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully Happy

View file

@ -202,6 +202,7 @@ namespace Server.Mobiles
if ( pet == null || pet.Deleted )
{
pet.IsStabled = false;
pet.StabledBy = null;
from.Stabled.RemoveAt( i );
--i;
continue;
@ -322,6 +323,7 @@ namespace Server.Mobiles
pet.SummonMaster = null;
pet.IsStabled = true;
pet.StabledBy = from;
if ( Core.SE )
pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy
@ -359,6 +361,7 @@ namespace Server.Mobiles
if ( pet == null || pet.Deleted )
{
pet.IsStabled = false;
pet.StabledBy = null;
from.Stabled.RemoveAt( i );
--i;
continue;
@ -414,6 +417,7 @@ namespace Server.Mobiles
pet.MoveToWorld( from.Location, from.Map );
pet.IsStabled = false;
pet.StabledBy = null;
if ( Core.SE )
pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully Happy