Rename CNSharedData namespace to CNShared to match the filename

This commit is contained in:
2022-07-23 02:07:26 +02:00
parent 998b12617e
commit c5dd745aa1
5 changed files with 10 additions and 10 deletions

View File

@@ -5,22 +5,22 @@
#else
#include <mutex>
#endif
std::map<int64_t, Player> CNSharedData::players;
std::map<int64_t, Player> CNShared::players;
std::mutex playerCrit;
void CNSharedData::setPlayer(int64_t sk, Player& plr) {
void CNShared::setPlayer(int64_t sk, Player& plr) {
std::lock_guard<std::mutex> lock(playerCrit); // the lock will be removed when the function ends
players[sk] = plr;
}
Player CNSharedData::getPlayer(int64_t sk) {
Player CNShared::getPlayer(int64_t sk) {
std::lock_guard<std::mutex> lock(playerCrit); // the lock will be removed when the function ends
return players[sk];
}
void CNSharedData::erasePlayer(int64_t sk) {
void CNShared::erasePlayer(int64_t sk) {
std::lock_guard<std::mutex> lock(playerCrit); // the lock will be removed when the function ends
players.erase(sk);

View File

@@ -10,7 +10,7 @@
#include "Player.hpp"
namespace CNSharedData {
namespace CNShared {
// serialkey corresponds to player data
extern std::map<int64_t, Player> players;