Skip to content

Commit

Permalink
chore: General cleanup roundup (#1444)
Browse files Browse the repository at this point in the history
* Moved unrelated changes out of the TryParse PR branch

* const correctness and cstdint type usage

* removing a few "== nullptr"

* amf constexpr, const-correctness, and attrib tagging

* update to account for feedback

* Fixing accidentally included header and hopefully fixing the MacOS issue too

* try reordering the amf3 specializations to fix the MacOS issue again

* Amf3 template class member func instantiation fix

* try including only on macos

* Using if constexpr rather than specialization

* Trying a different solution for the instantiation problem

* Remove #include "dPlatforms.h"
  • Loading branch information
jadebenn authored Feb 10, 2024
1 parent 0c1ee05 commit 29666a1
Show file tree
Hide file tree
Showing 12 changed files with 220 additions and 230 deletions.
9 changes: 0 additions & 9 deletions dChatServer/PlayerContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "Database.h"
#include "eConnectionType.h"
#include "eChatInternalMessageType.h"
#include "eGameMasterLevel.h"
#include "ChatPackets.h"
#include "dConfig.h"

Expand All @@ -21,14 +20,6 @@ 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;
}
Expand Down
7 changes: 2 additions & 5 deletions dChatServer/PlayerContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
enum class eGameMasterLevel : uint8_t;

struct IgnoreData {
IgnoreData(const std::string& name, const LWOOBJID& id) : playerName(name), playerId(id) {}
IgnoreData(const std::string& name, const LWOOBJID& id) : playerName{ name }, playerId{ id } {}
inline bool operator==(const std::string& other) const noexcept {
return playerName == other;
}
Expand All @@ -24,7 +24,6 @@ struct IgnoreData {
};

struct PlayerData {
PlayerData();
operator bool() const noexcept {
return playerID != LWOOBJID_EMPTY;
}
Expand All @@ -45,7 +44,7 @@ struct PlayerData {
std::string playerName;
std::vector<FriendData> friends;
std::vector<IgnoreData> ignoredPlayers;
eGameMasterLevel gmLevel;
eGameMasterLevel gmLevel = static_cast<eGameMasterLevel>(0); // CIVILLIAN
bool isFTP = false;
};

Expand All @@ -61,8 +60,6 @@ struct TeamData {

class PlayerContainer {
public:
~PlayerContainer();

void Initialize();
void InsertPlayer(Packet* packet);
void RemovePlayer(Packet* packet);
Expand Down
Loading

0 comments on commit 29666a1

Please sign in to comment.