Jump to content

[PATCH][7174] Save GM Visibility status between login


Auntie Mangos

Recommended Posts

  • 39 years later...

Saves/Sets GM visibility mode on login/logout

mangos.conf

GM.Visible

GM visibility at login

Default: 2 (last save state)

0 (invisible)

1 (visible)

diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index f0b05b4..e68a786 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -14569,6 +14569,17 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
                break;
        }

+        switch(sWorld.getConfig(CONFIG_GM_VISIBLE_STATE))
+        {
+            default:
+            case 0: SetGMVisible(false); break;             // invisible
+            case 1:                      break;             // visible
+            case 2:                                         // save state
+                if(extraflags & PLAYER_EXTRA_GM_INVISIBLE)
+                    SetGMVisible(false);
+                break;
+        }
+
        switch(sWorld.getConfig(CONFIG_GM_ACCEPT_TICKETS))
        {
            default:
diff --git a/src/game/World.cpp b/src/game/World.cpp
index ea59448..fe902cf 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -810,6 +810,7 @@ void World::LoadConfigSettings(bool reload)
    }

    m_configs[CONFIG_GM_LOGIN_STATE]       = sConfig.GetIntDefault("GM.LoginState", 2);
+    m_configs[CONFIG_GM_VISIBLE_STATE]     = sConfig.GetIntDefault("GM.Visible", 2);
    m_configs[CONFIG_GM_ACCEPT_TICKETS]    = sConfig.GetIntDefault("GM.AcceptTickets", 2);
    m_configs[CONFIG_GM_CHAT]              = sConfig.GetIntDefault("GM.Chat", 2);
    m_configs[CONFIG_GM_WISPERING_TO]      = sConfig.GetIntDefault("GM.WhisperingTo", 2);
diff --git a/src/game/World.h b/src/game/World.h
index 27f81d8..7cc31dd 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -122,6 +122,7 @@ enum WorldConfigs
    CONFIG_MAX_PRIMARY_TRADE_SKILL,
    CONFIG_MIN_PETITION_SIGNS,
    CONFIG_GM_LOGIN_STATE,
+    CONFIG_GM_VISIBLE_STATE,
    CONFIG_GM_ACCEPT_TICKETS,
    CONFIG_GM_CHAT,
    CONFIG_GM_WISPERING_TO,
diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in
index 4f42a18..cc0aa13 100644
--- a/src/mangosd/mangosd.conf.dist.in
+++ b/src/mangosd/mangosd.conf.dist.in
@@ -833,6 +833,12 @@ Channel.SilentlyGMJoin = 0
#                 0 (disable)
#                 1 (enable)
#
+#    GM.Visible
+#        GM visibility at login
+#        Default: 2 (last save state)
+#                 0 (invisible)
+#                 1 (visible)
+#
#    GM.AcceptTickets
#        Is GM accepting tickets from player by default or not.
#        Default: 2 (last save state)
@@ -883,6 +889,7 @@ Channel.SilentlyGMJoin = 0
###################################################################################################################

GM.LoginState            = 2
+GM.Visible               = 2
GM.AcceptTickets         = 2
GM.Chat                  = 2
GM.WhisperingTo          = 2

Link to comment
Share on other sites

It not identical but similar.So i not think this case authorship replace/etc. I think it created independently.

Thank you for your patch ofc. Possible i not see your patch in past by some reason.

I not have time for read all threads at forum. And like cases possible.

So i add patch what i see. Note: i originally found version at mangos.ru and only later found same patch at getmangos.eu.

[added]Now i understand why i not see your patch early.

You place it into "Code modification" section and mostly not look in this section by absent time reason.

This section mostly for custom changes not ready or not appropriate for adding to offical mangos sources.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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