tabification
This commit is contained in:
parent
0d0f6b62b6
commit
a90eb17e96
8 changed files with 108 additions and 108 deletions
|
|
@ -40,8 +40,8 @@ namespace Server
|
||||||
{
|
{
|
||||||
public interface IVendor
|
public interface IVendor
|
||||||
{
|
{
|
||||||
bool OnBuyItems( Mobile from, List<BuyItemResponse> list );
|
bool OnBuyItems( Mobile from, List<BuyItemResponse> list );
|
||||||
bool OnSellItems( Mobile from, List<SellItemResponse> list );
|
bool OnSellItems( Mobile from, List<SellItemResponse> list );
|
||||||
|
|
||||||
DateTime LastRestock{ get; set; }
|
DateTime LastRestock{ get; set; }
|
||||||
TimeSpan RestockDelay{ get; }
|
TimeSpan RestockDelay{ get; }
|
||||||
|
|
|
||||||
|
|
@ -1120,10 +1120,10 @@ namespace Server
|
||||||
((Mobile)m_Parent).GetChildNameProperties( list, item );
|
((Mobile)m_Parent).GetChildNameProperties( list, item );
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool IsChildVisibleTo( Mobile m, Item child )
|
public virtual bool IsChildVisibleTo( Mobile m, Item child )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Bounce( Mobile from )
|
public void Bounce( Mobile from )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1646,50 +1646,50 @@ namespace Server.Items
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ProcessOpeners( Mobile opener )
|
public void ProcessOpeners( Mobile opener )
|
||||||
{
|
{
|
||||||
if ( !IsPublicContainer )
|
if ( !IsPublicContainer )
|
||||||
{
|
{
|
||||||
bool contains = false;
|
bool contains = false;
|
||||||
|
|
||||||
if ( m_Openers != null )
|
if ( m_Openers != null )
|
||||||
{
|
{
|
||||||
Point3D worldLoc = GetWorldLocation();
|
Point3D worldLoc = GetWorldLocation();
|
||||||
Map map = this.Map;
|
Map map = this.Map;
|
||||||
|
|
||||||
for ( int i = 0; i < m_Openers.Count; ++i )
|
for ( int i = 0; i < m_Openers.Count; ++i )
|
||||||
{
|
{
|
||||||
Mobile mob = m_Openers[i];
|
Mobile mob = m_Openers[i];
|
||||||
|
|
||||||
if ( mob == opener )
|
if ( mob == opener )
|
||||||
{
|
{
|
||||||
contains = true;
|
contains = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int range = GetUpdateRange( mob );
|
int range = GetUpdateRange( mob );
|
||||||
|
|
||||||
if ( mob.Map != map || !mob.InRange( worldLoc, range ) )
|
if ( mob.Map != map || !mob.InRange( worldLoc, range ) )
|
||||||
m_Openers.RemoveAt( i-- );
|
m_Openers.RemoveAt( i-- );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !contains )
|
if ( !contains )
|
||||||
{
|
{
|
||||||
if ( m_Openers == null )
|
if ( m_Openers == null )
|
||||||
{
|
{
|
||||||
m_Openers = new List<Mobile>();
|
m_Openers = new List<Mobile>();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Openers.Add( opener );
|
m_Openers.Add( opener );
|
||||||
}
|
}
|
||||||
else if ( m_Openers != null && m_Openers.Count == 0 )
|
else if ( m_Openers != null && m_Openers.Count == 0 )
|
||||||
{
|
{
|
||||||
m_Openers = null;
|
m_Openers = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void GetProperties( ObjectPropertyList list )
|
public override void GetProperties( ObjectPropertyList list )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -401,7 +401,7 @@ namespace Server.Network
|
||||||
if ( (msgSize / 7) > 100 )
|
if ( (msgSize / 7) > 100 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
List<BuyItemResponse> buyList = new List<BuyItemResponse>( msgSize / 7 );
|
List<BuyItemResponse> buyList = new List<BuyItemResponse>( msgSize / 7 );
|
||||||
for ( ;msgSize>0;msgSize-=7)
|
for ( ;msgSize>0;msgSize-=7)
|
||||||
{
|
{
|
||||||
byte layer = pvSrc.ReadByte();
|
byte layer = pvSrc.ReadByte();
|
||||||
|
|
@ -443,7 +443,7 @@ namespace Server.Network
|
||||||
int count = pvSrc.ReadUInt16();
|
int count = pvSrc.ReadUInt16();
|
||||||
if ( count < 100 && pvSrc.Size == (1+2+4+2+(count*6)) )
|
if ( count < 100 && pvSrc.Size == (1+2+4+2+(count*6)) )
|
||||||
{
|
{
|
||||||
List<SellItemResponse> sellList = new List<SellItemResponse>( count );
|
List<SellItemResponse> sellList = new List<SellItemResponse>( count );
|
||||||
|
|
||||||
for (int i=0;i<count;i++)
|
for (int i=0;i<count;i++)
|
||||||
{
|
{
|
||||||
|
|
@ -765,8 +765,8 @@ namespace Server.Network
|
||||||
{
|
{
|
||||||
int skillIndex;
|
int skillIndex;
|
||||||
|
|
||||||
if ( !int.TryParse( command.Split( ' ' )[0], out skillIndex ) )
|
if ( !int.TryParse( command.Split( ' ' )[0], out skillIndex ) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Skills.UseSkill( m, skillIndex );
|
Skills.UseSkill( m, skillIndex );
|
||||||
|
|
||||||
|
|
@ -776,8 +776,8 @@ namespace Server.Network
|
||||||
{
|
{
|
||||||
int booktype;
|
int booktype;
|
||||||
|
|
||||||
if ( !int.TryParse( command, out booktype ) )
|
if ( !int.TryParse( command, out booktype ) )
|
||||||
booktype = 1;
|
booktype = 1;
|
||||||
|
|
||||||
EventSink.InvokeOpenSpellbookRequest( new OpenSpellbookRequestEventArgs( m, booktype ) );
|
EventSink.InvokeOpenSpellbookRequest( new OpenSpellbookRequestEventArgs( m, booktype ) );
|
||||||
|
|
||||||
|
|
@ -2284,25 +2284,25 @@ namespace Server.Network
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void LoginServerSeed( NetState state, PacketReader pvSrc )
|
public static void LoginServerSeed( NetState state, PacketReader pvSrc )
|
||||||
{
|
{
|
||||||
state.m_Seed = pvSrc.ReadInt32();
|
state.m_Seed = pvSrc.ReadInt32();
|
||||||
state.Seeded = true;
|
state.Seeded = true;
|
||||||
|
|
||||||
if ( state.m_Seed == 0 )
|
if ( state.m_Seed == 0 )
|
||||||
{
|
{
|
||||||
Console.WriteLine("Login: {0}: Invalid client detected, disconnecting", state);
|
Console.WriteLine("Login: {0}: Invalid client detected, disconnecting", state);
|
||||||
state.Dispose();
|
state.Dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int clientMaj = pvSrc.ReadInt32();
|
int clientMaj = pvSrc.ReadInt32();
|
||||||
int clientMin = pvSrc.ReadInt32();
|
int clientMin = pvSrc.ReadInt32();
|
||||||
int clientRev = pvSrc.ReadInt32();
|
int clientRev = pvSrc.ReadInt32();
|
||||||
int clientPat = pvSrc.ReadInt32();
|
int clientPat = pvSrc.ReadInt32();
|
||||||
|
|
||||||
state.Version = new ClientVersion( clientMaj, clientMin, clientRev, clientPat );
|
state.Version = new ClientVersion( clientMaj, clientMin, clientRev, clientPat );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AccountLogin( NetState state, PacketReader pvSrc )
|
public static void AccountLogin( NetState state, PacketReader pvSrc )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -249,8 +249,8 @@ namespace Server.Network
|
||||||
|
|
||||||
public sealed class VendorBuyContent : Packet
|
public sealed class VendorBuyContent : Packet
|
||||||
{
|
{
|
||||||
public VendorBuyContent( List<BuyItemState> list )
|
public VendorBuyContent( List<BuyItemState> list )
|
||||||
: base( 0x3c )
|
: base( 0x3c )
|
||||||
{
|
{
|
||||||
this.EnsureCapacity( list.Count*19 + 5 );
|
this.EnsureCapacity( list.Count*19 + 5 );
|
||||||
|
|
||||||
|
|
@ -326,8 +326,8 @@ namespace Server.Network
|
||||||
|
|
||||||
public sealed class VendorBuyList : Packet
|
public sealed class VendorBuyList : Packet
|
||||||
{
|
{
|
||||||
public VendorBuyList( Mobile vendor, List<BuyItemState> list )
|
public VendorBuyList( Mobile vendor, List<BuyItemState> list )
|
||||||
: base( 0x74 )
|
: base( 0x74 )
|
||||||
{
|
{
|
||||||
this.EnsureCapacity( 256 );
|
this.EnsureCapacity( 256 );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace Server.Prompts
|
||||||
|
|
||||||
public virtual void OnCancel( Mobile from )
|
public virtual void OnCancel( Mobile from )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void OnResponse( Mobile from, string text )
|
public virtual void OnResponse( Mobile from, string text )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ namespace Server
|
||||||
}
|
}
|
||||||
|
|
||||||
bin.Write( debug );
|
bin.Write( debug );
|
||||||
bin.Write( Core.Version.ToString() );
|
bin.Write( Core.Version.ToString() );
|
||||||
|
|
||||||
ms.Position = 0;
|
ms.Position = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -146,23 +146,23 @@ namespace Server
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IPMatchCIDR( string cidr, IPAddress ip )
|
public static bool IPMatchCIDR( string cidr, IPAddress ip )
|
||||||
{
|
{
|
||||||
if ( ip == null || ip.AddressFamily == AddressFamily.InterNetworkV6 )
|
if ( ip == null || ip.AddressFamily == AddressFamily.InterNetworkV6 )
|
||||||
return false; //Just worry about IPv4 for now
|
return false; //Just worry about IPv4 for now
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
string[] str = cidr.Split( '/' );
|
string[] str = cidr.Split( '/' );
|
||||||
|
|
||||||
if ( str.Length != 2 )
|
if ( str.Length != 2 )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* **************************************************
|
/* **************************************************
|
||||||
IPAddress cidrPrefix;
|
IPAddress cidrPrefix;
|
||||||
|
|
||||||
if ( !IPAddress.TryParse( str[0], out cidrPrefix ) )
|
if ( !IPAddress.TryParse( str[0], out cidrPrefix ) )
|
||||||
return false;
|
return false;
|
||||||
* */
|
* */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -180,7 +180,7 @@ namespace Server
|
||||||
|
|
||||||
uint cidrPrefix = OrderedAddressValue( bytes );
|
uint cidrPrefix = OrderedAddressValue( bytes );
|
||||||
|
|
||||||
int cidrLength = Utility.ToInt32( str[1] );
|
int cidrLength = Utility.ToInt32( str[1] );
|
||||||
//The below solution is the fastest solution of the three
|
//The below solution is the fastest solution of the three
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
@ -273,19 +273,19 @@ namespace Server
|
||||||
|
|
||||||
uint cidrPrefix = OrderedAddressValue( bytes );
|
uint cidrPrefix = OrderedAddressValue( bytes );
|
||||||
|
|
||||||
return IPMatchCIDR( cidrPrefix, ip, cidrLength );
|
return IPMatchCIDR( cidrPrefix, ip, cidrLength );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IPMatchCIDR( IPAddress cidrPrefix, IPAddress ip, int cidrLength )
|
public static bool IPMatchCIDR( IPAddress cidrPrefix, IPAddress ip, int cidrLength )
|
||||||
{
|
{
|
||||||
if ( cidrPrefix == null || ip == null || cidrPrefix.AddressFamily == AddressFamily.InterNetworkV6 ) //Ignore IPv6 for now
|
if ( cidrPrefix == null || ip == null || cidrPrefix.AddressFamily == AddressFamily.InterNetworkV6 ) //Ignore IPv6 for now
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint cidrValue = SwapUnsignedInt( (uint)GetLongAddressValue( cidrPrefix ) );
|
uint cidrValue = SwapUnsignedInt( (uint)GetLongAddressValue( cidrPrefix ) );
|
||||||
uint ipValue = SwapUnsignedInt( (uint)GetLongAddressValue( ip ) );
|
uint ipValue = SwapUnsignedInt( (uint)GetLongAddressValue( ip ) );
|
||||||
|
|
||||||
return IPMatchCIDR( cidrValue, ipValue, cidrLength );
|
return IPMatchCIDR( cidrValue, ipValue, cidrLength );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IPMatchCIDR( uint cidrPrefixValue, IPAddress ip, int cidrLength )
|
public static bool IPMatchCIDR( uint cidrPrefixValue, IPAddress ip, int cidrLength )
|
||||||
{
|
{
|
||||||
|
|
@ -481,10 +481,10 @@ namespace Server
|
||||||
public static bool InsensitiveStartsWith( string first, string second )
|
public static bool InsensitiveStartsWith( string first, string second )
|
||||||
{
|
{
|
||||||
return Insensitive.StartsWith( first, second );
|
return Insensitive.StartsWith( first, second );
|
||||||
}
|
}
|
||||||
|
|
||||||
#region To[Something]
|
#region To[Something]
|
||||||
public static bool ToBoolean( string value )
|
public static bool ToBoolean( string value )
|
||||||
{
|
{
|
||||||
bool b;
|
bool b;
|
||||||
bool.TryParse( value, out b );
|
bool.TryParse( value, out b );
|
||||||
|
|
@ -518,11 +518,11 @@ namespace Server
|
||||||
int.TryParse( value, out i );
|
int.TryParse( value, out i );
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Get[Something]
|
#region Get[Something]
|
||||||
public static int GetXMLInt32( string intString, int defaultValue )
|
public static int GetXMLInt32( string intString, int defaultValue )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -530,11 +530,11 @@ namespace Server
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
if ( int.TryParse( intString, out val ) )
|
if ( int.TryParse( intString, out val ) )
|
||||||
return val;
|
return val;
|
||||||
|
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -605,15 +605,15 @@ namespace Server
|
||||||
#pragma warning disable 618
|
#pragma warning disable 618
|
||||||
return address.Address;
|
return address.Address;
|
||||||
#pragma warning restore 618
|
#pragma warning restore 618
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public static double RandomDouble()
|
public static double RandomDouble()
|
||||||
{
|
{
|
||||||
return m_Random.NextDouble();
|
return m_Random.NextDouble();
|
||||||
}
|
}
|
||||||
#region In[...]Range
|
#region In[...]Range
|
||||||
public static bool InRange( Point3D p1, Point3D p2, int range )
|
public static bool InRange( Point3D p1, Point3D p2, int range )
|
||||||
{
|
{
|
||||||
return ( p1.m_X >= (p2.m_X - range) )
|
return ( p1.m_X >= (p2.m_X - range) )
|
||||||
&& ( p1.m_X <= (p2.m_X + range) )
|
&& ( p1.m_X <= (p2.m_X + range) )
|
||||||
|
|
@ -643,10 +643,10 @@ namespace Server
|
||||||
&& ( p1.X <= (p2.X + 18) )
|
&& ( p1.X <= (p2.X + 18) )
|
||||||
&& ( p1.Y >= (p2.Y - 18) )
|
&& ( p1.Y >= (p2.Y - 18) )
|
||||||
&& ( p1.Y <= (p2.Y + 18) );
|
&& ( p1.Y <= (p2.Y + 18) );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
public static Direction GetDirection( IPoint2D from, IPoint2D to )
|
public static Direction GetDirection( IPoint2D from, IPoint2D to )
|
||||||
{
|
{
|
||||||
int dx = to.X - from.X;
|
int dx = to.X - from.X;
|
||||||
int dy = to.Y - from.Y;
|
int dy = to.Y - from.Y;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue