Search code examples
c++azerothcore

Module: AHBot (no matching constructor for initialization of 'WorldSession')


Basically I'm stuck with this error, no matching constructor for initialization of 'WorldSession'

        WorldSession _session(AHBplayerAccount, NULL, SEC_PLAYER, sWorld->getIntConfig(CONFIG_EXPANSION), 0, LOCALE_zhCN,0,false,false);
                     ^        
/home/djboxer/Projects/azerothcore/src/server/game/Server/WorldSession.h:188:9: note: candidate constructor not viable: requires 10 arguments, but 9 were provided
        WorldSession(uint32 id, WorldSocket* sock, AccountTypes sec, uint8 expansion, time_t mute_time, LocaleConstant locale, uint32 recruiter, bool isARecruiter, bool skipQueue, ui...
        ^
/home/djboxer/Projects/azerothcore/src/server/game/Server/WorldSession.h:185:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 9 were provided
class WorldSession

I list here files for reference: AuctionHouseBot.cpp https://github.com/azerothcore/mod-ah-bot/blob/master/src/AuctionHouseBot.cpp#L720

Worldsession.cpp https://github.com/azerothcore/azerothcore-wotlk/blob/master/src/server/game/Server/WorldSession.cpp#L88

Worldsession.h https://github.com/azerothcore/azerothcore-wotlk/blob/master/src/server/game/Server/WorldSession.h#L185

Any help on this will be much appreciate


Solution

  • find line 720 AuctionHouse.cpp

    WorldSession _session(AHBplayerAccount, NULL, SEC_PLAYER, sWorld->getIntConfig(CONFIG_EXPANSION), 0, LOCALE_zhCN,0,false,false);
    

    change to

    WorldSession _session(AHBplayerAccount, NULL, SEC_PLAYER, sWorld->getIntConfig(CONFIG_EXPANSION), 0, LOCALE_zhCN,0,false,false,0);