From fb9a48fd023b79b906824217075be6608751220b Mon Sep 17 00:00:00 2001 From: mathusummut Date: Sun, 16 Dec 2018 01:33:03 +0100 Subject: [PATCH] Fixed AI replacement multiplier issue --- source/glest_game/game/commander.cpp | 6 ++--- source/glest_game/game/game_settings.h | 20 +++++++------- source/glest_game/game/stats.cpp | 6 ++--- source/glest_game/game/stats.h | 1 - source/glest_game/global/config.cpp | 2 +- source/glest_game/global/core_data.cpp | 4 +-- source/glest_game/main/main.cpp | 2 +- .../menu/menu_state_connected_game.cpp | 10 +++---- .../menu/menu_state_connected_game.h | 2 +- .../menu/menu_state_custom_game.cpp | 13 ++++------ .../glest_game/menu/menu_state_custom_game.h | 2 +- .../glest_game/network/client_interface.cpp | 23 ++++++++-------- source/glest_game/network/client_interface.h | 2 +- source/glest_game/network/connection_slot.h | 4 +-- source/glest_game/network/network_message.cpp | 26 +++++++++---------- source/glest_game/network/network_message.h | 8 +++--- .../platform/common/platform_common.cpp | 4 +-- 17 files changed, 63 insertions(+), 72 deletions(-) diff --git a/source/glest_game/game/commander.cpp b/source/glest_game/game/commander.cpp index 1270a0156..4bce16600 100644 --- a/source/glest_game/game/commander.cpp +++ b/source/glest_game/game/commander.cpp @@ -1348,10 +1348,8 @@ namespace Game { //printf("#2 nctPlayerStatusChange factionIndex = %d playerStatus = %d\n",factionIndex,playerStatus); settings->setFactionControl(factionIndex, ctCpuZeta); - settings->setResourceMultiplierIndex(factionIndex, - settings-> - getFallbackCpuMultiplier - ()); + settings->setResourceMultiplierIndex(factionIndex, settings->getFallbackCpuMultiplierIndex()); + world->getStats()->setResourceMultiplier(factionIndex, (settings->getFallbackCpuMultiplierIndex() + 1) * 0.5f); //Game *game = this->world->getGame(); //game->get Faction * diff --git a/source/glest_game/game/game_settings.h b/source/glest_game/game/game_settings.h index 34c06380e..cdcad3be0 100644 --- a/source/glest_game/game/game_settings.h +++ b/source/glest_game/game/game_settings.h @@ -123,7 +123,7 @@ namespace Game { networkPlayerNames[GameConstants::maxPlayers]; string networkPlayerPlatform[GameConstants::maxPlayers]; - int + NetworkPlayerStatusType networkPlayerStatuses[GameConstants::maxPlayers]; string networkPlayerLanguages[GameConstants::maxPlayers]; @@ -150,7 +150,7 @@ namespace Game { mapFilter; int - fallbackCpuMultiplier; + fallbackCpuMultiplierIndex; bool defaultUnits; bool @@ -249,7 +249,7 @@ namespace Game { aiAcceptSwitchTeamPercentChance = 30; masterserver_admin = -1; masterserver_admin_factionIndex = -1; - fallbackCpuMultiplier = 1; + fallbackCpuMultiplierIndex = 1; networkAllowNativeLanguageTechtree = true; } @@ -351,7 +351,7 @@ namespace Game { return result; } - const int + const NetworkPlayerStatusType getNetworkPlayerStatuses(int factionIndex) const { if (factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) { char @@ -724,7 +724,7 @@ namespace Game { } void - setNetworkPlayerStatuses(int factionIndex, int status) { + setNetworkPlayerStatuses(int factionIndex, NetworkPlayerStatusType status) { if (factionIndex < 0 || factionIndex >= GameConstants::maxPlayers) { char szBuf[8096] = ""; @@ -924,13 +924,13 @@ namespace Game { } int - getFallbackCpuMultiplier() const { + getFallbackCpuMultiplierIndex() const { return - fallbackCpuMultiplier; + fallbackCpuMultiplierIndex; } void - setFallbackCpuMultiplier(int value) { - fallbackCpuMultiplier = value; + setFallbackCpuMultiplierIndex(int value) { + fallbackCpuMultiplierIndex = value; } int @@ -1411,7 +1411,7 @@ namespace Game { const XmlNode * networkPlayerStatusesNode = gameSettingsNode->getChild("networkPlayerStatuses", idx); - networkPlayerStatuses[idx] = + networkPlayerStatuses[idx] = (NetworkPlayerStatusType) networkPlayerStatusesNode->getAttribute("status")-> getIntValue(); } diff --git a/source/glest_game/game/stats.cpp b/source/glest_game/game/stats.cpp index 043ccada5..bfeb10158 100644 --- a/source/glest_game/game/stats.cpp +++ b/source/glest_game/game/stats.cpp @@ -68,11 +68,9 @@ namespace Game { break; }; } - - if ((control != ctHuman && control != ctNetwork) || - (control == ctNetwork && playerLeftBeforeEnd == true)) { + + if ((control != ctHuman && control != ctNetwork) || (control == ctNetwork && playerLeftBeforeEnd == true)) controlString += " x " + floatToStr(resourceMultiplier, 1); - } result += playerName + " (" + controlString + ") "; if (control == ctNetwork && playerLeftBeforeEnd == true) { diff --git a/source/glest_game/game/stats.h b/source/glest_game/game/stats.h index f62edd0db..a8cd10990 100644 --- a/source/glest_game/game/stats.h +++ b/source/glest_game/game/stats.h @@ -94,7 +94,6 @@ namespace Game { factionCount; int thisFactionIndex; - float worldTimeElapsed; int diff --git a/source/glest_game/global/config.cpp b/source/glest_game/global/config.cpp index 6d6b196d2..3977e290a 100644 --- a/source/glest_game/global/config.cpp +++ b/source/glest_game/global/config.cpp @@ -50,7 +50,7 @@ namespace Game { const char *GameConstants::folder_path_tilesets = "tilesets"; const char *GameConstants::folder_path_tutorials = "tutorials"; - const char *GameConstants::NETWORK_SLOT_CLOSED_SLOTNAME = "Closed"; + const char *GameConstants::NETWORK_SLOT_CLOSED_SLOTNAME = "*Closed*"; const char *GameConstants::folder_path_screenshots = "screens/"; diff --git a/source/glest_game/global/core_data.cpp b/source/glest_game/global/core_data.cpp index dd079387f..10c12655d 100644 --- a/source/glest_game/global/core_data.cpp +++ b/source/glest_game/global/core_data.cpp @@ -1494,7 +1494,7 @@ namespace Game { ()) << std::endl; saveGameFile << "FallbackCpuMultiplier=" << Shared::PlatformByteOrder:: toCommonEndian(gameSettings-> - getFallbackCpuMultiplier()) << std::endl; + getFallbackCpuMultiplierIndex()) << std::endl; saveGameFile << "PathFinderType=" << Shared::PlatformByteOrder:: toCommonEndian(gameSettings->getPathFinderType()) << std::endl; saveGameFile << "EnableServerControlledAI=" << Shared:: @@ -1667,7 +1667,7 @@ namespace Game { getInt ("AiAcceptSwitchTeamPercentChance", "30")); - gameSettings->setFallbackCpuMultiplier(properties. + gameSettings->setFallbackCpuMultiplierIndex(properties. getInt("FallbackCpuMultiplier", "1")); gameSettings->setPathFinderType(static_cast diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 961390595..07a1e184f 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -7355,7 +7355,7 @@ namespace Game { gameSettings->setNetworkPlayerStatuses(i, npst_None); gameSettings->setFactionControl(i, ct); gameSettings->setStartLocationIndex(i, i); - gameSettings->setResourceMultiplierIndex(i, gameSettings->getFallbackCpuMultiplier()); + gameSettings->setResourceMultiplierIndex(i, gameSettings->getFallbackCpuMultiplierIndex()); gameSettings->setNetworkPlayerName(i, GameConstants:: NETWORK_SLOT_CLOSED_SLOTNAME); diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 38f903f19..b4a5d47c7 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -3101,7 +3101,7 @@ namespace Game { (listBoxAISwitchTeamAcceptPercent.getSelectedItem ())); gameSettings-> - setFallbackCpuMultiplier + setFallbackCpuMultiplierIndex (listBoxFallbackCpuMultiplier.getSelectedItemIndex()); valueFlags1 = gameSettings->getFlagTypes1(); @@ -3237,7 +3237,7 @@ namespace Game { gameSettings->setStartLocationIndex(slotIndex, i); //printf("!!! setStartLocationIndex #2 slotIndex = %d, i = %d\n",slotIndex, i); - gameSettings->setResourceMultiplierIndex(slotIndex, gameSettings->getFallbackCpuMultiplier()); + gameSettings->setResourceMultiplierIndex(slotIndex, gameSettings->getFallbackCpuMultiplierIndex()); if (SystemFlags:: getSystemSettingType(SystemFlags::debugSystem).enabled) @@ -6275,8 +6275,8 @@ namespace Game { } } - int32 MenuStateConnectedGame::getNetworkPlayerStatus() { - int32 result = npst_None; + NetworkPlayerStatusType MenuStateConnectedGame::getNetworkPlayerStatus() { + NetworkPlayerStatusType result = npst_None; switch (listBoxPlayerStatus.getSelectedItemIndex()) { case 2: result = npst_Ready; @@ -7538,7 +7538,7 @@ namespace Game { (gameSettings->getAiAcceptSwitchTeamPercentChance ())); listBoxFallbackCpuMultiplier. - setSelectedItemIndex(gameSettings->getFallbackCpuMultiplier()); + setSelectedItemIndex(gameSettings->getFallbackCpuMultiplierIndex()); if ((gameSettings->getFlagTypes1() & ft1_allow_shared_team_units) == ft1_allow_shared_team_units) { diff --git a/source/glest_game/menu/menu_state_connected_game.h b/source/glest_game/menu/menu_state_connected_game.h index 1bf1525ff..a67f5c557 100644 --- a/source/glest_game/menu/menu_state_connected_game.h +++ b/source/glest_game/menu/menu_state_connected_game.h @@ -309,7 +309,7 @@ namespace Game { pair < FTP_Client_ResultType, string > result, void *userdata); - int32 getNetworkPlayerStatus(); + NetworkPlayerStatusType getNetworkPlayerStatus(); void cleanupMapPreviewTexture(); void mouseClickAdmin(int x, int y, MouseButton mouseButton, diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index d7a315c07..e17a34a2d 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -4164,7 +4164,7 @@ namespace Game { (listBoxAISwitchTeamAcceptPercent.getSelectedItem ())); gameSettings-> - setFallbackCpuMultiplier + setFallbackCpuMultiplierIndex (listBoxFallbackCpuMultiplier.getSelectedItemIndex()); if (checkBoxAllowInGameJoinPlayer.getValue() == true) { @@ -4354,10 +4354,7 @@ namespace Game { serverInterface->getSlot(i, true)->isConnected()) { gameSettings->setNetworkPlayerStatuses(slotIndex, - serverInterface->getSlot - (i, - true)->getNetworkPlayerStatus - ()); + serverInterface->getSlot(i, true)->getNetworkPlayerStatus()); // I'm putting this inside a ppd for now. I don't see it needs to be // built in unless DEBUG is defined during building -andy5995 2018-01-26 @@ -4987,7 +4984,7 @@ namespace Game { (gameSettings.getAiAcceptSwitchTeamPercentChance ())); listBoxFallbackCpuMultiplier. - setSelectedItemIndex(gameSettings.getFallbackCpuMultiplier()); + setSelectedItemIndex(gameSettings.getFallbackCpuMultiplierIndex()); checkBoxAllowInGameJoinPlayer.setValue((gameSettings.getFlagTypes1() & ft1_allow_in_game_joining) == @@ -5631,8 +5628,8 @@ namespace Game { __LINE__); } - int32 MenuStateCustomGame::getNetworkPlayerStatus() { - int32 result = npst_None; + NetworkPlayerStatusType MenuStateCustomGame::getNetworkPlayerStatus() { + NetworkPlayerStatusType result = npst_None; switch (listBoxPlayerStatus.getSelectedItemIndex()) { case 2: result = npst_Ready; diff --git a/source/glest_game/menu/menu_state_custom_game.h b/source/glest_game/menu/menu_state_custom_game.h index f9f17f69e..78db96821 100644 --- a/source/glest_game/menu/menu_state_custom_game.h +++ b/source/glest_game/menu/menu_state_custom_game.h @@ -366,7 +366,7 @@ namespace Game { void cleanup(); - int32 getNetworkPlayerStatus(); + NetworkPlayerStatusType getNetworkPlayerStatus(); void setupUIFromGameSettings(const GameSettings & gameSettings); diff --git a/source/glest_game/network/client_interface.cpp b/source/glest_game/network/client_interface.cpp index 8e5716f52..102341617 100644 --- a/source/glest_game/network/client_interface.cpp +++ b/source/glest_game/network/client_interface.cpp @@ -437,7 +437,7 @@ namespace Game { snprintf(szBuf1, 8096, statusTextFormat.c_str(), playerNameStr.c_str()); DisplayErrorMessage(szBuf1); - setQuit(true); + //setQuit(true); return; } @@ -1095,12 +1095,11 @@ namespace Game { bool gotCmd = receiveMessage(&networkMessageCommandList); if (gotCmd == false) { SystemFlags::OutputDebug(SystemFlags::debugError, "In [%s::%s Line: %d] error retrieving nmtCommandList returned false!\n", __FILE__, __FUNCTION__, __LINE__); - if (isConnected() == false) { + printf("Network connection has been interrupted...\n"); + /*if (isConnected() == false) { setQuit(true); close(); - } - //throw game_runtime_error("error retrieving nmtCommandList returned false!"); - printf("Network connection has been interrupted...\n"); + }*/ return; } @@ -1188,17 +1187,17 @@ namespace Game { if (gotCmd == false) { //SystemFlags::OutputDebug(SystemFlags::debugError, "In [%s::%s Line: %d] error retrieving nmtQuit returned false!\n", __FILE__, __FUNCTION__, __LINE__); printf("Network connection has been interrupted...\n"); - setQuit(true); + /*setQuit(true); if (isConnected() == false) { close(); return; - } - - //throw game_runtime_error("error retrieving nmtQuit returned false!"); + }*/ + done = true; + } + if (!done) { + setQuit(true); done = true; } - setQuit(true); - done = true; } break; @@ -2058,7 +2057,7 @@ namespace Game { void ClientInterface::sendSwitchSetupRequest(string selectedFactionName, int8 currentSlotIndex, int8 toSlotIndex, int8 toTeam, string networkPlayerName, - int8 networkPlayerStatus, int8 flags, + NetworkPlayerStatusType networkPlayerStatus, int8 flags, string language) { if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "In [%s::%s Line: %d] networkPlayerName [%s] flags = %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, networkPlayerName.c_str(), flags); SwitchSetupRequest message = SwitchSetupRequest(selectedFactionName, diff --git a/source/glest_game/network/client_interface.h b/source/glest_game/network/client_interface.h index 8b3037ce4..6d68b81c4 100644 --- a/source/glest_game/network/client_interface.h +++ b/source/glest_game/network/client_interface.h @@ -188,7 +188,7 @@ namespace Game { void sendSwitchSetupRequest(string selectedFactionName, int8 currentSlotIndex, int8 toSlotIndex, int8 toTeam, string networkPlayerName, - int8 networkPlayerStatus, int8 flags, + NetworkPlayerStatusType networkPlayerStatus, int8 flags, string language); virtual bool getConnectHasHandshaked() const { return gotIntro; diff --git a/source/glest_game/network/connection_slot.h b/source/glest_game/network/connection_slot.h index 604cb5215..bffecf425 100644 --- a/source/glest_game/network/connection_slot.h +++ b/source/glest_game/network/connection_slot.h @@ -163,7 +163,7 @@ namespace Game { string versionString; int sessionKey; uint32 connectedRemoteIPAddress; - int playerStatus; + NetworkPlayerStatusType playerStatus; string playerLanguage; string playerUUID; string platform; @@ -326,7 +326,7 @@ namespace Game { return playerIndex; } - int getNetworkPlayerStatus() const { + NetworkPlayerStatusType getNetworkPlayerStatus() const { return playerStatus; } diff --git a/source/glest_game/network/network_message.cpp b/source/glest_game/network/network_message.cpp index 7a1aba7ff..d82e6af1e 100644 --- a/source/glest_game/network/network_message.cpp +++ b/source/glest_game/network/network_message.cpp @@ -714,7 +714,7 @@ namespace Game { data.factionCRCList[i] = 0; } data.aiAcceptSwitchTeamPercentChance = 0; - data.cpuReplacementMultiplier = 10; + data.cpuReplacementMultiplierIndex = 1; data.masterserver_admin = -1; data.masterserver_admin_factionIndex = -1; } @@ -772,7 +772,7 @@ namespace Game { data.networkPlayerUUID[i] = gameSettings->getNetworkPlayerUUID(i); //printf("Build netmsg for index: %d [%s]\n",i,data.networkPlayerUUID[i].getString().c_str()); } - data.cpuReplacementMultiplier = gameSettings->getFallbackCpuMultiplier(); + data.cpuReplacementMultiplierIndex = gameSettings->getFallbackCpuMultiplierIndex(); data.aiAcceptSwitchTeamPercentChance = gameSettings->getAiAcceptSwitchTeamPercentChance(); data.masterserver_admin = gameSettings->getMasterserver_admin(); data.masterserver_admin_factionIndex = gameSettings->getMasterserver_admin_faction_index(); @@ -821,7 +821,7 @@ namespace Game { gameSettings->setFactionTypeName(i, data.factionTypeNames[i].getString()); gameSettings->setNetworkPlayerName(i, data.networkPlayerNames[i].getString()); gameSettings->setNetworkPlayerPlatform(i, data.networkPlayerPlatform[i].getString()); - gameSettings->setNetworkPlayerStatuses(i, data.networkPlayerStatuses[i]); + gameSettings->setNetworkPlayerStatuses(i, (NetworkPlayerStatusType) data.networkPlayerStatuses[i]); gameSettings->setNetworkPlayerLanguages(i, data.networkPlayerLanguages[i].getString()); gameSettings->setFactionControl(i, static_cast(data.factionControls[i])); gameSettings->setResourceMultiplierIndex(i, data.resourceMultiplierIndex[i]); @@ -834,7 +834,7 @@ namespace Game { } gameSettings->setAiAcceptSwitchTeamPercentChance(data.aiAcceptSwitchTeamPercentChance); - gameSettings->setFallbackCpuMultiplier(data.cpuReplacementMultiplier); + gameSettings->setFallbackCpuMultiplierIndex(data.cpuReplacementMultiplierIndex); gameSettings->setMasterserver_admin(data.masterserver_admin); gameSettings->setMasterserver_admin_faction_index(data.masterserver_admin_factionIndex); @@ -867,7 +867,7 @@ namespace Game { Data packedData; packedData.aiAcceptSwitchTeamPercentChance = 0; packedData.allowObservers = 0; - packedData.cpuReplacementMultiplier = 0; + packedData.cpuReplacementMultiplierIndex = 0; packedData.defaultResources = 0; packedData.defaultUnits = 0; packedData.defaultVictoryConditions = 0; @@ -878,7 +878,7 @@ namespace Game { } for (unsigned int index = 0; index < (unsigned int) GameConstants::maxPlayers; ++index) { packedData.factionControls[index] = 0; - packedData.networkPlayerStatuses[index] = 0; + packedData.networkPlayerStatuses[index] = npst_None; packedData.resourceMultiplierIndex[index] = 0; packedData.startLocationIndex[index] = 0; packedData.teams[index] = 0; @@ -1036,7 +1036,7 @@ namespace Game { packedData.pathFinderType, packedData.flagTypes1, packedData.aiAcceptSwitchTeamPercentChance, - packedData.cpuReplacementMultiplier, + packedData.cpuReplacementMultiplierIndex, packedData.masterserver_admin, packedData.masterserver_admin_factionIndex, packedData.scenario.getBuffer(), @@ -1192,7 +1192,7 @@ namespace Game { &data.pathFinderType, &data.flagTypes1, &data.aiAcceptSwitchTeamPercentChance, - &data.cpuReplacementMultiplier, + &data.cpuReplacementMultiplierIndex, &data.masterserver_admin, &data.masterserver_admin_factionIndex, data.scenario.getBuffer(), @@ -1347,7 +1347,7 @@ namespace Game { data.pathFinderType, data.flagTypes1, data.aiAcceptSwitchTeamPercentChance, - data.cpuReplacementMultiplier, + data.cpuReplacementMultiplierIndex, data.masterserver_admin, data.masterserver_admin_factionIndex, data.scenario.getBuffer(), @@ -1581,7 +1581,7 @@ namespace Game { data.flagTypes1 = Shared::PlatformByteOrder::toCommonEndian(data.flagTypes1); data.aiAcceptSwitchTeamPercentChance = Shared::PlatformByteOrder::toCommonEndian(data.aiAcceptSwitchTeamPercentChance); - data.cpuReplacementMultiplier = Shared::PlatformByteOrder::toCommonEndian(data.cpuReplacementMultiplier); + data.cpuReplacementMultiplierIndex = Shared::PlatformByteOrder::toCommonEndian(data.cpuReplacementMultiplierIndex); data.masterserver_admin = Shared::PlatformByteOrder::toCommonEndian(data.masterserver_admin); data.masterserver_admin_factionIndex = Shared::PlatformByteOrder::toCommonEndian(data.masterserver_admin_factionIndex); @@ -1621,7 +1621,7 @@ namespace Game { data.flagTypes1 = Shared::PlatformByteOrder::fromCommonEndian(data.flagTypes1); data.aiAcceptSwitchTeamPercentChance = Shared::PlatformByteOrder::fromCommonEndian(data.aiAcceptSwitchTeamPercentChance); - data.cpuReplacementMultiplier = Shared::PlatformByteOrder::fromCommonEndian(data.cpuReplacementMultiplier); + data.cpuReplacementMultiplierIndex = Shared::PlatformByteOrder::fromCommonEndian(data.cpuReplacementMultiplierIndex); data.masterserver_admin = Shared::PlatformByteOrder::fromCommonEndian(data.masterserver_admin); data.masterserver_admin_factionIndex = Shared::PlatformByteOrder::fromCommonEndian(data.masterserver_admin_factionIndex); @@ -2956,7 +2956,7 @@ namespace Game { SwitchSetupRequest::SwitchSetupRequest(string selectedFactionName, int8 currentFactionIndex, int8 toFactionIndex, int8 toTeam, string networkPlayerName, - int8 networkPlayerStatus, int8 flags, + NetworkPlayerStatusType networkPlayerStatus, int8 flags, string language) { messageType = nmtSwitchSetupRequest; data.selectedFactionName = selectedFactionName; @@ -2979,7 +2979,7 @@ namespace Game { Data packedData; packedData.currentSlotIndex = 0; messageType = nmtSwitchSetupRequest; - packedData.networkPlayerStatus = 0; + packedData.networkPlayerStatus = npst_None; packedData.switchFlags = 0; packedData.toSlotIndex = 0; packedData.toTeam = 0; diff --git a/source/glest_game/network/network_message.h b/source/glest_game/network/network_message.h index 684c08b13..49a2b0088 100644 --- a/source/glest_game/network/network_message.h +++ b/source/glest_game/network/network_message.h @@ -407,7 +407,7 @@ namespace Game { uint32 flagTypes1; int8 aiAcceptSwitchTeamPercentChance; - int8 cpuReplacementMultiplier; + int8 cpuReplacementMultiplierIndex; int32 masterserver_admin; int32 masterserver_admin_factionIndex; @@ -1073,7 +1073,7 @@ namespace Game { SwitchSetupRequest(); SwitchSetupRequest(string selectedFactionName, int8 currentFactionIndex, int8 toFactionIndex, int8 toTeam, string networkPlayerName, - int8 networkPlayerStatus, int8 flags, + NetworkPlayerStatusType networkPlayerStatus, int8 flags, string language); virtual size_t getDataSize() const { @@ -1109,8 +1109,8 @@ namespace Game { data.switchFlags &= ~flag; } - int getNetworkPlayerStatus() const { - return data.networkPlayerStatus; + NetworkPlayerStatusType getNetworkPlayerStatus() const { + return (NetworkPlayerStatusType) data.networkPlayerStatus; } string getNetworkPlayerLanguage() const { return data.language.getString(); diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index 04f2c13ff..2499d3ae3 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -2248,9 +2248,9 @@ namespace Shared { printf("%s\n", szMsg); SystemFlags::OutputDebug(SystemFlags::debugSystem, "%s\n", szMsg); SystemFlags::OutputDebug(SystemFlags::debugError, "%s\n", szMsg); - void(*handler)(const char*) = unexpected_handler; + /*void(*handler)(const char*) = unexpected_handler; if (handler != NULL) - handler(szMsg); + handler(szMsg);*/ } void ValueCheckerVault::addItemToVault(const void *ptr, int value) {