Console client: New packet types. Preparing to join game.

This commit is contained in:
lotodore
2008-12-21 01:37:17 +00:00
parent 4f78b32f9d
commit 2aec6c8534
11 changed files with 308 additions and 12 deletions
+10 -3
View File
@@ -78,16 +78,23 @@ namespace pokerth_console
int gameNameLen = IPAddress.NetworkToHostOrder((short)r.ReadUInt16());
Properties.Add(PropertyType.PropCurNumPlayers,
Convert.ToString(IPAddress.NetworkToHostOrder((short)r.ReadUInt16())));
Properties.Add(PropertyType.PropGameFlags,
int curNumPlayers = IPAddress.NetworkToHostOrder((short)r.ReadUInt16());
Properties.Add(PropertyType.PropCurNumPlayers, Convert.ToString(curNumPlayers));
Properties.Add(PropertyType.PropGamePrivacyFlags,
Convert.ToString(IPAddress.NetworkToHostOrder((short)r.ReadUInt16())));
r.ReadBytes(28); // Skip game info block for now.
// Read name of the game.
byte[] tmpName = r.ReadBytes(gameNameLen);
Properties.Add(PropertyType.PropGameName,
Encoding.UTF8.GetString(tmpName));
// Read player ids.
List<string> playerSlots = new List<string>();
for (int i = 0; i < curNumPlayers; i++)
playerSlots.Add(Convert.ToString(IPAddress.NetworkToHostOrder((int)r.ReadUInt32())));
ListProperties.Add(ListPropertyType.PropPlayerSlots, playerSlots);
}
public override byte[] ToByteArray()