[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.
sol2-server-rewrite
David Cernat 7 years ago
parent 077a3d06b3
commit f2eca2566f

@ -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();
}

@ -204,6 +204,7 @@ private:
Quests quests;
Spells spells;
WeatherMgr weatherMgr;
sol::table storedData;
sol::table customData;
bool markedForDeletion;
};

Loading…
Cancel
Save