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