mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Add GetRealmID
This commit is contained in:
@@ -51,6 +51,24 @@ namespace LuaGlobalFunctions
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns emulator .conf RealmID
|
||||
*
|
||||
* - for MaNGOS returns the realmID as it is stored in the core.
|
||||
* - for TrinityCore returns the realmID as it is in the conf file.
|
||||
* @return uint32 realm ID
|
||||
*/
|
||||
|
||||
int GetRealmID(lua_State* L)
|
||||
{
|
||||
#ifdef MANGOS
|
||||
Eluna::Push(L, eWorld->GetRealmID());
|
||||
#else
|
||||
Eluna::Push(L, sConfigMgr->GetIntDefault("RealmID", 1));
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns emulator version
|
||||
*
|
||||
|
||||
@@ -77,6 +77,7 @@ luaL_Reg GlobalMethods[] =
|
||||
// Getters
|
||||
{ "GetLuaEngine", &LuaGlobalFunctions::GetLuaEngine },
|
||||
{ "GetCoreName", &LuaGlobalFunctions::GetCoreName },
|
||||
{ "GetRealmID", &LuaGlobalFunctions::GetRealmID },
|
||||
{ "GetCoreVersion", &LuaGlobalFunctions::GetCoreVersion },
|
||||
{ "GetCoreExpansion", &LuaGlobalFunctions::GetCoreExpansion },
|
||||
{ "GetQuest", &LuaGlobalFunctions::GetQuest },
|
||||
|
||||
Reference in New Issue
Block a user