From f2eca2566f4c91f4e2fa24c69fcd2b711e814a84 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 10 Dec 2017 10:06:27 +0200 Subject: [PATCH] [Server] Add storedData table for Player to increase clarity This way, customData is meant to hold module-specific and temporary data while storedData is meant to hold persistent core data. --- apps/openmw-mp/Player.cpp | 2 ++ apps/openmw-mp/Player.hpp | 1 + 2 files changed, 3 insertions(+) diff --git a/apps/openmw-mp/Player.cpp b/apps/openmw-mp/Player.cpp index a398c9138..2d8fcc6e0 100644 --- a/apps/openmw-mp/Player.cpp +++ b/apps/openmw-mp/Player.cpp @@ -92,6 +92,7 @@ void Player::Init(LuaState &lua) "cellStateSize", &Player::cellStateSize, "addCellExplored", &Player::addCellExplored, "setAuthority", &Player::setAuthority, + "storedData", &Player::storedData, "customData", &Player::customData, "markedForDeletion", sol::property(&Player::isMarkedForDeleteion) ); @@ -119,6 +120,7 @@ Player::Player(RakNet::RakNetGUID guid) : BasePlayer(guid), NetActor(), changedM creatureStats.blank(); charClass.blank(); markedForDeletion = false; + storedData = mwmp::Networking::get().getState().getState()->create_table(); customData = mwmp::Networking::get().getState().getState()->create_table(); } diff --git a/apps/openmw-mp/Player.hpp b/apps/openmw-mp/Player.hpp index 5f7ec5444..8097fe703 100644 --- a/apps/openmw-mp/Player.hpp +++ b/apps/openmw-mp/Player.hpp @@ -204,6 +204,7 @@ private: Quests quests; Spells spells; WeatherMgr weatherMgr; + sol::table storedData; sol::table customData; bool markedForDeletion; };