2023-02-12 09:23:39 +02:00
|
|
|
/*
|
|
|
|
* ClientNetPackVisitors.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/NetPackVisitor.h"
|
|
|
|
|
|
|
|
class CClient;
|
2023-04-08 20:29:04 +02:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
2023-02-12 09:23:39 +02:00
|
|
|
class CGameState;
|
2023-04-08 20:29:04 +02:00
|
|
|
VCMI_LIB_NAMESPACE_END
|
2023-02-12 09:23:39 +02:00
|
|
|
|
|
|
|
class ApplyOnLobbyHandlerNetPackVisitor : public VCMI_LIB_WRAP_NAMESPACE(ICPackVisitor)
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
CServerHandler & handler;
|
|
|
|
bool result;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ApplyOnLobbyHandlerNetPackVisitor(CServerHandler & handler)
|
|
|
|
:handler(handler), result(true)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool getResult() const { return result; }
|
|
|
|
|
|
|
|
virtual void visitLobbyClientConnected(LobbyClientConnected & pack) override;
|
|
|
|
virtual void visitLobbyClientDisconnected(LobbyClientDisconnected & pack) override;
|
|
|
|
virtual void visitLobbyEndGame(LobbyEndGame & pack) override;
|
|
|
|
virtual void visitLobbyStartGame(LobbyStartGame & pack) override;
|
|
|
|
virtual void visitLobbyUpdateState(LobbyUpdateState & pack) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class ApplyOnLobbyScreenNetPackVisitor : public VCMI_LIB_WRAP_NAMESPACE(ICPackVisitor)
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
CServerHandler & handler;
|
|
|
|
CLobbyScreen * lobby;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ApplyOnLobbyScreenNetPackVisitor(CServerHandler & handler, CLobbyScreen * lobby)
|
|
|
|
:handler(handler), lobby(lobby)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void visitLobbyClientDisconnected(LobbyClientDisconnected & pack) override;
|
|
|
|
virtual void visitLobbyChatMessage(LobbyChatMessage & pack) override;
|
|
|
|
virtual void visitLobbyGuiAction(LobbyGuiAction & pack) override;
|
|
|
|
virtual void visitLobbyStartGame(LobbyStartGame & pack) override;
|
|
|
|
virtual void visitLobbyUpdateState(LobbyUpdateState & pack) override;
|
|
|
|
virtual void visitLobbyShowMessage(LobbyShowMessage & pack) override;
|
2023-04-08 20:29:04 +02:00
|
|
|
};
|