Skip to content

Commit 24e9287

Browse files
authored
Remove compatibility mode (#23)
* Remove Eluna compatibility mode * Update Eluna submodule
1 parent dd245ef commit 24e9287

File tree

8 files changed

+11
-43
lines changed

8 files changed

+11
-43
lines changed

src/server/game/Entities/Object/Object.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,16 +1825,13 @@ void WorldObject::SetMap(Map* map)
18251825
m_mapId = map->GetId();
18261826
m_InstanceId = map->GetInstanceId();
18271827
#ifdef ELUNA
1828-
// in multistate mode, always reset Map events, then recreate the Map events procesor
1829-
if (!sElunaConfig->IsElunaCompatibilityMode())
1830-
{
1831-
auto& events = GetElunaEvents(m_mapId);
1832-
if (events)
1833-
events.reset();
1828+
// always reset Map events, then recreate the Map events procesor if Eluna is enabled for the map
1829+
auto& events = GetElunaEvents(m_mapId);
1830+
if (events)
1831+
events.reset();
18341832

1835-
if (Eluna* e = map->GetEluna())
1836-
events = std::make_unique<ElunaEventProcessor>(e, this);
1837-
}
1833+
if (Eluna* e = map->GetEluna())
1834+
events = std::make_unique<ElunaEventProcessor>(e, this);
18381835

18391836
// create the World events processor
18401837
if (Eluna* e = sWorld->GetEluna())

src/server/game/Maps/Map.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ i_scriptLock(false), _respawnTimes(std::make_unique<RespawnListContainer>()), _r
289289
// lua state begins uninitialized
290290
eluna = nullptr;
291291

292-
if (sElunaConfig->IsElunaEnabled() && !sElunaConfig->IsElunaCompatibilityMode() && sElunaConfig->ShouldMapLoadEluna(id))
292+
if (sElunaConfig->IsElunaEnabled() && sElunaConfig->ShouldMapLoadEluna(id))
293293
if (!IsParentMap() || (IsParentMap() && !Instanceable()))
294294
eluna = std::make_unique<Eluna>(this);
295295
#endif
@@ -4891,14 +4891,4 @@ std::string InstanceMap::GetDebugInfo() const
48914891
return sstr.str();
48924892
}
48934893

4894-
#ifdef ELUNA
4895-
Eluna *Map::GetEluna() const
4896-
{
4897-
if(sElunaConfig->IsElunaCompatibilityMode())
4898-
return sWorld->GetEluna();
4899-
4900-
return eluna.get();
4901-
}
4902-
#endif
4903-
49044894
template class TC_GAME_API TypeUnorderedMapContainer<AllMapStoredObjectTypes, ObjectGuid>;

src/server/game/Maps/Map.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
788788
void AddFarSpellCallback(FarSpellCallback&& callback);
789789
bool IsParentMap() const { return GetParent() == this; }
790790
#ifdef ELUNA
791-
Eluna* GetEluna() const;
791+
Eluna* GetEluna() const { return eluna.get(); }
792792

793793
LuaVal lua_data = LuaVal({});
794794
#endif

src/server/game/Maps/MapManager.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include <numeric>
3939
#ifdef ELUNA
4040
#include "LuaEngine.h"
41-
#include "ElunaConfig.h"
4241
#endif
4342

4443
MapManager::MapManager()
@@ -55,15 +54,6 @@ void MapManager::Initialize()
5554
Map::InitStateMachine();
5655

5756
int num_threads(sWorld->getIntConfig(CONFIG_NUMTHREADS));
58-
#if ELUNA
59-
if (sElunaConfig->IsElunaEnabled() && sElunaConfig->IsElunaCompatibilityMode() && num_threads > 1)
60-
{
61-
// Force 1 thread for Eluna if compatibility mode is enabled. Compatibility mode is single state and does not allow more update threads.
62-
TC_LOG_ERROR("maps", "Map update threads set to {}, when Eluna in compatibility mode only allows 1, changing to 1", num_threads);
63-
num_threads = 1;
64-
}
65-
#endif
66-
6757
// Start mtmaps if needed.
6858
if (num_threads > 0)
6959
m_updater.activate(num_threads);

src/server/game/Scripting/ScriptMgr.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,9 +1560,7 @@ void ScriptMgr::OnMapUpdate(Map* map, uint32 diff)
15601560
#ifdef ELUNA
15611561
if (Eluna* e = map->GetEluna())
15621562
{
1563-
if(!sElunaConfig->IsElunaCompatibilityMode())
1564-
e->UpdateEluna(diff);
1565-
1563+
e->UpdateEluna(diff);
15661564
e->OnUpdate(map, diff);
15671565
}
15681566
#endif

src/server/game/World/World.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2131,7 +2131,7 @@ void World::SetInitialWorldSettings()
21312131
if (sElunaConfig->IsElunaEnabled())
21322132
{
21332133
TC_LOG_INFO("server.loading", "Starting Eluna world state...");
2134-
eluna = std::make_unique<Eluna>(nullptr, sElunaConfig->IsElunaCompatibilityMode());
2134+
eluna = std::make_unique<Eluna>(nullptr);
21352135
}
21362136
#endif
21372137

src/server/worldserver/worldserver.conf.dist

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3889,12 +3889,6 @@ AuctionHouseBot.Buyer.Recheck.Interval = 20
38893889
# Default: true - (enabled)
38903890
# false - (disabled)
38913891
#
3892-
# Eluna.CompatibilityMode
3893-
# Description: Toggles Eluna between compatibility mode (single-threaded) or multistate mode.
3894-
# Compatibility mode limits the core to a single map update thread.
3895-
# Default: true - (enabled)
3896-
# false - (disabled)
3897-
#
38983892
# Eluna.ScriptReloader
38993893
# Description: Enable or disable the automated script reloader.
39003894
# This will automatically reload Eluna when it detects changes to scripts.
@@ -3934,7 +3928,6 @@ AuctionHouseBot.Buyer.Recheck.Interval = 20
39343928
#
39353929

39363930
Eluna.Enabled = true
3937-
Eluna.CompatibilityMode = false
39383931
Eluna.ScriptReloader = false
39393932
Eluna.OnlyOnMaps = ""
39403933
Eluna.TraceBack = false

0 commit comments

Comments
 (0)