Skip to content

Commit

Permalink
Merge pull request #440 from Niam5/cm-cleanup
Browse files Browse the repository at this point in the history
CMaNGOS specific cleanups and CI update
  • Loading branch information
Foereaper authored Jul 31, 2023
2 parents e53e406 + b00639d commit d2ace63
Show file tree
Hide file tree
Showing 22 changed files with 213 additions and 2,697 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
eluna: [ON]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: false
repository: ElunaLuaEngine/ElunaTrinityWotlk
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
path: src/server/game/LuaEngine
- name: Dependencies
Expand Down Expand Up @@ -108,12 +108,12 @@ jobs:
patch: [zero, one, two]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
repository: mangos${{ matrix.patch }}/server
ref: master
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
path: src/modules/Eluna
- name: Configure
Expand All @@ -122,7 +122,7 @@ jobs:
run: |
mkdir bin
cd bin
cmake .. -DELUNA=$ELUNA -DCMAKE_INSTALL_PREFIX=install -DSOAP=1 -DPLAYERBOTS=0 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/
cmake .. -DSCRIPT_LIB_ELUNA=$ELUNA -DCMAKE_INSTALL_PREFIX=install -DSOAP=1 -DPLAYERBOTS=0 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/
cd ..
- name: Build
run: |
Expand All @@ -135,19 +135,21 @@ jobs:
fail-fast: false
matrix:
eluna: [ON, OFF]
patch: [Classic, TBC, WotLK]
runs-on: ubuntu-20.04
patch: [Classic, TBC, WotLK, Cata]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: false
repository: Niam5/Eluna-CMaNGOS-${{ matrix.patch }}
ref: master
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
path: src/game/LuaEngine
- name: Dependencies
- name: Dependencies and Environment
run: |
echo "CC=gcc-12" >> $GITHUB_ENV
echo "CXX=g++-12" >> $GITHUB_ENV
sudo apt-get update && sudo apt-get install -yq libboost-all-dev
- name: Configure
env:
Expand Down
36 changes: 1 addition & 35 deletions CMangos/AuraMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ namespace LuaAura
*/
int GetCasterGUID(lua_State* L, Aura* aura)
{
#if defined TRINITY || AZEROTHCORE
Eluna::Push(L, aura->GetCasterGUID());
#else
Eluna::Push(L, aura->GetCasterGuid());
#endif
return 1;
}

Expand All @@ -54,11 +50,7 @@ namespace LuaAura
*/
int GetCasterLevel(lua_State* L, Aura* aura)
{
#if defined(TRINITY) || CMANGOS
Eluna::Push(L, aura->GetCaster()->GetLevel());
#else
Eluna::Push(L, aura->GetCaster()->getLevel());
#endif
return 1;
}

Expand All @@ -69,11 +61,7 @@ namespace LuaAura
*/
int GetDuration(lua_State* L, Aura* aura)
{
#if defined TRINITY || AZEROTHCORE
Eluna::Push(L, aura->GetDuration());
#else
Eluna::Push(L, aura->GetAuraDuration());
#endif
return 1;
}

Expand All @@ -98,11 +86,7 @@ namespace LuaAura
*/
int GetMaxDuration(lua_State* L, Aura* aura)
{
#if defined TRINITY || AZEROTHCORE
Eluna::Push(L, aura->GetMaxDuration());
#else
Eluna::Push(L, aura->GetAuraMaxDuration());
#endif
return 1;
}

Expand All @@ -126,11 +110,7 @@ namespace LuaAura
*/
int GetOwner(lua_State* L, Aura* aura)
{
#if defined TRINITY || defined AZEROTHCORE
Eluna::Push(L, aura->GetOwner());
#else
Eluna::Push(L, aura->GetTarget());
#endif
return 1;
}

Expand All @@ -142,15 +122,11 @@ namespace LuaAura
int SetDuration(lua_State* L, Aura* aura)
{
int32 duration = Eluna::CHECKVAL<int32>(L, 2);
#if defined TRINITY || defined AZEROTHCORE
aura->SetDuration(duration);
#else
aura->GetHolder()->SetAuraDuration(duration);
#if (defined(TBC) || defined(CLASSIC))
aura->GetHolder()->UpdateAuraDuration();
#else
aura->GetHolder()->SendAuraUpdate(false);
#endif
#endif
return 0;
}
Expand All @@ -166,15 +142,11 @@ namespace LuaAura
int SetMaxDuration(lua_State* L, Aura* aura)
{
int32 duration = Eluna::CHECKVAL<int32>(L, 2);
#if defined TRINITY || defined AZEROTHCORE
aura->SetMaxDuration(duration);
#else
aura->GetHolder()->SetAuraMaxDuration(duration);
#if (defined(TBC) || defined(CLASSIC))
aura->GetHolder()->UpdateAuraDuration();
#else
aura->GetHolder()->SendAuraUpdate(false);
#endif
#endif
return 0;
}
Expand All @@ -190,9 +162,7 @@ namespace LuaAura
int SetStackAmount(lua_State* L, Aura* aura)
{
uint8 amount = Eluna::CHECKVAL<uint8>(L, 2);
#if defined TRINITY || defined AZEROTHCORE
aura->SetStackAmount(amount);
#elif defined CMANGOS
#ifndef CATA
aura->GetHolder()->SetStackAmount(amount, aura->GetTarget());
#else
aura->GetHolder()->SetStackAmount(amount);
Expand All @@ -205,11 +175,7 @@ namespace LuaAura
*/
int Remove(lua_State* L, Aura* aura)
{
#if defined TRINITY || defined AZEROTHCORE
aura->Remove();
#else
aura->GetTarget()->RemoveSpellAuraHolder(aura->GetHolder(), AURA_REMOVE_BY_CANCEL);
#endif
Eluna::CHECKOBJ<ElunaObject>(L, 1)->Invalidate();
return 0;
}
Expand Down
28 changes: 1 addition & 27 deletions CMangos/BattleGroundMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ namespace LuaBattleGround
{
uint32 team = Eluna::CHECKVAL<uint32>(L, 2);

#ifndef AZEROTHCORE
Eluna::Push(L, bg->GetAlivePlayersCountByTeam((Team)team));
#else
Eluna::Push(L, bg->GetAlivePlayersCountByTeam((TeamId)team));
#endif
return 1;
}

Expand Down Expand Up @@ -88,11 +84,7 @@ namespace LuaBattleGround
*/
int GetEndTime(lua_State* L, BattleGround* bg)
{
#ifdef CATA
Eluna::Push(L, bg->GetRemainingTime());
#else
Eluna::Push(L, bg->GetEndTime());
#endif
return 1;
}

Expand All @@ -106,11 +98,7 @@ namespace LuaBattleGround
{
uint32 team = Eluna::CHECKVAL<uint32>(L, 2);

#ifndef AZEROTHCORE
Eluna::Push(L, bg->GetFreeSlotsForTeam((Team)team));
#else
Eluna::Push(L, bg->GetFreeSlotsForTeam((TeamId)team));
#endif
return 1;
}

Expand All @@ -121,7 +109,7 @@ namespace LuaBattleGround
*/
int GetInstanceId(lua_State* L, BattleGround* bg)
{
#ifdef CMANGOS
#ifndef CATA
Eluna::Push(L, bg->GetInstanceId());
#else
Eluna::Push(L, bg->GetInstanceID());
Expand All @@ -147,13 +135,7 @@ namespace LuaBattleGround
*/
int GetTypeId(lua_State* L, BattleGround* bg)
{
#ifdef CMANGOS
Eluna::Push(L, bg->GetTypeId());
#elif !AZEROTHCORE
Eluna::Push(L, bg->GetTypeID());
#else
Eluna::Push(L, bg->GetBgTypeID());
#endif
return 1;
}

Expand Down Expand Up @@ -186,11 +168,7 @@ namespace LuaBattleGround
*/
int GetMaxPlayers(lua_State* L, BattleGround* bg)
{
#ifndef AZEROTHCORE
Eluna::Push(L, bg->GetMaxPlayers());
#else
Eluna::Push(L, bg->GetMaxPlayersPerTeam() * 2);
#endif
return 1;
}

Expand All @@ -201,11 +179,7 @@ namespace LuaBattleGround
*/
int GetMinPlayers(lua_State* L, BattleGround* bg)
{
#ifndef AZEROTHCORE
Eluna::Push(L, bg->GetMinPlayers());
#else
Eluna::Push(L, bg->GetMaxPlayersPerTeam() * 2);
#endif
return 1;
}

Expand Down
4 changes: 0 additions & 4 deletions CMangos/CorpseMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ namespace LuaCorpse
*/
int GetOwnerGUID(lua_State* L, Corpse* corpse)
{
#if defined TRINITY || AZEROTHCORE
Eluna::Push(L, corpse->GetOwnerGUID());
#else
Eluna::Push(L, corpse->GetOwnerGuid());
#endif
return 1;
}

Expand Down
Loading

0 comments on commit d2ace63

Please sign in to comment.