Fixed relationship of network session and player data to be consistent with the game engine. Now sending card's values via network. Fixed net packet checks.

This commit is contained in:
lotodore
2007-05-13 22:25:59 +00:00
parent e2d394f576
commit 7540ea17bd
21 changed files with 282 additions and 72 deletions
+16 -3
View File
@@ -416,7 +416,6 @@ ClientStateWaitGame::Process(ClientThread &client)
ClientContext &context = client.GetContext();
// delegate to receiver helper class
boost::shared_ptr<NetPacket> tmpPacket = client.GetReceiver().Recv(context.GetSocket());
if (tmpPacket.get())
@@ -424,7 +423,7 @@ ClientStateWaitGame::Process(ClientThread &client)
if (tmpPacket->ToNetPacketGameStart())
{
client.SetState(ClientStateFinal::Instance());
retVal = MSG_NET_GAME_START;
retVal = MSG_NET_GAME_CLIENT_START;
}
else if (tmpPacket->ToNetPacketPlayerJoined())
{
@@ -467,7 +466,21 @@ ClientStateFinal::~ClientStateFinal()
int
ClientStateFinal::Process(ClientThread &client)
{
Thread::Msleep(CLIENT_WAIT_TIMEOUT_MSEC);
ClientContext &context = client.GetContext();
// delegate to receiver helper class
boost::shared_ptr<NetPacket> tmpPacket = client.GetReceiver().Recv(context.GetSocket());
if (tmpPacket.get())
{
if (tmpPacket->ToNetPacketHandStart())
{
// TODO
NetPacketHandStart::Data tmpData;
tmpPacket->ToNetPacketHandStart()->GetData(tmpData);
int z = 1;
}
}
return MSG_SOCK_INTERNAL_PENDING;
}