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 for GroupLeaderName() returning wrong group leader. #3706

Closed
Bastion-Server opened this issue Nov 23, 2023 · 2 comments
Closed

Fix for GroupLeaderName() returning wrong group leader. #3706

Bastion-Server opened this issue Nov 23, 2023 · 2 comments

Comments

@Bastion-Server
Copy link

Writing this up as a bug because I can't seem to be able to do this as a Pull Request. When the Groups leader has changed, the function that returns the leader name only ever returns membername[0]'s name, not the actual leader if the leader is changed in group. This nerfs the packet and the clients reject it on notify. Using the information noted in expeditions concerning the need to force a database update, I made the following changes to fix the bug.

This is the function in groups.h:

const char* GetLeaderName() { return membername[0]; };

I changed it to:

const char* GetLeaderName() { return GetGroupLeaderName(GetID()).c_str(); };

Then added the following to private:

std::string GetGroupLeaderName(uint32_t group_id);

And appended the below to groups.cpp:

std::string Group::GetGroupLeaderName(uint32_t group_id) {
            char leader_name_buffer[64] = { 0 };
            database.GetGroupLeadershipInfo(group_id, leader_name_buffer);
            return std::string(leader_name_buffer);
}

This resolved the issue and required no other changes to the underlying code.

-- Nameless

@joligario
Copy link
Contributor

#368

Kinglykrab added a commit that referenced this issue Nov 24, 2023
# Notes
- Utilizes fixes posted in #3706 to resolve #368.
- Changing group leader caused issues because we assumed `member[0]` was always leader.
@Kinglykrab
Copy link
Contributor

#3712

Kinglykrab added a commit that referenced this issue Nov 26, 2023
# Notes
- Utilizes fixes posted in #3706 to resolve #368.
- Changing group leader caused issues because we assumed `member[0]` was always leader.
fryguy503 added a commit to wayfarershaven/server that referenced this issue Dec 1, 2023
…Name()

# Notes
- Utilizes fixes posted in EQEmu/Server#3706 to resolve EQEmu/Server#368.
- Changing group leader caused issues because we assumed `member[0]` was always leader.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants