Console client: Support for additional network packets. Preparing game.

This commit is contained in:
lotodore
2008-12-22 23:03:15 +00:00
parent 16ac9b161e
commit ea2a1288be
25 changed files with 802 additions and 74 deletions
+3 -3
View File
@@ -52,17 +52,17 @@ namespace pokerth_console
{
if (size < 16)
throw new NetPacketException("NetPacketPlayerInfo invalid size.");
Properties.Add(PropertyType.PropPlayerId,
Properties.Add(PropertyType.PlayerId,
Convert.ToString(IPAddress.NetworkToHostOrder((int)r.ReadUInt32())));
int playerFlags = IPAddress.NetworkToHostOrder((short)r.ReadUInt16());
Properties.Add(PropertyType.PropPlayerFlags, Convert.ToString(playerFlags));
Properties.Add(PropertyType.PlayerFlags, Convert.ToString(playerFlags));
int playerNameLen = IPAddress.NetworkToHostOrder((short)r.ReadUInt16());
r.ReadUInt32(); // reserved
if ((playerFlags & PlayerFlagAvatar) == PlayerFlagAvatar)
r.ReadBytes(16); // Skip avatar md5.
byte[] tmpName = r.ReadBytes(playerNameLen);
Properties.Add(PropertyType.PropPlayerName,
Properties.Add(PropertyType.PlayerName,
Encoding.UTF8.GetString(tmpName));
}