mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-11-25 18:58:18 +00:00
Split out unrelated changes to CleanupRoundup branch
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "Database.h"
|
||||
#include "eConnectionType.h"
|
||||
#include "eChatInternalMessageType.h"
|
||||
#include "eGameMasterLevel.h"
|
||||
#include "ChatPackets.h"
|
||||
#include "dConfig.h"
|
||||
|
||||
@@ -20,6 +21,14 @@ void PlayerContainer::Initialize() {
|
||||
GeneralUtils::TryParse<uint32_t>(Game::config->GetValue("max_number_of_friends")).value_or(m_MaxNumberOfFriends);
|
||||
}
|
||||
|
||||
PlayerContainer::~PlayerContainer() {
|
||||
m_Players.clear();
|
||||
}
|
||||
|
||||
PlayerData::PlayerData() {
|
||||
gmLevel = eGameMasterLevel::CIVILIAN;
|
||||
}
|
||||
|
||||
TeamData::TeamData() {
|
||||
lootFlag = Game::config->GetValue("default_team_loot") == "0" ? 0 : 1;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#pragma once
|
||||
#include <map>
|
||||
#include "dCommonVars.h"
|
||||
#include "eGameMasterLevel.h"
|
||||
#include "RakString.h"
|
||||
#include <vector>
|
||||
#include "Game.h"
|
||||
#include "dServer.h"
|
||||
#include <unordered_map>
|
||||
|
||||
enum class eGameMasterLevel : uint8_t;
|
||||
|
||||
struct IgnoreData {
|
||||
IgnoreData(const std::string& name, const LWOOBJID& id) : playerName(name), playerId(id) {}
|
||||
inline bool operator==(const std::string& other) const noexcept {
|
||||
@@ -23,6 +24,7 @@ struct IgnoreData {
|
||||
};
|
||||
|
||||
struct PlayerData {
|
||||
PlayerData();
|
||||
operator bool() const noexcept {
|
||||
return playerID != LWOOBJID_EMPTY;
|
||||
}
|
||||
@@ -43,7 +45,7 @@ struct PlayerData {
|
||||
std::string playerName;
|
||||
std::vector<FriendData> friends;
|
||||
std::vector<IgnoreData> ignoredPlayers;
|
||||
eGameMasterLevel gmLevel = eGameMasterLevel::CIVILIAN;
|
||||
eGameMasterLevel gmLevel;
|
||||
bool isFTP = false;
|
||||
};
|
||||
|
||||
@@ -59,6 +61,8 @@ struct TeamData {
|
||||
|
||||
class PlayerContainer {
|
||||
public:
|
||||
~PlayerContainer();
|
||||
|
||||
void Initialize();
|
||||
void InsertPlayer(Packet* packet);
|
||||
void RemovePlayer(Packet* packet);
|
||||
|
||||
Reference in New Issue
Block a user