mirror of
https://github.com/glest/glest-source.git
synced 2025-10-02 18:36:48 +02:00
- headless mode now properly uses selected slot of player
This commit is contained in:
@@ -167,7 +167,7 @@ static void cleanupProcessObjects() {
|
|||||||
time_t elapsed = time(NULL);
|
time_t elapsed = time(NULL);
|
||||||
for(;Thread::getThreadList().size() > 0 &&
|
for(;Thread::getThreadList().size() > 0 &&
|
||||||
difftime(time(NULL),elapsed) <= 10;) {
|
difftime(time(NULL),elapsed) <= 10;) {
|
||||||
sleep(10);
|
//sleep(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<string, vector<FileReader<Pixmap2D> const * >* > &list2d = FileReader<Pixmap2D>::getFileReadersMap();
|
std::map<string, vector<FileReader<Pixmap2D> const * >* > &list2d = FileReader<Pixmap2D>::getFileReadersMap();
|
||||||
|
@@ -931,6 +931,8 @@ void MenuStateConnectedGame::broadCastGameSettingsToMasterserver() {
|
|||||||
GameSettings gameSettings = *clientInterface->getGameSettings();
|
GameSettings gameSettings = *clientInterface->getGameSettings();
|
||||||
loadGameSettings(&gameSettings);
|
loadGameSettings(&gameSettings);
|
||||||
|
|
||||||
|
//printf("broadcast settings:\n%s\n",gameSettings.toString().c_str());
|
||||||
|
|
||||||
//printf("Client sending map [%s] admin key [%d]\n",gameSettings.getMap().c_str(),gameSettings.getMasterserver_admin());
|
//printf("Client sending map [%s] admin key [%d]\n",gameSettings.getMap().c_str(),gameSettings.getMasterserver_admin());
|
||||||
|
|
||||||
//clientInterface->setGameSettings(&gameSettings);
|
//clientInterface->setGameSettings(&gameSettings);
|
||||||
@@ -1547,7 +1549,7 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
|
|||||||
//if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, slotIndex = %d, getHumanPlayerName(i) [%s]\n",__FILE__,__FUNCTION__,__LINE__,i,slotIndex,getHumanPlayerName(i).c_str());
|
//if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, slotIndex = %d, getHumanPlayerName(i) [%s]\n",__FILE__,__FUNCTION__,__LINE__,i,slotIndex,getHumanPlayerName(i).c_str());
|
||||||
|
|
||||||
gameSettings->setThisFactionIndex(slotIndex);
|
gameSettings->setThisFactionIndex(slotIndex);
|
||||||
//gameSettings->setNetworkPlayerName(slotIndex, getHumanPlayerName(i));
|
gameSettings->setNetworkPlayerName(slotIndex, getHumanPlayerName());
|
||||||
gameSettings->setNetworkPlayerStatuses(slotIndex, getNetworkPlayerStatus());
|
gameSettings->setNetworkPlayerStatuses(slotIndex, getNetworkPlayerStatus());
|
||||||
Lang &lang= Lang::getInstance();
|
Lang &lang= Lang::getInstance();
|
||||||
gameSettings->setNetworkPlayerLanguages(slotIndex, lang.getLanguage());
|
gameSettings->setNetworkPlayerLanguages(slotIndex, lang.getLanguage());
|
||||||
@@ -1581,7 +1583,7 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
|
|||||||
|
|
||||||
gameSettings->setTeam(slotIndex, listBoxTeams[i].getSelectedItemIndex());
|
gameSettings->setTeam(slotIndex, listBoxTeams[i].getSelectedItemIndex());
|
||||||
gameSettings->setStartLocationIndex(slotIndex, i);
|
gameSettings->setStartLocationIndex(slotIndex, i);
|
||||||
|
//printf("!!! setStartLocationIndex #1 slotIndex = %d, i = %d\n",slotIndex, i);
|
||||||
|
|
||||||
if(listBoxControls[i].getSelectedItemIndex() == ctNetwork || listBoxControls[i].getSelectedItemIndex() == ctNetworkUnassigned) {
|
if(listBoxControls[i].getSelectedItemIndex() == ctNetwork || listBoxControls[i].getSelectedItemIndex() == ctNetworkUnassigned) {
|
||||||
// if(serverInterface->getSlot(i) != NULL &&
|
// if(serverInterface->getSlot(i) != NULL &&
|
||||||
@@ -1613,7 +1615,7 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//gameSettings->setNetworkPlayerName("");
|
//gameSettings->setNetworkPlayerName("");
|
||||||
gameSettings->setNetworkPlayerStatuses(factionCount, 0);
|
//gameSettings->setNetworkPlayerStatuses(factionCount, 0);
|
||||||
labelPlayerNames[i].setText("");
|
labelPlayerNames[i].setText("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1628,11 +1630,14 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
|
|||||||
gameSettings->setFactionControl(slotIndex, ct);
|
gameSettings->setFactionControl(slotIndex, ct);
|
||||||
gameSettings->setTeam(slotIndex, listBoxTeams[i].getSelectedItemIndex());
|
gameSettings->setTeam(slotIndex, listBoxTeams[i].getSelectedItemIndex());
|
||||||
gameSettings->setStartLocationIndex(slotIndex, i);
|
gameSettings->setStartLocationIndex(slotIndex, i);
|
||||||
|
//printf("!!! setStartLocationIndex #2 slotIndex = %d, i = %d\n",slotIndex, i);
|
||||||
|
|
||||||
gameSettings->setResourceMultiplierIndex(slotIndex, 10);
|
gameSettings->setResourceMultiplierIndex(slotIndex, 10);
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, factionFiles[listBoxFactions[i].getSelectedItemIndex()] [%s]\n",__FILE__,__FUNCTION__,__LINE__,i,factionFiles[listBoxFactions[i].getSelectedItemIndex()].c_str());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, factionFiles[listBoxFactions[i].getSelectedItemIndex()] [%s]\n",__FILE__,__FUNCTION__,__LINE__,i,factionFiles[listBoxFactions[i].getSelectedItemIndex()].c_str());
|
||||||
|
|
||||||
gameSettings->setFactionTypeName(slotIndex, factionFiles[listBoxFactions[i].getSelectedItemIndex()]);
|
gameSettings->setFactionTypeName(slotIndex, factionFiles[listBoxFactions[i].getSelectedItemIndex()]);
|
||||||
|
gameSettings->setNetworkPlayerStatuses(slotIndex, 0);
|
||||||
gameSettings->setNetworkPlayerName(slotIndex, "Closed");
|
gameSettings->setNetworkPlayerName(slotIndex, "Closed");
|
||||||
|
|
||||||
closedCount++;
|
closedCount++;
|
||||||
@@ -2528,6 +2533,8 @@ void MenuStateConnectedGame::update() {
|
|||||||
vector<string> maps,tilesets,techtree;
|
vector<string> maps,tilesets,techtree;
|
||||||
const GameSettings *gameSettings = clientInterface->getGameSettings();
|
const GameSettings *gameSettings = clientInterface->getGameSettings();
|
||||||
|
|
||||||
|
//printf("got settings:\n%s\n",gameSettings->toString().c_str());
|
||||||
|
|
||||||
if(gameSettings == NULL) {
|
if(gameSettings == NULL) {
|
||||||
throw runtime_error("gameSettings == NULL");
|
throw runtime_error("gameSettings == NULL");
|
||||||
}
|
}
|
||||||
|
@@ -1763,11 +1763,18 @@ void MenuStateCustomGame::update() {
|
|||||||
if(this->masterserverMode == true && serverInterface->getGameSettingsUpdateCount() > lastMasterServerSettingsUpdateCount &&
|
if(this->masterserverMode == true && serverInterface->getGameSettingsUpdateCount() > lastMasterServerSettingsUpdateCount &&
|
||||||
serverInterface->getGameSettings() != NULL) {
|
serverInterface->getGameSettings() != NULL) {
|
||||||
const GameSettings *settings = serverInterface->getGameSettings();
|
const GameSettings *settings = serverInterface->getGameSettings();
|
||||||
|
//printf("\n\n\n\n=====#1 got settings [%d] [%d]:\n%s\n",lastMasterServerSettingsUpdateCount,serverInterface->getGameSettingsUpdateCount(),settings->toString().c_str());
|
||||||
|
|
||||||
lastMasterServerSettingsUpdateCount = serverInterface->getGameSettingsUpdateCount();
|
lastMasterServerSettingsUpdateCount = serverInterface->getGameSettingsUpdateCount();
|
||||||
//printf("#2 custom menu got map [%s]\n",settings->getMap().c_str());
|
//printf("#2 custom menu got map [%s]\n",settings->getMap().c_str());
|
||||||
|
|
||||||
setupUIFromGameSettings(*settings);
|
setupUIFromGameSettings(*settings);
|
||||||
|
|
||||||
|
GameSettings gameSettings;
|
||||||
|
loadGameSettings(&gameSettings);
|
||||||
|
|
||||||
|
//printf("\n\n\n\n=====#1.1 got settings [%d] [%d]:\n%s\n",lastMasterServerSettingsUpdateCount,serverInterface->getGameSettingsUpdateCount(),gameSettings.toString().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
if(this->masterserverMode == true && serverInterface->getMasterserverAdminRequestLaunch() == true) {
|
if(this->masterserverMode == true && serverInterface->getMasterserverAdminRequestLaunch() == true) {
|
||||||
safeMutex.ReleaseLock();
|
safeMutex.ReleaseLock();
|
||||||
@@ -2341,11 +2348,6 @@ void MenuStateCustomGame::simpleTask(BaseThread *callingThread) {
|
|||||||
|
|
||||||
//printf("simpleTask broadCastSettings = %d hasClientConnection = %d\n",broadCastSettings,hasClientConnection);
|
//printf("simpleTask broadCastSettings = %d hasClientConnection = %d\n",broadCastSettings,hasClientConnection);
|
||||||
|
|
||||||
GameSettings gameSettings;
|
|
||||||
loadGameSettings(&gameSettings);
|
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
|
||||||
|
|
||||||
if(callingThread->getQuitStatus() == true) {
|
if(callingThread->getQuitStatus() == true) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2353,7 +2355,15 @@ void MenuStateCustomGame::simpleTask(BaseThread *callingThread) {
|
|||||||
if(serverInterface != NULL) {
|
if(serverInterface != NULL) {
|
||||||
|
|
||||||
if(this->masterserverMode == false || (serverInterface->getGameSettingsUpdateCount() <= lastMasterServerSettingsUpdateCount)) {
|
if(this->masterserverMode == false || (serverInterface->getGameSettingsUpdateCount() <= lastMasterServerSettingsUpdateCount)) {
|
||||||
|
GameSettings gameSettings;
|
||||||
|
loadGameSettings(&gameSettings);
|
||||||
|
|
||||||
|
//printf("\n\n\n\n=====#2 got settings [%d] [%d]:\n%s\n",lastMasterServerSettingsUpdateCount,serverInterface->getGameSettingsUpdateCount(),gameSettings.toString().c_str());
|
||||||
|
|
||||||
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
serverInterface->setGameSettings(&gameSettings,false);
|
serverInterface->setGameSettings(&gameSettings,false);
|
||||||
|
lastMasterServerSettingsUpdateCount = serverInterface->getGameSettingsUpdateCount();
|
||||||
|
|
||||||
if(hasClientConnection == true) {
|
if(hasClientConnection == true) {
|
||||||
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__);
|
||||||
@@ -2415,6 +2425,7 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
|
|||||||
if(this->masterserverMode == true && serverInterface->getGameSettingsUpdateCount() > lastMasterServerSettingsUpdateCount &&
|
if(this->masterserverMode == true && serverInterface->getGameSettingsUpdateCount() > lastMasterServerSettingsUpdateCount &&
|
||||||
serverInterface->getGameSettings() != NULL) {
|
serverInterface->getGameSettings() != NULL) {
|
||||||
const GameSettings *settings = serverInterface->getGameSettings();
|
const GameSettings *settings = serverInterface->getGameSettings();
|
||||||
|
//printf("\n\n\n\n=====#3 got settings [%d] [%d]:\n%s\n",lastMasterServerSettingsUpdateCount,serverInterface->getGameSettingsUpdateCount(),settings->toString().c_str());
|
||||||
|
|
||||||
lastMasterServerSettingsUpdateCount = serverInterface->getGameSettingsUpdateCount();
|
lastMasterServerSettingsUpdateCount = serverInterface->getGameSettingsUpdateCount();
|
||||||
//printf("#1 custom menu got map [%s]\n",settings->getMap().c_str());
|
//printf("#1 custom menu got map [%s]\n",settings->getMap().c_str());
|
||||||
@@ -2668,7 +2679,7 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
|
|||||||
|
|
||||||
//printf("slot = %d serverInterface->getSlot(i)->getConnectedTime() = %d session key [%d]\n",i,serverInterface->getSlot(i)->getConnectedTime(),serverInterface->getSlot(i)->getSessionKey());
|
//printf("slot = %d serverInterface->getSlot(i)->getConnectedTime() = %d session key [%d]\n",i,serverInterface->getSlot(i)->getConnectedTime(),serverInterface->getSlot(i)->getSessionKey());
|
||||||
|
|
||||||
if(clientConnectedTime == 0 ||
|
if(clientConnectedTime == 0 || clientConnectedTime == 0 ||
|
||||||
(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());
|
||||||
@@ -2678,7 +2689,6 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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__);
|
||||||
@@ -2918,36 +2928,40 @@ void MenuStateCustomGame::setupUIFromGameSettings(const GameSettings &gameSettin
|
|||||||
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__);
|
||||||
|
|
||||||
reloadFactions(false);
|
reloadFactions(false);
|
||||||
|
//reloadFactions(true);
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Line: %d] gameSettings.getFactionCount() = %d\n",__FILE__,__FUNCTION__,__LINE__,gameSettings.getFactionCount());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Line: %d] gameSettings.getFactionCount() = %d\n",__FILE__,__FUNCTION__,__LINE__,gameSettings.getFactionCount());
|
||||||
|
|
||||||
for(int i = 0; i < GameConstants::maxPlayers; ++i) {
|
for(int i = 0; i < GameConstants::maxPlayers; ++i) {
|
||||||
if(gameSettings.getFactionControl(i) < listBoxControls[i].getItemCount()) {
|
int slotIndex = gameSettings.getStartLocationIndex(i);
|
||||||
listBoxControls[i].setSelectedItemIndex(gameSettings.getFactionControl(i));
|
if(gameSettings.getFactionControl(i) < listBoxControls[slotIndex].getItemCount()) {
|
||||||
|
listBoxControls[slotIndex].setSelectedItemIndex(gameSettings.getFactionControl(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
updateResourceMultiplier(i);
|
updateResourceMultiplier(slotIndex);
|
||||||
listBoxRMultiplier[i].setSelectedItemIndex(gameSettings.getResourceMultiplierIndex(i));
|
listBoxRMultiplier[slotIndex].setSelectedItemIndex(gameSettings.getResourceMultiplierIndex(i));
|
||||||
|
|
||||||
listBoxTeams[i].setSelectedItemIndex(gameSettings.getTeam(i));
|
listBoxTeams[slotIndex].setSelectedItemIndex(gameSettings.getTeam(i));
|
||||||
|
|
||||||
lastSelectedTeamIndex[i] = listBoxTeams[i].getSelectedItemIndex();
|
lastSelectedTeamIndex[slotIndex] = listBoxTeams[slotIndex].getSelectedItemIndex();
|
||||||
|
|
||||||
string factionName = gameSettings.getFactionTypeName(i);
|
string factionName = gameSettings.getFactionTypeName(i);
|
||||||
factionName = formatString(factionName);
|
factionName = formatString(factionName);
|
||||||
|
|
||||||
|
//printf("\n\n\n*** setupUIFromGameSettings A, i = %d, startLoc = %d, factioncontrol = %d, factionName [%s]\n",i,gameSettings.getStartLocationIndex(i),gameSettings.getFactionControl(i),factionName.c_str());
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] factionName = [%s]\n",__FILE__,__FUNCTION__,__LINE__,factionName.c_str());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] factionName = [%s]\n",__FILE__,__FUNCTION__,__LINE__,factionName.c_str());
|
||||||
|
|
||||||
if(listBoxFactions[i].hasItem(factionName) == true) {
|
if(listBoxFactions[slotIndex].hasItem(factionName) == true) {
|
||||||
listBoxFactions[i].setSelectedItem(factionName);
|
listBoxFactions[slotIndex].setSelectedItem(factionName);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
listBoxFactions[i].setSelectedItem(formatString(GameConstants::RANDOMFACTION_SLOTNAME));
|
listBoxFactions[slotIndex].setSelectedItem(formatString(GameConstants::RANDOMFACTION_SLOTNAME));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, gameSettings.getNetworkPlayerName(i) [%s]\n",__FILE__,__FUNCTION__,__LINE__,i,gameSettings.getNetworkPlayerName(i).c_str());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, gameSettings.getNetworkPlayerName(i) [%s]\n",__FILE__,__FUNCTION__,__LINE__,i,gameSettings.getNetworkPlayerName(i).c_str());
|
||||||
|
|
||||||
labelPlayerNames[i].setText(gameSettings.getNetworkPlayerName(i));
|
labelPlayerNames[slotIndex].setText(gameSettings.getNetworkPlayerName(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
//SetActivePlayerNameEditor();
|
//SetActivePlayerNameEditor();
|
||||||
|
@@ -592,6 +592,7 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
|||||||
networkMessageLaunch.buildGameSettings(&gameSettings);
|
networkMessageLaunch.buildGameSettings(&gameSettings);
|
||||||
|
|
||||||
//printf("Connection slot got networkMessageLaunch.getMessageType() = %d, got map [%s]\n",networkMessageLaunch.getMessageType(),gameSettings.getMap().c_str());
|
//printf("Connection slot got networkMessageLaunch.getMessageType() = %d, got map [%s]\n",networkMessageLaunch.getMessageType(),gameSettings.getMap().c_str());
|
||||||
|
//printf("\n\n\n\n=====Connection slot got settings:\n%s\n",gameSettings.toString().c_str());
|
||||||
|
|
||||||
this->serverInterface->setGameSettings(&gameSettings,false);
|
this->serverInterface->setGameSettings(&gameSettings,false);
|
||||||
this->serverInterface->broadcastGameSetup(&gameSettings);
|
this->serverInterface->broadcastGameSetup(&gameSettings);
|
||||||
|
@@ -270,7 +270,8 @@ NetworkMessageLaunch::NetworkMessageLaunch(const GameSettings *gameSettings,int8
|
|||||||
data.pathFinderType = gameSettings->getPathFinderType();
|
data.pathFinderType = gameSettings->getPathFinderType();
|
||||||
data.flagTypes1 = gameSettings->getFlagTypes1();
|
data.flagTypes1 = gameSettings->getFlagTypes1();
|
||||||
|
|
||||||
for(int i= 0; i < data.factionCount; ++i) {
|
//for(int i= 0; i < data.factionCount; ++i) {
|
||||||
|
for(int i= 0; i < GameConstants::maxPlayers; ++i) {
|
||||||
data.factionTypeNames[i]= gameSettings->getFactionTypeName(i);
|
data.factionTypeNames[i]= gameSettings->getFactionTypeName(i);
|
||||||
data.networkPlayerNames[i]= gameSettings->getNetworkPlayerName(i);
|
data.networkPlayerNames[i]= gameSettings->getNetworkPlayerName(i);
|
||||||
data.networkPlayerStatuses[i] = gameSettings->getNetworkPlayerStatuses(i);
|
data.networkPlayerStatuses[i] = gameSettings->getNetworkPlayerStatuses(i);
|
||||||
@@ -280,16 +281,16 @@ NetworkMessageLaunch::NetworkMessageLaunch(const GameSettings *gameSettings,int8
|
|||||||
data.teams[i]= gameSettings->getTeam(i);
|
data.teams[i]= gameSettings->getTeam(i);
|
||||||
data.startLocationIndex[i]= gameSettings->getStartLocationIndex(i);
|
data.startLocationIndex[i]= gameSettings->getStartLocationIndex(i);
|
||||||
}
|
}
|
||||||
for(int i= data.factionCount; i < GameConstants::maxPlayers; ++i) {
|
// for(int i= data.factionCount; i < GameConstants::maxPlayers; ++i) {
|
||||||
data.factionTypeNames[i]= "";
|
// data.factionTypeNames[i]= "";
|
||||||
data.networkPlayerNames[i]= "";
|
// data.networkPlayerNames[i]= "";
|
||||||
data.networkPlayerStatuses[i] = 0;
|
// data.networkPlayerStatuses[i] = 0;
|
||||||
data.networkPlayerLanguages[i] = "";
|
// data.networkPlayerLanguages[i] = "";
|
||||||
data.factionControls[i]= 0;
|
// data.factionControls[i]= 0;
|
||||||
data.resourceMultiplierIndex[i]= 0;
|
// data.resourceMultiplierIndex[i]= 0;
|
||||||
data.teams[i]= -1;
|
// data.teams[i]= -1;
|
||||||
data.startLocationIndex[i]= 0;
|
// data.startLocationIndex[i]= 0;
|
||||||
}
|
// }
|
||||||
|
|
||||||
data.aiAcceptSwitchTeamPercentChance = gameSettings->getAiAcceptSwitchTeamPercentChance();
|
data.aiAcceptSwitchTeamPercentChance = gameSettings->getAiAcceptSwitchTeamPercentChance();
|
||||||
data.masterserver_admin = gameSettings->getMasterserver_admin();
|
data.masterserver_admin = gameSettings->getMasterserver_admin();
|
||||||
@@ -327,7 +328,8 @@ void NetworkMessageLaunch::buildGameSettings(GameSettings *gameSettings) const {
|
|||||||
}
|
}
|
||||||
gameSettings->setFactionCRCList(factionCRCList);
|
gameSettings->setFactionCRCList(factionCRCList);
|
||||||
|
|
||||||
for(int i= 0; i < data.factionCount; ++i) {
|
//for(int i= 0; i < data.factionCount; ++i) {
|
||||||
|
for(int i= 0; i < GameConstants::maxPlayers; ++i) {
|
||||||
gameSettings->setFactionTypeName(i, data.factionTypeNames[i].getString());
|
gameSettings->setFactionTypeName(i, data.factionTypeNames[i].getString());
|
||||||
gameSettings->setNetworkPlayerName(i,data.networkPlayerNames[i].getString());
|
gameSettings->setNetworkPlayerName(i,data.networkPlayerNames[i].getString());
|
||||||
gameSettings->setNetworkPlayerStatuses(i, data.networkPlayerStatuses[i]);
|
gameSettings->setNetworkPlayerStatuses(i, data.networkPlayerStatuses[i]);
|
||||||
|
Reference in New Issue
Block a user