mirror of
https://github.com/glest/glest-source.git
synced 2025-09-01 20:12:40 +02:00
- bugfix for new custom ping msg
This commit is contained in:
@@ -48,7 +48,7 @@ struct FormatString {
|
||||
MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainMenu,JoinMenu joinMenuInfo, bool openNetworkSlots):
|
||||
MenuState(program, mainMenu, "connected-game") //← set on connected-game
|
||||
{
|
||||
lastNetworkSendPing = time(NULL);
|
||||
lastNetworkSendPing = 0;
|
||||
|
||||
returnMenuInfo=joinMenuInfo;
|
||||
Lang &lang= Lang::getInstance();
|
||||
@@ -362,6 +362,7 @@ void MenuStateConnectedGame::update()
|
||||
ClientInterface* clientInterface= NetworkManager::getInstance().getClientInterface();
|
||||
Lang &lang= Lang::getInstance();
|
||||
|
||||
if(clientInterface != NULL && clientInterface->isConnected()) {
|
||||
if(difftime(time(NULL),lastNetworkSendPing) >= GameConstants::networkPingInterval) {
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] about to sendPingMessage...\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
@@ -375,6 +376,7 @@ void MenuStateConnectedGame::update()
|
||||
clientInterface->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//update status label
|
||||
if(clientInterface != NULL && clientInterface->isConnected()) {
|
||||
|
@@ -1163,6 +1163,7 @@ void MenuStateCustomGame::simpleTask() {
|
||||
if(needPing == true) {
|
||||
lastNetworkPing = time(NULL);
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] Sending nmtPing to clients\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
ServerInterface* serverInterface= NetworkManager::getInstance().getServerInterface();
|
||||
NetworkMessagePing msg(GameConstants::networkPingInterval,time(NULL));
|
||||
serverInterface->broadcastPing(&msg);
|
||||
|
Reference in New Issue
Block a user