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