1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00
vcmi/server/LobbyNetPackVisitors.h

102 lines
3.5 KiB
C++
Raw Permalink Normal View History

/*
* LobbyNetPackVisitors.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
#include "../lib/networkPacks/NetPackVisitor.h"
class ClientPermissionsCheckerNetPackVisitor : public VCMI_LIB_WRAP_NAMESPACE(ICPackVisitor)
{
private:
bool result;
CVCMIServer & srv;
public:
ClientPermissionsCheckerNetPackVisitor(CVCMIServer & srv)
:srv(srv), result(false)
{
}
bool getResult() const
{
return result;
}
2024-02-03 22:59:56 +02:00
void visitForLobby(CPackForLobby & pack) override;
void visitLobbyClientConnected(LobbyClientConnected & pack) override;
void visitLobbyClientDisconnected(LobbyClientDisconnected & pack) override;
void visitLobbyRestartGame(LobbyRestartGame & pack) override;
void visitLobbyPrepareStartGame(LobbyPrepareStartGame & pack) override;
void visitLobbyStartGame(LobbyStartGame & pack) override;
void visitLobbyChangeHost(LobbyChangeHost & pack) override;
void visitLobbyChangePlayerOption(LobbyChangePlayerOption & pack) override;
void visitLobbyChatMessage(LobbyChatMessage & pack) override;
void visitLobbyGuiAction(LobbyGuiAction & pack) override;
2024-05-01 15:58:22 +02:00
void visitLobbyPvPAction(LobbyPvPAction & pack) override;
void visitLobbyDelete(LobbyDelete & pack) override;
};
class ApplyOnServerAfterAnnounceNetPackVisitor : public VCMI_LIB_WRAP_NAMESPACE(ICPackVisitor)
{
private:
CVCMIServer & srv;
public:
ApplyOnServerAfterAnnounceNetPackVisitor(CVCMIServer & srv)
:srv(srv)
{
}
2024-02-03 22:59:56 +02:00
void visitForLobby(CPackForLobby & pack) override;
void visitLobbyClientConnected(LobbyClientConnected & pack) override;
void visitLobbyClientDisconnected(LobbyClientDisconnected & pack) override;
void visitLobbyRestartGame(LobbyRestartGame & pack) override;
void visitLobbyStartGame(LobbyStartGame & pack) override;
void visitLobbyChangeHost(LobbyChangeHost & pack) override;
};
class ApplyOnServerNetPackVisitor : public VCMI_LIB_WRAP_NAMESPACE(ICPackVisitor)
{
private:
bool result;
CVCMIServer & srv;
public:
ApplyOnServerNetPackVisitor(CVCMIServer & srv)
:srv(srv), result(true)
{
}
bool getResult() const
{
return result;
}
2024-02-03 22:59:56 +02:00
void visitLobbyClientConnected(LobbyClientConnected & pack) override;
void visitLobbyClientDisconnected(LobbyClientDisconnected & pack) override;
void visitLobbySetMap(LobbySetMap & pack) override;
void visitLobbySetCampaign(LobbySetCampaign & pack) override;
void visitLobbySetCampaignMap(LobbySetCampaignMap & pack) override;
void visitLobbySetCampaignBonus(LobbySetCampaignBonus & pack) override;
void visitLobbyRestartGame(LobbyRestartGame & pack) override;
void visitLobbyStartGame(LobbyStartGame & pack) override;
void visitLobbyChangeHost(LobbyChangeHost & pack) override;
void visitLobbyChangePlayerOption(LobbyChangePlayerOption & pack) override;
void visitLobbySetPlayer(LobbySetPlayer & pack) override;
void visitLobbySetPlayerName(LobbySetPlayerName & pack) override;
2024-07-16 00:40:39 +02:00
void visitLobbySetPlayerHandicap(LobbySetPlayerHandicap & pack) override;
2024-02-03 22:59:56 +02:00
void visitLobbySetTurnTime(LobbySetTurnTime & pack) override;
void visitLobbySetExtraOptions(LobbySetExtraOptions & pack) override;
void visitLobbySetSimturns(LobbySetSimturns & pack) override;
void visitLobbySetDifficulty(LobbySetDifficulty & pack) override;
void visitLobbyForceSetPlayer(LobbyForceSetPlayer & pack) override;
2024-04-30 01:52:49 +02:00
void visitLobbyPvPAction(LobbyPvPAction & pack) override;
void visitLobbyDelete(LobbyDelete & pack) override;
};