some (possible) bugs are fixed when starting but not all. Discussion needed .
This commit is contained in:
parent
0dd135fc12
commit
73be43d6ad
|
@ -328,8 +328,11 @@ void ConnectionSlot::update(bool checkForNewClients)
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case nmtReady:
|
||||
{
|
||||
// its simply ignored here. Probably we are starting a game
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
//throw runtime_error("Unexpected message in connection slot: " + intToStr(networkMessageType));
|
||||
|
|
|
@ -419,8 +419,8 @@ public:
|
|||
// =====================================================
|
||||
// class SwitchSetupRequest
|
||||
//
|
||||
// Message sent from the server to the client
|
||||
// when the client connects and vice versa
|
||||
// Message sent from the client to the server
|
||||
// to switch its settings
|
||||
// =====================================================
|
||||
|
||||
class SwitchSetupRequest: public NetworkMessage{
|
||||
|
@ -453,10 +453,10 @@ public:
|
|||
};
|
||||
|
||||
// =====================================================
|
||||
// class SwitchSetupRequest
|
||||
// class PlayerIndexMessage
|
||||
//
|
||||
// Message sent from the server to the client
|
||||
// when the client connects and vice versa
|
||||
// Message sent from the server to the clients
|
||||
// to tell them about a slot change ( caused by another client )
|
||||
// =====================================================
|
||||
|
||||
class PlayerIndexMessage: public NetworkMessage{
|
||||
|
|
|
@ -308,6 +308,13 @@ void ServerInterface::waitUntilReady(Checksum* checksum){
|
|||
NetworkMessageType networkMessageType= connectionSlot->getNextMessageType(true);
|
||||
NetworkMessageReady networkMessageReady;
|
||||
|
||||
// consume old messages from the setup
|
||||
while(networkMessageType == nmtSwitchSetupRequest)
|
||||
{
|
||||
SwitchSetupRequest switchSetupRequest;
|
||||
connectionSlot->receiveMessage(&switchSetupRequest);
|
||||
networkMessageType= connectionSlot->getNextMessageType(true);
|
||||
}
|
||||
if(networkMessageType == nmtReady &&
|
||||
connectionSlot->receiveMessage(&networkMessageReady))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user