liyunfan1223 / mod-playerbots

AzerothCore Playerbots Module
https://discord.gg/NQm5QShwf9
GNU Affero General Public License v3.0
232 stars 128 forks source link

[SOLVED] Current build breaks Eluna #347

Open LitchLight opened 1 month ago

LitchLight commented 1 month ago

Describe the bug Current PlayerBots/AzerothCore ? build breaks compilation of Eluna with following errors ...

/home/acore/azerothcore-wotlk/modules/mod-eluna/src/ElunaLuaEngine_SC.cpp:240:10: error: ‘void Eluna_AllMapScript::OnBeforeCreateInstanceScript(InstanceMap*, InstanceScript*, bool, std::string, uint32)’ marked ‘override’, but does not override
  240 |     void OnBeforeCreateInstanceScript(InstanceMap* instanceMap, InstanceScript* instanceData, bool /*load*/, std::string /*data*/, uint32 /*completedEncounterMask*/) override
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/acore/azerothcore-wotlk/modules/mod-eluna/src/ElunaLuaEngine_SC.cpp:333:10: error: ‘bool Eluna_CommandSC::CanExecuteCommand(ChatHandler&, std::string_view)’ marked ‘override’, but does not override
  333 |     bool CanExecuteCommand(ChatHandler& handler, std::string_view cmdStr) override
      |          ^~~~~~~~~~~~~~~~~
[ 14%] Building CXX object src/server/game/CMakeFiles/game.dir/AI/CoreAI/GameObjectAI.cpp.o

Commit hash The hash of the current commit.

Desktop (please complete the following information): FatDog64 901 (Linux) 6.1.46 2 SMP PREEMPT_DYNAMIC Thu Sep 14 22:07:07 AEST 2023 x86_64 AMD Phenom(tm) II X3 B75 Processor AuthenticAMD GNU/Linux 12GB Ram

cmake version 3.26.2 gcc (GCC) 12.2.0 clang version 15.0.7 ldd (GNU libc) 2.37 BOOST_VERSION

define BOOST_LIB_VERSION "1_81"

go version go1.22.3 linux/amd64 OpenSSL 3.1.1 30 May 2023 (Library: OpenSSL 3.1.1 30 May 2023) mysqld Ver 10.6.14-MariaDB for Linux on x86_64 (Source distribution)

Additional context Add any other context about the problem here.

Solution: /home/acore/azerothcore-wotlk/modules/mod-eluna/src/ElunaLuaEngine_SC.cpp

Turn off "override"...

class Eluna_CommandSC : public CommandSC
{
public:
    Eluna_CommandSC() : CommandSC("Eluna_CommandSC") { }

    bool CanExecuteCommand(ChatHandler& handler, std::string_view cmdStr) /*override*/
    {
        if (!sEluna->OnCommand(handler, std::string(cmdStr).c_str()))
        {
            return false;
        }

        return true;
    }
};

Update Eluna_AllMapScript class to align with "OnBeforeCreateInstanceScript". This is defined in: /root/acore/azerothcore-wotlk/src/server/game/Scripting/ScriptDefines/AllMapScript.h

Change the routine to align to the definiition in that file ^^. Change must occur in: /home/acore/azerothcore-wotlk/modules/mod-eluna/src/ElunaLuaEngine_SC.cpp

class Eluna_AllMapScript : public AllMapScript
{
public:
    Eluna_AllMapScript() : AllMapScript("Eluna_AllMapScript") { }

    void OnBeforeCreateInstanceScript(InstanceMap* instanceMap, InstanceScript** instanceData, bool load, std::string data, uint32 completedEncounterMask) override
    {
        *instanceData = sEluna->GetInstanceData(instanceMap);
    }

    void OnDestroyInstance(MapInstanced* mapInstanced, Map* map) override
    {
        sEluna->FreeInstanceId(map->GetInstanceId());
    }

    void OnCreateMap(Map* map) override
    {
        sEluna->OnCreate(map);
    }

    void OnDestroyMap(Map* map) override
    {
        sEluna->OnDestroy(map);
    }

    void OnPlayerEnterAll(Map* map, Player* player) override
    {
        sEluna->OnPlayerEnter(map, player);
    }

    void OnPlayerLeaveAll(Map* map, Player* player) override
    {
        sEluna->OnPlayerLeave(map, player);
    }

    void OnMapUpdate(Map* map, uint32 diff) override
    {
        sEluna->OnUpdate(map, diff);
    }
};
zbhcn commented 1 month ago

I suspect that my intermittent crashes might also be related to this Eluna issue.

LitchLight commented 1 month ago

I suspect that my intermittent crashes might also be related to this Eluna issue.

No. This issue stops the compile from completing with the above error. If your compile finished 100% then this is not your problem.

zbhcn commented 1 month ago

oh,my compile was completed,and there is no problem as you mentioned

noisiver commented 1 month ago

You shouldn't use Eluna with Playerbots to begin with. image image

zbhcn commented 1 month ago

首先,您不应该将 Eluna 与 Playerbots 一起使用。 图像 图像

thank you , by the way , where did the information in your picture come from? is it reliable?

noisiver commented 1 month ago

The information comes from the AzerothCore discord server, from Foe who is one of the people responsible for the AC Eluna module. It is reliable.

LitchLight commented 1 month ago

Performance with less than 1000 bots has been acceptable.