Core/Refactor: Part 4
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Game.Network
|
||||
{
|
||||
public abstract class ClientPacket : IDisposable
|
||||
{
|
||||
public ClientPacket(WorldPacket worldPacket)
|
||||
protected ClientPacket(WorldPacket worldPacket)
|
||||
{
|
||||
_worldPacket = worldPacket;
|
||||
}
|
||||
@@ -48,13 +48,13 @@ namespace Game.Network
|
||||
|
||||
public abstract class ServerPacket
|
||||
{
|
||||
public ServerPacket(ServerOpcodes opcode)
|
||||
protected ServerPacket(ServerOpcodes opcode)
|
||||
{
|
||||
connectionType = ConnectionType.Realm;
|
||||
_worldPacket = new WorldPacket(opcode);
|
||||
}
|
||||
|
||||
public ServerPacket(ServerOpcodes opcode, ConnectionType type = ConnectionType.Realm)
|
||||
protected ServerPacket(ServerOpcodes opcode, ConnectionType type = ConnectionType.Realm)
|
||||
{
|
||||
connectionType = type;
|
||||
_worldPacket = new WorldPacket(opcode);
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace Game.Network
|
||||
|
||||
public abstract class PacketFilter
|
||||
{
|
||||
public PacketFilter(WorldSession pSession)
|
||||
protected PacketFilter(WorldSession pSession)
|
||||
{
|
||||
m_pSession = pSession;
|
||||
}
|
||||
|
||||
@@ -77,8 +77,6 @@ namespace Game.Network.Packets
|
||||
|
||||
public override void Read()
|
||||
{
|
||||
uint realmJoinTicketSize;
|
||||
|
||||
DosResponse = _worldPacket.ReadUInt64();
|
||||
Build = _worldPacket.ReadUInt16();
|
||||
BuildType = _worldPacket.ReadInt8();
|
||||
@@ -92,7 +90,7 @@ namespace Game.Network.Packets
|
||||
Digest = _worldPacket.ReadBytes(24);
|
||||
|
||||
UseIPv6 = _worldPacket.HasBit();
|
||||
realmJoinTicketSize = _worldPacket.ReadUInt32();
|
||||
uint realmJoinTicketSize = _worldPacket.ReadUInt32();
|
||||
if (realmJoinTicketSize != 0)
|
||||
RealmJoinTicket = _worldPacket.ReadString(realmJoinTicketSize);
|
||||
}
|
||||
|
||||
@@ -391,14 +391,13 @@ namespace Game.Network
|
||||
|
||||
Sha256 digestKeyHash = new Sha256();
|
||||
digestKeyHash.Process(account.game.SessionKey, account.game.SessionKey.Length);
|
||||
digestKeyHash.Finish(clientSeed, clientSeed.Length);
|
||||
digestKeyHash.Finish(clientSeed);
|
||||
|
||||
HmacSha256 hmac = new HmacSha256(digestKeyHash.Digest);
|
||||
hmac.Process(authSession.LocalChallenge, authSession.LocalChallenge.Count);
|
||||
hmac.Process(_serverChallenge, 16);
|
||||
hmac.Finish(AuthCheckSeed, 16);
|
||||
|
||||
|
||||
// Check that Key and account name are the same on client and server
|
||||
if (!hmac.Digest.Compare(authSession.Digest))
|
||||
{
|
||||
@@ -409,7 +408,7 @@ namespace Game.Network
|
||||
|
||||
|
||||
Sha256 keyData = new Sha256();
|
||||
keyData.Finish(account.game.SessionKey, account.game.SessionKey.Length);
|
||||
keyData.Finish(account.game.SessionKey);
|
||||
|
||||
HmacSha256 sessionKeyHmac = new HmacSha256(keyData.Digest);
|
||||
sessionKeyHmac.Process(_serverChallenge, 16);
|
||||
|
||||
Reference in New Issue
Block a user