Skip to content
Snippets Groups Projects
Commit d7f9b3f6 authored by Julian Pychy's avatar Julian Pychy
Browse files

fixed network mode

parent ae062542
No related branches found
No related tags found
No related merge requests found
......@@ -78,8 +78,17 @@ bool NetworkServer::WaitForFirstClientLogin(){
short connectionPurpose;
*theStreams.at(i) >> connectionPurpose;
if(connectionPurpose != NetworkClient::CLIENTMESSAGE_LOGIN){
Alert << "ERROR: Client did not login" << endmsg;
if(connectionPurpose == NetworkClient::CLIENTMESSAGE_HEARTBEAT){
short clientID;
*theStreams.at(i) >> clientID;
*theStreams.at(i) << NetworkServer::SERVERMESSAGE_OK << "\n";
theStreams.at(i)->flush();
theStreams.at(i)->close();
i--;
continue;
}
else if(connectionPurpose != NetworkClient::CLIENTMESSAGE_LOGIN){
Alert << "ERROR: Client did not login. Message: " << connectionPurpose << endmsg;
SendClosingMessage(theStreams.at(i));
i--;
continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment