mirror of
https://github.com/glest/glest-source.git
synced 2025-08-29 10:49:48 +02:00
headless servers have special game names
This commit is contained in:
@@ -390,8 +390,12 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
|
|||||||
labelGameName.init(110, networkHeadPos-2*labelOffset,100);
|
labelGameName.init(110, networkHeadPos-2*labelOffset,100);
|
||||||
labelGameName.setFont(CoreData::getInstance().getMenuFontBig());
|
labelGameName.setFont(CoreData::getInstance().getMenuFontBig());
|
||||||
labelGameName.setFont3D(CoreData::getInstance().getMenuFontBig3D());
|
labelGameName.setFont3D(CoreData::getInstance().getMenuFontBig3D());
|
||||||
labelGameName.setText(defaultPlayerName+"'s game");
|
if(Window::getMasterserverMode() == false) {
|
||||||
|
labelGameName.setText(defaultPlayerName+"'s game");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
labelGameName.setText("headless("+defaultPlayerName+")");
|
||||||
|
}
|
||||||
// Network Frame Period
|
// Network Frame Period
|
||||||
//labelNetworkFramePeriod.registerGraphicComponent(containerName,"labelNetworkFramePeriod");
|
//labelNetworkFramePeriod.registerGraphicComponent(containerName,"labelNetworkFramePeriod");
|
||||||
//labelNetworkFramePeriod.init(xoffset+230, networkHeadPos, 80);
|
//labelNetworkFramePeriod.init(xoffset+230, networkHeadPos, 80);
|
||||||
@@ -2741,7 +2745,7 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
|
|||||||
}
|
}
|
||||||
|
|
||||||
//printf("this->masterserverMode = %d\n",this->masterserverMode);
|
//printf("this->masterserverMode = %d\n",this->masterserverMode);
|
||||||
|
bool masterserver_admin_found=false;
|
||||||
if(this->masterserverMode == true) {
|
if(this->masterserverMode == true) {
|
||||||
time_t clientConnectedTime = 0;
|
time_t clientConnectedTime = 0;
|
||||||
|
|
||||||
@@ -2762,14 +2766,20 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
|
|||||||
(serverInterface->getSlot(i)->getConnectedTime() > 0 && serverInterface->getSlot(i)->getConnectedTime() < clientConnectedTime)) {
|
(serverInterface->getSlot(i)->getConnectedTime() > 0 && serverInterface->getSlot(i)->getConnectedTime() < clientConnectedTime)) {
|
||||||
clientConnectedTime = serverInterface->getSlot(i)->getConnectedTime();
|
clientConnectedTime = serverInterface->getSlot(i)->getConnectedTime();
|
||||||
gameSettings->setMasterserver_admin(serverInterface->getSlot(i)->getSessionKey());
|
gameSettings->setMasterserver_admin(serverInterface->getSlot(i)->getSessionKey());
|
||||||
|
labelGameName.setText(serverInterface->getSlot(i)->getName()+" controls");
|
||||||
//printf("slot = %d, admin key [%d] slot connected time[%lu] clientConnectedTime [%lu]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime);
|
//printf("slot = %d, admin key [%d] slot connected time[%lu] clientConnectedTime [%lu]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime);
|
||||||
}
|
}
|
||||||
|
if(serverInterface->getSlot(i)->getSessionKey() == gameSettings->getMasterserver_admin()){
|
||||||
|
masterserver_admin_found=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!masterserver_admin_found)
|
||||||
|
{
|
||||||
|
labelGameName.setText("headless("+defaultPlayerName+")");
|
||||||
|
}
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user