From df13e9c37aa87f57ebd2b59f2acf98149b4d544a Mon Sep 17 00:00:00 2001 From: Koncord Date: Sat, 17 Sep 2016 13:59:00 +0800 Subject: [PATCH 1/9] Fix verbose log level in server --- apps/openmw-mp/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw-mp/main.cpp b/apps/openmw-mp/main.cpp index 83a6f2a6b..565744327 100644 --- a/apps/openmw-mp/main.cpp +++ b/apps/openmw-mp/main.cpp @@ -105,8 +105,8 @@ int main(int argc, char *argv[]) loadSettings(mgr); int logLevel = mgr.getInt("loglevel", "General"); - if (logLevel < Log::LOG_INFO || logLevel > Log::LOG_FATAL) - logLevel = Log::LOG_INFO; + if (logLevel < Log::LOG_VERBOSE || logLevel > Log::LOG_FATAL) + logLevel = Log::LOG_VERBOSE; // Some objects used to redirect cout and cerr // Scope must be here, so this still works inside the catch block for logging exceptions From fe370fa9955522f54283ac326181d92b337f6556 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sun, 18 Sep 2016 11:46:49 +0800 Subject: [PATCH 2/9] Add PacketLoaded --- components/openmw-mp/Packets/PacketLoaded.hpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 components/openmw-mp/Packets/PacketLoaded.hpp diff --git a/components/openmw-mp/Packets/PacketLoaded.hpp b/components/openmw-mp/Packets/PacketLoaded.hpp new file mode 100644 index 000000000..6e8d317c6 --- /dev/null +++ b/components/openmw-mp/Packets/PacketLoaded.hpp @@ -0,0 +1,22 @@ +// +// Created by koncord on 17.09.16. +// + +#ifndef OPENMW_PACKETLOADED_HPP +#define OPENMW_PACKETLOADED_HPP + +#include + +namespace mwmp +{ + class PacketLoaded : public BasePacket + { + public: + PacketLoaded(RakNet::RakPeerInterface *peer) : BasePacket(peer) + { + packetID = ID_LOADED; + } + }; +} + +#endif //OPENMW_PACKETLOADED_HPP From fe1082152893af59d3f19071fc48aee33f4321a2 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sun, 18 Sep 2016 11:48:08 +0800 Subject: [PATCH 3/9] Add loaded/isLoaded to server player --- apps/openmw-mp/Player.cpp | 10 ++++++++++ apps/openmw-mp/Player.hpp | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/openmw-mp/Player.cpp b/apps/openmw-mp/Player.cpp index 87125435c..d79e61b06 100644 --- a/apps/openmw-mp/Player.cpp +++ b/apps/openmw-mp/Player.cpp @@ -64,6 +64,7 @@ std::map *Players::GetPlayers() Player::Player(RakNet::RakNetGUID id) : BasePlayer(id) { handshake = false; + loaded = false; } Player::~Player() @@ -91,6 +92,15 @@ bool Player::isHandshaked() return handshake; } +void Player::Loaded() +{ + loaded = true; +} + +bool Player::isLoaded() +{ + return loaded; +} Player *Players::GetPlayer(unsigned short id) { diff --git a/apps/openmw-mp/Player.hpp b/apps/openmw-mp/Player.hpp index b3baa300f..6942268e1 100644 --- a/apps/openmw-mp/Player.hpp +++ b/apps/openmw-mp/Player.hpp @@ -46,12 +46,15 @@ public: void SetID(unsigned short id); bool isHandshaked(); - void Handshake(); + void Loaded(); + bool isLoaded(); + virtual ~Player(); private: bool handshake; + bool loaded; }; #endif //OPENMW_PLAYER_HPP From 1e485556172206879a072b7314044552e4b105e6 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sun, 18 Sep 2016 11:49:30 +0800 Subject: [PATCH 4/9] Make sensitivity to protocol version --- apps/openmw-mp/main.cpp | 5 ++++- apps/openmw/mwmp/Networking.cpp | 9 ++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/openmw-mp/main.cpp b/apps/openmw-mp/main.cpp index 565744327..e8daa0e5d 100644 --- a/apps/openmw-mp/main.cpp +++ b/apps/openmw-mp/main.cpp @@ -154,7 +154,10 @@ int main(int argc, char *argv[]) RakNet::RakPeerInterface *peer = RakNet::RakPeerInterface::GetInstance(); - peer->SetIncomingPassword(TES3MP_VERSION, (int)strlen(TES3MP_VERSION)); + stringstream sstr(TES3MP_VERSION); + sstr << TES3MP_PROTO_VERSION; + + peer->SetIncomingPassword(sstr.str().c_str(), (int)sstr.str().size()); if (RakNet::NonNumericHostString(addr.c_str())) { diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 908ce5d51..5ce6b93bd 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -103,7 +103,10 @@ void Networking::Connect(const std::string &ip, unsigned short port) master.SetPortHostOrder(port); std::string errmsg = ""; - if (peer->Connect(master.ToString(false), master.GetPort(), TES3MP_VERSION, (int) strlen(TES3MP_VERSION), 0, 0, 3, 500, 0) != RakNet::CONNECTION_ATTEMPT_STARTED) + stringstream sstr(TES3MP_VERSION); + sstr << TES3MP_PROTO_VERSION; + + if (peer->Connect(master.ToString(false), master.GetPort(), sstr.str().c_str(), (int) sstr.str().size(), 0, 0, 3, 500, 0) != RakNet::CONNECTION_ATTEMPT_STARTED) errmsg = "Connection attempt failed.\n"; bool queue = true; @@ -139,10 +142,6 @@ void Networking::Connect(const std::string &ip, unsigned short port) LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_CONNECTION_REQUESTED_ACCEPTED from %s", serverAddr.ToString()); - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Sending ID_GAME_BASE_INFO to server"); - - GetPacket(ID_GAME_BASE_INFO)->Send(getLocalPlayer()); - break; } case ID_DISCONNECTION_NOTIFICATION: From 9bcca6d14124f6d4a150a4ed89e54ecb7ae3406c Mon Sep 17 00:00:00 2001 From: Koncord Date: Sun, 18 Sep 2016 11:50:01 +0800 Subject: [PATCH 5/9] Init PacketLoaded in PacketsController --- components/openmw-mp/NetworkMessages.hpp | 1 + components/openmw-mp/PacketsController.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/openmw-mp/NetworkMessages.hpp b/components/openmw-mp/NetworkMessages.hpp index 60f993b35..08832a176 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -31,6 +31,7 @@ enum GameMessages ID_GAME_CHARCLASS, ID_GAME_SKILLPRIORITY, ID_HANDSHAKE, + ID_LOADED, ID_GUI_MESSAGEBOX, ID_GAME_TIME }; diff --git a/components/openmw-mp/PacketsController.cpp b/components/openmw-mp/PacketsController.cpp index f0ff4a20b..84f3e0315 100644 --- a/components/openmw-mp/PacketsController.cpp +++ b/components/openmw-mp/PacketsController.cpp @@ -25,6 +25,7 @@ #include "Packets/PacketHandshake.hpp" #include "Packets/PacketGUIBoxes.hpp" #include "Packets/PacketTime.hpp" +#include "Packets/PacketLoaded.hpp" #include "PacketsController.hpp" @@ -61,7 +62,7 @@ mwmp::PacketsController::PacketsController(RakNet::RakPeerInterface *peer) AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); - + AddPacket(&packets, peer); } From e661a35ac2c568db5a9b635169fb2d3d22af4e5d Mon Sep 17 00:00:00 2001 From: Koncord Date: Sun, 18 Sep 2016 11:51:32 +0800 Subject: [PATCH 6/9] Fix checking strings in SetName & SetBirthsign --- apps/openmw-mp/Script/Functions/Stats.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw-mp/Script/Functions/Stats.cpp b/apps/openmw-mp/Script/Functions/Stats.cpp index 5c74918e6..bced4b91f 100644 --- a/apps/openmw-mp/Script/Functions/Stats.cpp +++ b/apps/openmw-mp/Script/Functions/Stats.cpp @@ -20,10 +20,10 @@ void StatsFunctions::SetName(unsigned short pid, const char *name) noexcept Player *player; GET_PLAYER(pid, player,); - if (player->GetCell()->mName == name) + if (player->Npc()->mName == name) return; - player->GetCell()->mName = name; + player->Npc()->mName = name; } const char *StatsFunctions::GetName(unsigned short pid) noexcept @@ -40,7 +40,7 @@ void StatsFunctions::SetBirthsign(unsigned short pid, const char *sign) noexcept Player *player; GET_PLAYER(pid, player,); - if (player->GetCell()->mName == sign) + if (*player->BirthSign() == sign) return; *player->BirthSign() = sign; From 61c545637363eba2f3f4524cb351e8d4fd2e6275 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sun, 18 Sep 2016 11:54:06 +0800 Subject: [PATCH 7/9] Log callbacks --- apps/openmw-mp/Script/Script.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/openmw-mp/Script/Script.hpp b/apps/openmw-mp/Script/Script.hpp index 896045ca4..3931542dc 100644 --- a/apps/openmw-mp/Script/Script.hpp +++ b/apps/openmw-mp/Script/Script.hpp @@ -96,6 +96,9 @@ public: if (!callback) continue; + + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Called function \"%s\"", data.name); + if (script->script_type == SCRIPT_CPP) result = reinterpret_cast>>(callback)(std::forward(args)...); #if defined (ENABLE_PAWN) @@ -135,6 +138,8 @@ public: if (!callback) continue; + LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Called function \"%s\"", data.name); + if (script->script_type == SCRIPT_CPP) reinterpret_cast>>(callback)(std::forward(args)...); #if defined (ENABLE_PAWN) From 96e2d749c714e0637bd83d20fbd59ed0ad920e85 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sun, 18 Sep 2016 11:54:45 +0800 Subject: [PATCH 8/9] New auth protocol --- apps/openmw-mp/Networking.cpp | 48 +++++++++++++++--------- apps/openmw/engine.cpp | 4 +- apps/openmw/mwmp/Main.cpp | 63 +++++++++++++++++++++----------- apps/openmw/mwmp/Main.hpp | 3 +- components/openmw-mp/Version.hpp | 2 +- 5 files changed, 77 insertions(+), 43 deletions(-) diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index d28c8ce79..81938cbff 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -52,10 +52,9 @@ void Networking::Update(RakNet::Packet *packet) if (player == 0) { controller->GetPacket(ID_HANDSHAKE)->RequestData(packet->guid); - - NewPlayer(packet->guid); + Players::NewPlayer(packet->guid); player = Players::GetPlayer(packet->guid); - + controller->GetPacket(ID_USER_MYID)->Send(Players::GetPlayer(packet->guid), false); return; } @@ -97,6 +96,20 @@ void Networking::Update(RakNet::Packet *packet) return; } player->Handshake(); + return; + } + + if (!player->isHandshaked()) + { + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Have not completed handshake with player %d", + player->GetID()); + //KickPlayer(player->guid); + return; + } + + if (packet->data[0] == ID_LOADED) + { + player->Loaded(); static constexpr unsigned int ident = Script::CallbackIdentity("OnPlayerConnect"); Script::CallBackReturn result = true; @@ -108,22 +121,27 @@ void Networking::Update(RakNet::Packet *packet) Players::DeletePlayer(packet->guid); return; } + } + else if(packet->data[0] == ID_GAME_BASE_INFO) + { + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_GAME_BASE_INFO about %s", + player->Npc()->mName.c_str()); - return; - + myPacket->Read(player); + myPacket->Send(player, true); } - if (!player->isHandshaked()) - { - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Have not completed handshake with player %d", - player->GetID()); - //KickPlayer(player->guid); + if(!player->isLoaded()) return; + else if(player->BirthSign()->empty()) + { + (*player->BirthSign()) = "a"; + NewPlayer(packet->guid); } switch (packet->data[0]) { - case ID_GAME_BASE_INFO: + /*case ID_GAME_BASE_INFO: { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_GAME_BASE_INFO about %s", player->Npc()->mName.c_str()); @@ -132,7 +150,7 @@ void Networking::Update(RakNet::Packet *packet) myPacket->Send(player, true); break; - } + }*/ case ID_GAME_UPDATE_POS: { //DEBUG_PRINTF("ID_GAME_UPDATE_POS \n"); @@ -331,10 +349,6 @@ void Networking::Update(RakNet::Packet *packet) void Networking::NewPlayer(RakNet::RakNetGUID guid) { - Players::NewPlayer(guid); - - controller->GetPacket(ID_USER_MYID)->Send(Players::GetPlayer(guid), false); - controller->GetPacket(ID_GAME_BASE_INFO)->RequestData(guid); controller->GetPacket(ID_GAME_UPDATE_BASESTATS)->RequestData(guid); controller->GetPacket(ID_GAME_ATTRIBUTE)->RequestData(guid); @@ -343,7 +357,7 @@ void Networking::NewPlayer(RakNet::RakNetGUID guid) controller->GetPacket(ID_GAME_CELL)->RequestData(guid); controller->GetPacket(ID_GAME_UPDATE_EQUIPED)->RequestData(guid); - for (TPlayers::iterator pl = players->begin(); pl != players->end(); pl++) + for (TPlayers::iterator pl = players->begin(); pl != players->end(); pl++) //sending other players to new player { if (pl->first == guid) continue; diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index a49d801e1..b96fe2070 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -644,9 +644,9 @@ void OMW::Engine::go() ToUTF8::Utf8Encoder encoder (mEncoding); mEncoder = &encoder; - + mwmp::Main::Init(mContentFiles); prepareEngine (settings); - mwmp::Main::Create(); + mwmp::Main::PostInit(); mSkipMenu = true; if (!mSaveGameFile.empty()) diff --git a/apps/openmw/mwmp/Main.cpp b/apps/openmw/mwmp/Main.cpp index ec39f4d36..68a7fbdb2 100644 --- a/apps/openmw/mwmp/Main.cpp +++ b/apps/openmw/mwmp/Main.cpp @@ -91,19 +91,35 @@ void Main::Configure(const boost::program_options::variables_map &variables) Main::addr = variables["connect"].as(); } -void Main::Create() +Settings::CategorySettingValueMap saveUserSettings; +Settings::CategorySettingValueMap saveDefaultSettings; +Settings::CategorySettingVector saveChangedSettings; + +Settings::Manager InitMgr(Settings::Manager &mgr) +{ + saveUserSettings = mgr.mUserSettings; + saveDefaultSettings = mgr.mDefaultSettings; + saveChangedSettings = mgr.mChangedSettings; + mgr.mUserSettings.clear(); + mgr.mDefaultSettings.clear(); + mgr.mChangedSettings.clear(); + loadSettings(mgr); +} + +void RestoreMgr(Settings::Manager &mgr) +{ + mgr.mUserSettings = saveUserSettings; + mgr.mDefaultSettings = saveDefaultSettings; + mgr.mChangedSettings = saveChangedSettings; +} + +void Main::Init(std::vector &content) { assert(!pMain); pMain = new Main(); Settings::Manager mgr; - Settings::CategorySettingValueMap saveUserSettings = mgr.mUserSettings; - Settings::CategorySettingValueMap saveDefaultSettings = mgr.mDefaultSettings; - Settings::CategorySettingVector saveChangedSettings = mgr.mChangedSettings; - mgr.mUserSettings.clear(); - mgr.mDefaultSettings.clear(); - mgr.mChangedSettings.clear(); - loadSettings(mgr); + InitMgr(mgr); int logLevel = mgr.getInt("loglevel", "General"); Log::SetLevel(logLevel); @@ -120,15 +136,21 @@ void Main::Create() } + pMain->mNetworking->Connect(pMain->server, pMain->port); + RestoreMgr(mgr); +} + +void Main::PostInit() +{ + Settings::Manager mgr; + InitMgr(mgr); + pMain->mGUIController->setupChat(mgr); + RestoreMgr(mgr); - mgr.mUserSettings = saveUserSettings; - mgr.mDefaultSettings = saveDefaultSettings; - mgr.mChangedSettings = saveChangedSettings; - - //pMain->mGUILogin = new GUILogin(); const MWBase::Environment &environment = MWBase::Environment::get(); environment.getStateManager()->newGame(true); + MWBase::Environment::get().getMechanicsManager()->toggleAI(); } void Main::Destroy() @@ -164,17 +186,14 @@ void Main::UpdateWorld(float dt) const if (!mLocalPlayer->CharGenThread()) return; - if (!mNetworking->isConnected()) + static bool init = true; + if (init) { - MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); - MWBase::Environment::get().getMechanicsManager()->toggleAI(); + init = false; + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Sending ID_GAME_BASE_INFO to server"); - (*mLocalPlayer->Npc()) = *player.get()->mBase; - - mLocalPlayer->updateAttributesAndSkills(); - - mNetworking->Connect(server, port); - player.getClass().getCreatureStats(player).getSpells().add("fireball"); + mNetworking->GetPacket(ID_GAME_BASE_INFO)->Send(getLocalPlayer()); + mNetworking->GetPacket(ID_LOADED)->Send(getLocalPlayer()); mLocalPlayer->updateBaseStats(true); get().getGUIController()->setChatVisible(true); } diff --git a/apps/openmw/mwmp/Main.hpp b/apps/openmw/mwmp/Main.hpp index 7292f92dd..10c919344 100644 --- a/apps/openmw/mwmp/Main.hpp +++ b/apps/openmw/mwmp/Main.hpp @@ -14,7 +14,8 @@ namespace mwmp static void OptionsDesc(boost::program_options::options_description *desc); static void Configure(const boost::program_options::variables_map &variables); - static void Create(); + static void Init(std::vector &content); + static void PostInit(); static void Destroy(); static const Main &get(); static void Frame(float dt); diff --git a/components/openmw-mp/Version.hpp b/components/openmw-mp/Version.hpp index 9f5734a92..ad23f5e2a 100644 --- a/components/openmw-mp/Version.hpp +++ b/components/openmw-mp/Version.hpp @@ -6,6 +6,6 @@ #define OPENMW_VERSION_HPP #define TES3MP_VERSION "0.0.1c" -#define TES3MP_PROTO_VERSION 1 +#define TES3MP_PROTO_VERSION 2 #endif //OPENMW_VERSION_HPP From 24617589e4f9e815502917bbec80d3b76d96aee4 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sun, 18 Sep 2016 15:52:13 +0800 Subject: [PATCH 9/9] Fix packet spam --- apps/openmw-mp/Networking.cpp | 27 ++++++++++++++------------- apps/openmw-mp/Player.cpp | 6 +++--- apps/openmw-mp/Player.hpp | 12 +++++++++--- apps/openmw/mwmp/Main.cpp | 8 ++++---- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 81938cbff..658a0b1f1 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -49,15 +49,6 @@ void Networking::Update(RakNet::Packet *packet) Player *player = Players::GetPlayer(packet->guid); - if (player == 0) - { - controller->GetPacket(ID_HANDSHAKE)->RequestData(packet->guid); - Players::NewPlayer(packet->guid); - player = Players::GetPlayer(packet->guid); - controller->GetPacket(ID_USER_MYID)->Send(Players::GetPlayer(packet->guid), false); - return; - } - RakNet::BitStream bsIn(&packet->data[1], packet->length, false); { @@ -68,6 +59,15 @@ void Networking::Update(RakNet::Packet *packet) controller->SetStream(&bsIn, 0); + if (player == 0) + { + controller->GetPacket(ID_HANDSHAKE)->RequestData(packet->guid); + Players::NewPlayer(packet->guid); + player = Players::GetPlayer(packet->guid); + controller->GetPacket(ID_USER_MYID)->Send(Players::GetPlayer(packet->guid), false); + return; + } + BasePacket *myPacket = controller->GetPacket(packet->data[0]); if (packet->data[0] == ID_HANDSHAKE) @@ -109,7 +109,7 @@ void Networking::Update(RakNet::Packet *packet) if (packet->data[0] == ID_LOADED) { - player->Loaded(); + player->Loaded(Player::LOADED); static constexpr unsigned int ident = Script::CallbackIdentity("OnPlayerConnect"); Script::CallBackReturn result = true; @@ -131,12 +131,13 @@ void Networking::Update(RakNet::Packet *packet) myPacket->Send(player, true); } - if(!player->isLoaded()) + if (player->LoadedState() == Player::NOTLOADED) return; - else if(player->BirthSign()->empty()) + else if (player->LoadedState() == Player::LOADED) { - (*player->BirthSign()) = "a"; + player->Loaded(Player::POSTLOADED); NewPlayer(packet->guid); + return; } switch (packet->data[0]) diff --git a/apps/openmw-mp/Player.cpp b/apps/openmw-mp/Player.cpp index d79e61b06..374de78da 100644 --- a/apps/openmw-mp/Player.cpp +++ b/apps/openmw-mp/Player.cpp @@ -92,12 +92,12 @@ bool Player::isHandshaked() return handshake; } -void Player::Loaded() +void Player::Loaded(int state) { - loaded = true; + loaded = state; } -bool Player::isLoaded() +int Player::LoadedState() { return loaded; } diff --git a/apps/openmw-mp/Player.hpp b/apps/openmw-mp/Player.hpp index 6942268e1..7fbc5275b 100644 --- a/apps/openmw-mp/Player.hpp +++ b/apps/openmw-mp/Player.hpp @@ -40,6 +40,12 @@ class Player : public mwmp::BasePlayer unsigned short id; public: + enum + { + NOTLOADED=0, + LOADED, + POSTLOADED + }; Player(RakNet::RakNetGUID id); unsigned short GetID(); @@ -48,13 +54,13 @@ public: bool isHandshaked(); void Handshake(); - void Loaded(); - bool isLoaded(); + void Loaded(int state); + int LoadedState(); virtual ~Player(); private: bool handshake; - bool loaded; + int loaded; }; #endif //OPENMW_PLAYER_HPP diff --git a/apps/openmw/mwmp/Main.cpp b/apps/openmw/mwmp/Main.cpp index 68a7fbdb2..ebbbb475f 100644 --- a/apps/openmw/mwmp/Main.cpp +++ b/apps/openmw/mwmp/Main.cpp @@ -91,11 +91,11 @@ void Main::Configure(const boost::program_options::variables_map &variables) Main::addr = variables["connect"].as(); } -Settings::CategorySettingValueMap saveUserSettings; -Settings::CategorySettingValueMap saveDefaultSettings; -Settings::CategorySettingVector saveChangedSettings; +static Settings::CategorySettingValueMap saveUserSettings; +static Settings::CategorySettingValueMap saveDefaultSettings; +static Settings::CategorySettingVector saveChangedSettings; -Settings::Manager InitMgr(Settings::Manager &mgr) +void InitMgr(Settings::Manager &mgr) { saveUserSettings = mgr.mUserSettings; saveDefaultSettings = mgr.mDefaultSettings;