From bbac26294fed9a57ff289649c1ce9440940f64a8 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 17 Oct 2017 07:42:44 +0300 Subject: [PATCH] [Server] Fix typos and make all files end with newlines --- apps/openmw-mp/Books.cpp | 2 +- apps/openmw-mp/CellState.cpp | 2 +- apps/openmw-mp/Factions.cpp | 2 +- apps/openmw-mp/NetActor.cpp | 2 +- apps/openmw-mp/Player.cpp | 2 +- apps/openmw-mp/Players.cpp | 6 +++--- apps/openmw-mp/Script/CommandController.cpp | 2 +- apps/openmw-mp/Script/EventController.cpp | 2 +- apps/openmw-mp/Script/LuaState.cpp | 5 +++-- apps/openmw-mp/Script/luaUtils.cpp | 2 +- 10 files changed, 14 insertions(+), 13 deletions(-) diff --git a/apps/openmw-mp/Books.cpp b/apps/openmw-mp/Books.cpp index 04ec2391a..55c42842d 100644 --- a/apps/openmw-mp/Books.cpp +++ b/apps/openmw-mp/Books.cpp @@ -65,4 +65,4 @@ void Books::update() packet->setPlayer(player); packet->Send(/*toOthers*/ false); -} \ No newline at end of file +} diff --git a/apps/openmw-mp/CellState.cpp b/apps/openmw-mp/CellState.cpp index a240b5955..4d37eef7b 100644 --- a/apps/openmw-mp/CellState.cpp +++ b/apps/openmw-mp/CellState.cpp @@ -27,4 +27,4 @@ int CellState::getStateType() const std::string CellState::getDescription() const { return state.cell.getDescription(); -} \ No newline at end of file +} diff --git a/apps/openmw-mp/Factions.cpp b/apps/openmw-mp/Factions.cpp index a42754310..9c615a036 100644 --- a/apps/openmw-mp/Factions.cpp +++ b/apps/openmw-mp/Factions.cpp @@ -151,4 +151,4 @@ int Faction::getFactionReputation() const void Faction::setFactionReputation(int reputation) { faction.reputation = reputation; -} \ No newline at end of file +} diff --git a/apps/openmw-mp/NetActor.cpp b/apps/openmw-mp/NetActor.cpp index 13786ec32..e2da6c23e 100644 --- a/apps/openmw-mp/NetActor.cpp +++ b/apps/openmw-mp/NetActor.cpp @@ -95,4 +95,4 @@ Inventory &NetActor::getInventory() Cells &NetActor::getCell() { return cellAPI; -} \ No newline at end of file +} diff --git a/apps/openmw-mp/Player.cpp b/apps/openmw-mp/Player.cpp index 1bb11409b..ac422f0a7 100644 --- a/apps/openmw-mp/Player.cpp +++ b/apps/openmw-mp/Player.cpp @@ -612,4 +612,4 @@ void Player::setAuthority() // Also send this to everyone else who has the cell loaded serverCell->sendToLoaded(authorityPacket, &writeActorList); } -} \ No newline at end of file +} diff --git a/apps/openmw-mp/Players.cpp b/apps/openmw-mp/Players.cpp index 61959d57e..1e34d30c7 100644 --- a/apps/openmw-mp/Players.cpp +++ b/apps/openmw-mp/Players.cpp @@ -69,7 +69,7 @@ std::shared_ptr Players::addPlayer(RakNet::RakNetGUID guid) void Players::deletePlayerByPID(int pid) { - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Marking player (pid %lu) to deleting", pid); + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Marking player (pid %i) for deletion", pid); auto &ls = store.get(); auto it = ls.find(pid); if (it != ls.end()) @@ -80,7 +80,7 @@ void Players::deletePlayerByPID(int pid) void Players::deletePlayerByGUID(RakNet::RakNetGUID guid) { - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Marking player (guid %lu) to deleting", guid.g); + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Marking player (guid %lu) for deletion", guid.g); auto &ls = store.get(); auto it = ls.find(guid.g); if (it != ls.end()) @@ -110,4 +110,4 @@ Players::Store::const_iterator Players::end() size_t Players::size() { return store.size(); -} \ No newline at end of file +} diff --git a/apps/openmw-mp/Script/CommandController.cpp b/apps/openmw-mp/Script/CommandController.cpp index ca0d8155d..372eb4662 100644 --- a/apps/openmw-mp/Script/CommandController.cpp +++ b/apps/openmw-mp/Script/CommandController.cpp @@ -97,4 +97,4 @@ std::deque CommandController::cmdParser(const std::string &message) throw runtime_error("failed to parse message: " + message); return ret; -} \ No newline at end of file +} diff --git a/apps/openmw-mp/Script/EventController.cpp b/apps/openmw-mp/Script/EventController.cpp index 5df8f279b..bb9b3850c 100644 --- a/apps/openmw-mp/Script/EventController.cpp +++ b/apps/openmw-mp/Script/EventController.cpp @@ -150,4 +150,4 @@ void EventController::raiseEvent(Event id, sol::table data, const string &modnam } else cerr << "Event with id: " << id << " is not registered" << endl; -} \ No newline at end of file +} diff --git a/apps/openmw-mp/Script/LuaState.cpp b/apps/openmw-mp/Script/LuaState.cpp index 74dae7b36..970aaf088 100644 --- a/apps/openmw-mp/Script/LuaState.cpp +++ b/apps/openmw-mp/Script/LuaState.cpp @@ -78,7 +78,7 @@ LuaState::LuaState() configEnv = sol::environment(*lua, sol::create, lua->globals()); lua->set("Config", configEnv); // plain global environment for mod configuration - // errors in sol::functions catches only in debug build for better performance + // errors in sol::functions are caught only in Debug or RelWithDebInfo builds for better performance #ifdef SOL_SAFE_FUNCTIONS lua->set_function("ErrorHandler", [](sol::object error_msg) { LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, ("Lua: " + error_msg.as()).c_str()); @@ -134,6 +134,7 @@ LuaState::LuaState() lua->set_function("getCurrentMpNum", []() { return mwmp::Networking::getPtr()->getCurrentMpNum(); }); + lua->set_function("setCurrentMpNum", [](int num) { mwmp::Networking::getPtr()->setCurrentMpNum(num); }); @@ -434,4 +435,4 @@ void LuaState::loadMods() } dataEnv["Core"]["LOADED_MODS"] = mods.size(); -} \ No newline at end of file +} diff --git a/apps/openmw-mp/Script/luaUtils.cpp b/apps/openmw-mp/Script/luaUtils.cpp index 1d2bd0249..ccfcb5132 100644 --- a/apps/openmw-mp/Script/luaUtils.cpp +++ b/apps/openmw-mp/Script/luaUtils.cpp @@ -28,4 +28,4 @@ void LuaUtils::Init(LuaState &lua) throw std::runtime_error("string library not initialized"); strTable.set_function("split", &str_split); -} \ No newline at end of file +}