- Removed the ASCII 0x7F control character from safe character lists.

- Added the TraceLockdown command.
- Fixed a missing conflicting layer check for FishingPole.
- Controlled and summoned creatures are no longer affected by the confusion blast potion effect.
This commit is contained in:
eos 2012-09-08 23:42:45 +00:00
parent 512ab4bfbf
commit 11f84a33cd
8 changed files with 69 additions and 8 deletions

View file

@ -121,7 +121,7 @@ namespace Server.Misc
bool isSafe = true; bool isSafe = true;
for ( int i = 0; isSafe && i < pass.Length; ++i ) for ( int i = 0; isSafe && i < pass.Length; ++i )
isSafe = ( pass[i] >= 0x20 && pass[i] < 0x80 ); isSafe = ( pass[i] >= 0x20 && pass[i] < 0x7F );
if ( !isSafe ) if ( !isSafe )
{ {
@ -275,10 +275,10 @@ namespace Server.Misc
bool isSafe = !( un.StartsWith( " " ) || un.EndsWith( " " ) || un.EndsWith( "." ) ); bool isSafe = !( un.StartsWith( " " ) || un.EndsWith( " " ) || un.EndsWith( "." ) );
for ( int i = 0; isSafe && i < un.Length; ++i ) for ( int i = 0; isSafe && i < un.Length; ++i )
isSafe = ( un[i] >= 0x20 && un[i] < 0x80 && !IsForbiddenChar( un[i] ) ); isSafe = ( un[i] >= 0x20 && un[i] < 0x7F && !IsForbiddenChar( un[i] ) );
for ( int i = 0; isSafe && i < pw.Length; ++i ) for ( int i = 0; isSafe && i < pw.Length; ++i )
isSafe = ( pw[i] >= 0x20 && pw[i] < 0x80 ); isSafe = ( pw[i] >= 0x20 && pw[i] < 0x7F );
if ( !isSafe ) if ( !isSafe )
return null; return null;

View file

@ -1396,7 +1396,7 @@ namespace Server.Commands
html.Write( "&quot;" ); html.Write( "&quot;" );
else if( c == '\'' ) else if( c == '\'' )
html.Write( "&apos;" ); html.Write( "&apos;" );
else if( c >= 0x20 && c < 0x80 ) else if( c >= 0x20 && c < 0x7F )
html.Write( c ); html.Write( c );
else else
html.Write( "&#{0};", (int)c ); html.Write( "&#{0};", (int)c );

View file

@ -58,6 +58,7 @@ namespace Server.Commands.Generic
Register( new Factions.FactionKickCommand( Factions.FactionKickType.Ban ) ); Register( new Factions.FactionKickCommand( Factions.FactionKickType.Ban ) );
Register( new Factions.FactionKickCommand( Factions.FactionKickType.Unban ) ); Register( new Factions.FactionKickCommand( Factions.FactionKickType.Unban ) );
Register( new BringToPackCommand() ); Register( new BringToPackCommand() );
Register( new TraceLockdownCommand() );
} }
private static List<BaseCommand> m_AllCommands = new List<BaseCommand>(); private static List<BaseCommand> m_AllCommands = new List<BaseCommand>();
@ -1079,4 +1080,42 @@ namespace Server.Commands.Generic
} }
} }
} }
}
public class TraceLockdownCommand : BaseCommand
{
public TraceLockdownCommand()
{
AccessLevel = AccessLevel.Administrator;
Supports = CommandSupport.Simple;
Commands = new string[] { "TraceLockdown" };
ObjectTypes = ObjectTypes.Items;
Usage = "TraceLockdown";
Description = "Finds the BaseHouse for which a targeted item is locked down or secured.";
}
public override void Execute( CommandEventArgs e, object obj )
{
Item item = obj as Item;
if ( item == null )
return;
if ( !item.IsLockedDown && !item.IsSecure )
{
LogFailure( "That is not locked down." );
return;
}
foreach ( BaseHouse house in BaseHouse.AllHouses )
{
if ( house.IsSecure( item ) || house.IsLockedDown( item ) )
{
e.Mobile.SendGump( new PropertiesGump( e.Mobile, house ) );
return;
}
}
LogFailure( "No house was found." );
}
}
}

View file

@ -305,7 +305,7 @@ namespace Server.Engines.MyRunUO
{ {
char c = input[i]; char c = input[i];
if ( c < 0x20 || c > 0x80 ) if ( c < 0x20 || c >= 0x7F )
{ {
AppendCharEntity( input, i, ref sb, c ); AppendCharEntity( input, i, ref sb, c );
} }

View file

@ -35,6 +35,20 @@ namespace Server.Items
BaseHarvestTool.AddContextMenuEntries( from, this, list, Fishing.System ); BaseHarvestTool.AddContextMenuEntries( from, this, list, Fishing.System );
} }
public override bool CheckConflictingLayer( Mobile m, Item item, Layer layer )
{
if ( base.CheckConflictingLayer( m, item, layer ) )
return true;
if ( layer == Layer.OneHanded )
{
m.SendLocalizedMessage( 500214 ); // You already have something in both hands.
return true;
}
return false;
}
public FishingPole( Serial serial ) : base( serial ) public FishingPole( Serial serial ) : base( serial )
{ {
} }

View file

@ -106,6 +106,9 @@ namespace Server.Items
{ {
BaseCreature mon = (BaseCreature) mobile; BaseCreature mon = (BaseCreature) mobile;
if ( mon.Controlled || mon.Summoned )
continue;
mon.Pacify( from, DateTime.Now + TimeSpan.FromSeconds( 5.0 ) ); // TODO check mon.Pacify( from, DateTime.Now + TimeSpan.FromSeconds( 5.0 ) ); // TODO check
} }
} }

View file

@ -1208,6 +1208,11 @@ namespace Server.Multis
private static List<BaseHouse> m_AllHouses = new List<BaseHouse>(); private static List<BaseHouse> m_AllHouses = new List<BaseHouse>();
public static List<BaseHouse> AllHouses
{
get { return m_AllHouses; }
}
public BaseHouse( int multiID, Mobile owner, int MaxLockDown, int MaxSecure ) : base( multiID ) public BaseHouse( int multiID, Mobile owner, int MaxLockDown, int MaxSecure ) : base( multiID )
{ {
m_AllHouses.Add( this ); m_AllHouses.Add( this );

View file

@ -1131,7 +1131,7 @@ namespace Server
bytes.Append( " " ); bytes.Append( " " );
} }
if ( c >= 0x20 && c < 0x80 ) if ( c >= 0x20 && c < 0x7F )
{ {
chars.Append( (char)c ); chars.Append( (char)c );
} }
@ -1170,7 +1170,7 @@ namespace Server
bytes.Append( " " ); bytes.Append( " " );
} }
if ( c >= 0x20 && c < 0x80 ) if ( c >= 0x20 && c < 0x7F )
{ {
chars.Append( (char)c ); chars.Append( (char)c );
} }