Fixes casting checks

This commit is contained in:
Kamron Batman 2018-08-19 01:38:55 +08:00
parent 7ea00fbf4f
commit 03dd5f1926
431 changed files with 5616 additions and 6250 deletions

View file

@ -441,7 +441,7 @@ namespace Server.Network
byte layer = pvSrc.ReadByte();
Serial serial = pvSrc.ReadInt32();
int amount = pvSrc.ReadInt16();
buyList.Add( new BuyItemResponse( serial, amount ) );
}
@ -2028,11 +2028,11 @@ namespace Server.Network
public static PlayCharCallback ThirdPartyAuthCallback = null, ThirdPartyHackedCallback = null;
private static byte[] m_ThirdPartyAuthKey = new byte[]
{
0x9, 0x11, 0x83, (byte)'+', 0x4, 0x17, 0x83,
0x5, 0x24, 0x85,
0x7, 0x17, 0x87,
private static byte[] m_ThirdPartyAuthKey = new byte[]
{
0x9, 0x11, 0x83, (byte)'+', 0x4, 0x17, 0x83,
0x5, 0x24, 0x85,
0x7, 0x17, 0x87,
0x6, 0x19, 0x88,
};
@ -2080,7 +2080,7 @@ namespace Server.Network
bool match = true;
for ( int i=0; match && i < m_ThirdPartyAuthKey.Length; i++ )
match = match && pvSrc.ReadByte() == m_ThirdPartyAuthKey[i];
if ( match )
authOK = true;
}
@ -2308,7 +2308,7 @@ namespace Server.Network
race = Race.Races[(byte)(genderRace / 2)];
}
if( race == null )
if ( race == null )
race = Race.DefaultRace;
CityInfo[] info = state.CityInfo;
@ -2427,8 +2427,8 @@ namespace Server.Network
byte raceID = (byte)(genderRace < 4 ? 0 : ((genderRace / 2) - 1));
race = Race.Races[raceID];
if( race == null )
if ( race == null )
race = Race.DefaultRace;
CityInfo[] info = state.CityInfo;
@ -2518,7 +2518,7 @@ namespace Server.Network
private static Dictionary<int, AuthIDPersistence> m_AuthIDWindow = new Dictionary<int, AuthIDPersistence>( m_AuthIDWindowSize );
private static int GenerateAuthID( NetState state )
{
{
if ( m_AuthIDWindow.Count == m_AuthIDWindowSize ) {
int oldestID = 0;
DateTime oldest = DateTime.MaxValue;
@ -2532,7 +2532,7 @@ namespace Server.Network
m_AuthIDWindow.Remove( oldestID );
}
int authID;
do {
@ -2543,7 +2543,7 @@ namespace Server.Network
} while ( m_AuthIDWindow.ContainsKey( authID ) );
m_AuthIDWindow[authID] = new AuthIDPersistence( state.Version );
return authID;
}
@ -2569,7 +2569,7 @@ namespace Server.Network
state.Dispose();
return;
}
if ( state.m_AuthID != 0 && authID != state.m_AuthID )
{
Console.WriteLine( "Login: {0}: Invalid client detected, disconnecting", state );