Added logout messages#12
Closed
Raz0r1337 wants to merge 13 commits into
Closed
Conversation
logout message added
with description
Added hook for player logout
Fixed small typo
Helias
reviewed
May 29, 2025
Comment on lines
+57
to
+60
| std::string playerIP = player->GetSession()->GetRemoteAddress(); | ||
| std::string playerName = player->GetName(); | ||
| uint32 playerAccountID = player->GetSession()->GetAccountId(); | ||
| std::ostringstream message; |
Member
There was a problem hiding this comment.
You could wrap this into an if that checks if the player session still exists
if (WorldSession* session = player->GetSession())
{
std::string playerIP = session->GetRemoteAddress();
uint32 playerAccountID = session->GetAccountId();
std::string playerName = player->GetName();
uint32 playerAccountID = session->GetAccountId();
std::ostringstream message; // is this used?
LOG_INFO("module", "Player '{}' has logged out : IP '{}' : AccountID '{}'", playerName.c_str(), playerIP.c_str(), playerAccountID);
}
Author
There was a problem hiding this comment.
Thx.
I've implemented your tip in my fork and will test it as soon as my test server is ready.
If everything works as intended, I'll start the next PR right away. ;-)
Member
|
Thanks for the PR! I left some minor comments and I started the pipeline to run some checks |
Now the logout message is wrapped in an if that checks if the playersession exists
fix typo
indentation error fixed
Member
|
Helias
reviewed
May 29, 2025
| if (!sConfigMgr->GetOption<bool>("PlayerLogoutAnnounce", true)) | ||
| return; | ||
|
|
||
| if (WorldSession* session = player->GetSession()) |
test fix
replaced tabs with spaces
fixed variable double declaration
Author
|
I've now implemented all the suggestions, and on my test server without modules, it now compiles 100% and works perfectly. I'm closing this PR and starting a new one with all the updates. Thanks for everything. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes Proposed:
Issues Addressed:
Tests Performed:
How to Test the Changes: