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

feat(skymp5-server): log guid on connection in ServerState #2346

Merged
merged 2 commits into from
Feb 17, 2025
Merged
Changes from 1 commit
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
18 changes: 14 additions & 4 deletions skymp5-server/cpp/server_guest_lib/ServerState.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
#include "ServerState.h"
#include "Exceptions.h"
#include "JsonUtils.h"
#include "MpActor.h"
#include "MsgType.h"

#include <algorithm>

#include <spdlog/spdlog.h>

#include "MpActor.h"

void ServerState::Connect(Networking::UserId userId, const std::string& guid)
{
if (userInfo[userId] != nullptr) {
spdlog::error("ServerState::Connect: overwritten userInfo for userId={}, "
"old guid: {}, new guid: {}",
userId, userInfo[userId]->guid, guid);
}

userInfo[userId] = std::make_unique<UserInfo>();
userInfo[userId]->guid = guid;

spdlog::error("ServerState::Connect: assigning guid for userId={}: guid={}",
userId, guid);

if (maxConnectedId < userId) {
maxConnectedId = userId;
}
Expand Down
Loading