mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
GameHandler now uses GameConnectionID instead of connection pointers
This commit is contained in:
@@ -43,7 +43,6 @@
|
||||
#include "../lib/mapObjects/CGMarket.h"
|
||||
#include "../lib/mapObjects/CGTownInstance.h"
|
||||
#include "../lib/gameState/CGameState.h"
|
||||
#include "../lib/serializer/GameConnection.h"
|
||||
#include "../lib/CStack.h"
|
||||
#include "../lib/battle/BattleInfo.h"
|
||||
#include "../lib/GameConstants.h"
|
||||
@@ -422,40 +421,6 @@ void ApplyClientNetPackVisitor::visitPlayerEndsGame(PlayerEndsGame & pack)
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyClientNetPackVisitor::visitPlayerReinitInterface(PlayerReinitInterface & pack)
|
||||
{
|
||||
auto initInterfaces = [this]()
|
||||
{
|
||||
cl.initPlayerInterfaces();
|
||||
|
||||
for(PlayerColor player(0); player < PlayerColor::PLAYER_LIMIT; ++player)
|
||||
{
|
||||
if(cl.gameState().isPlayerMakingTurn(player))
|
||||
{
|
||||
callAllInterfaces(cl, &IGameEventsReceiver::playerStartsTurn, player);
|
||||
callOnlyThatInterface(cl, player, &CGameInterface::yourTurn, QueryID::NONE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
for(auto player : pack.players)
|
||||
{
|
||||
auto & plSettings = GAME->server().si->getIthPlayersSettings(player);
|
||||
if(pack.playerConnectionId == PlayerSettings::PLAYER_AI)
|
||||
{
|
||||
plSettings.connectedPlayerIDs.clear();
|
||||
cl.initPlayerEnvironments();
|
||||
initInterfaces();
|
||||
}
|
||||
else if(pack.playerConnectionId == GAME->server().logicConnection->connectionID)
|
||||
{
|
||||
plSettings.connectedPlayerIDs.insert(pack.playerConnectionId);
|
||||
cl.playerint.clear();
|
||||
initInterfaces();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyClientNetPackVisitor::visitRemoveBonus(RemoveBonus & pack)
|
||||
{
|
||||
switch(pack.who)
|
||||
|
||||
Reference in New Issue
Block a user