Azerothcore-wotlk: New conf option to enable instance/bg debug mode by default

Created on 31 Mar 2020  路  9Comments  路  Source: azerothcore/azerothcore-wotlk

Hi. I do not know how to use Git, so just write my offer here. I have long been using this patch to enable "Debug" mode for BG and LFG system. it's comfortable. I would like someone to add this opportunity to the server. it will also simplify testing instances.

in worldserver.conf need add:

#    Instance.Debug
#        Description: Turn on debug 5ppl Instance for solo playing.
#        Default:     0 - (Disabled)
#                     1 - (Enabled)

Instance.Debug = 1

and

#    Battleground.Debug
#        Description: Turn on debug Battlegrounds 1x0 mode.
#        Default:     0 - (Disabled)
#                     1 - (Enabled)

Battleground.Debug = 1

core pat褋h:

diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -47,5 +47,5 @@
 /*********************************************************/

-BattlegroundMgr::BattlegroundMgr() : m_ArenaTesting(false), m_Testing(false),
+BattlegroundMgr::BattlegroundMgr() : m_ArenaTesting(false), m_Testing(sWorld->getBoolConfig(CONFIG_DEBUG_BG)),
     m_lastClientVisibleInstanceId(0), m_NextAutoDistributionTime(0), m_AutoDistributionTimeChecker(0), m_NextPeriodicQueueUpdateTime(5*IN_MILLISECONDS)
 {
diff --git a/src/server/game/DungeonFinding/LFGQueue.cpp b/src/server/game/DungeonFinding/LFGQueue.cpp
--- a/src/server/game/DungeonFinding/LFGQueue.cpp
+++ b/src/server/game/DungeonFinding/LFGQueue.cpp
@@ -262,2 +262,4 @@
     uint64 addToFoundMask = 0;
+
+    bool debug = sWorld->getBoolConfig(CONFIG_DEBUG_INSTANCE);

@@ -291,3 +293,3 @@
     // Group with less that MAXGROUPSIZE members always compatible
-    if (check.size() == 1 && numPlayers < MAXGROUPSIZE)
+    if (check.size() == 1 && numPlayers < MAXGROUPSIZE && !debug)
     {
@@ -309,3 +311,3 @@
     // If it's single group no need to check for duplicate players, ignores, bad roles or bad dungeons as it's been checked before joining
-    if (check.size() > 1)
+    if (check.size() > 1 && !debug)
     {
@@ -388,3 +390,3 @@
     // Enough players?
-    if (numPlayers != MAXGROUPSIZE)
+    if (numPlayers != MAXGROUPSIZE && !debug)
     {
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -77,2 +77,4 @@
     CONFIG_DURABILITY_LOSS_IN_PVP = 0,
+    CONFIG_DEBUG_BG,
+    CONFIG_DEBUG_INSTANCE,
     CONFIG_ADDON_CHANNEL,
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -642,2 +642,6 @@
     m_bool_configs[CONFIG_DURABILITY_LOSS_IN_PVP] = sConfigMgr->GetBoolDefault("DurabilityLoss.InPvP", false);
+
+    m_bool_configs[CONFIG_DEBUG_BG] = sConfigMgr->GetBoolDefault("Battleground.Debug", false);
+
+    m_bool_configs[CONFIG_DEBUG_INSTANCE] = sConfigMgr->GetBoolDefault("Instance.Debug", false);


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Fix included Suggestion

Most helpful comment

i think both would not hurt, i agree that saving precious seconds is always neat

it's a minor addition but it can be useful, especially on testing/dev realms only

All 9 comments

#    Battleground.Debug
#        Description: Turn on debug Battlegrounds 1x0 mode.
#        Default:     0 - (Disabled)
#                     1 - (Enabled)

Battleground.Debug = 1

We have command for this: .debug bg

#    Instance.Debug
#        Description: Turn on debug 5ppl Instance for solo playing.
#        Default:     0 - (Disabled)
#                     1 - (Enabled)

Instance.Debug = 1

And for this we can add new command like .debug LFG, i think it's better than config.

btw thank you :+1:

We have these commands without LFG.

@IntelligentQuantum but tell, me if he restart the server he need to use these commands again no?

@Maurowin Yes and these commands are mostly used by developers for testing.

To facilitate testing and work on the server, you need a constant mode. always typing commands is not convenient.

I agree with you but not in this case.
That was my opinion anyway :smiley:

i think both would not hurt, i agree that saving precious seconds is always neat

it's a minor addition but it can be useful, especially on testing/dev realms only

You have to be careful that it doesn't conflict with the .debug command.
Let's imagine that in the conf file the mode is set to 1 and that for a reason x in game we do the .debug 0 command, so the debug mode must be temporarily disabled.

@Kitzunu can we close this? I think so because your PR has been merged.

I didnt touch the instance part, thats why I never closed it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PivanDepolo picture PivanDepolo  路  3Comments

wowissues picture wowissues  路  3Comments

Wokwer picture Wokwer  路  4Comments

wowmane picture wowmane  路  3Comments

Maurowin picture Maurowin  路  3Comments