Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ChatServer crash on startup #1303

Merged
merged 1 commit into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dChatServer/ChatServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ int main(int argc, char** argv) {

Game::randomEngine = std::mt19937(time(0));

playerContainer.Initialize();

//Run it until server gets a kill message from Master:
auto t = std::chrono::high_resolution_clock::now();
Packet* packet = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion dChatServer/PlayerContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "ChatPackets.h"
#include "dConfig.h"

PlayerContainer::PlayerContainer() {
void PlayerContainer::Initialize() {
GeneralUtils::TryParse<uint32_t>(Game::config->GetValue("max_number_of_best_friends"), m_MaxNumberOfBestFriends);
GeneralUtils::TryParse<uint32_t>(Game::config->GetValue("max_number_of_friends"), m_MaxNumberOfFriends);
}
Expand Down
2 changes: 1 addition & 1 deletion dChatServer/PlayerContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ struct TeamData {

class PlayerContainer {
public:
PlayerContainer();
~PlayerContainer();

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