Jump to content

[Fix] Always allow changing channel password by moderator


Recommended Posts

Posted

What bug does the patch fix? Moderators are unable to change a channel password unless they are already on it

For which repository revision was the patch created? 8719, 0.12 backport

Is there a thread in the bug report section or at lighthouse? Not that I am aware of.

Who has been writing this patch? Me, FragFrog

We come upon an interesting problem a few days ago. On our server it is custom to have two channels always available to users (for general chat and GM support). Since a moderator is not always online, sometimes these channels automatically change owner to a normal user. One of these users decided to then put a password protection on those channels, so effectively nobody could join them anymore. Moderators who were all not on those channels at the time were then unable to join them and the /password [channel] [newpassword] command does not work if you are not on a channel - as a result we had to restart to server to get access to those channels again.

This patch is very simple: it always allows moderators to change a channels password, even if they are not actually on that channel. Written for the 0.12 backport but since the channel code is little changed I expect it is applicable for master as well.

---
src/game/Channel.cpp |    6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/game/Channel.cpp b/src/game/Channel.cpp
index e0fca88..fd430ed 100644
--- a/src/game/Channel.cpp
+++ b/src/game/Channel.cpp
@@ -274,7 +274,11 @@ void Channel::Password(uint64 p, const char *pass)
    if(plr)
        sec = plr->GetSession()->GetSecurity();

-    if(!IsOn(p))
+	// Always allow GM's to change a channels password - even if they are not on it.
+	if (sec >= SEC_GAMEMASTER)
+		m_password = pass;
+
+	if(!IsOn(p))
    {
        WorldPacket data;
        MakeNotMember(&data);
-- 

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use