I'm currently working on a LAN server project and I need to start a battleground instance by myself. I can do the joining myself, I won't need help for that. My problem is that my current code causes assertion fails and other such problems like server process freeze.
Most of this code is temporary, what I'm trying to do there is initialize a new BG instance and start it (I've been doing this from the Battleground functions from the trinity source, but I probably forgot something).
The assertion failure error I get is about MapID not existing when I try to make my player join. I'll take a guess and say that it's because I'm doing the initialization wrong =).Code:BattlegroundTypeId bgTypeId = BattlegroundTypeId::BATTLEGROUND_AB; Battleground * bg_template = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId); PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketById(bg_template->GetMapId(), BattlegroundBracketId::BG_BRACKET_ID_FIRST); Battleground * bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, 0, false); bg2->StartBattleground();
EDIT:
I decided to use the actual queue system. I already got everything working using it as most of it is handled by the server.