1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-30 08:57:00 +02:00
vcmi/server/GlobalLobbyProcessor.h
2024-01-19 23:52:28 +02:00

42 lines
1.2 KiB
C++

/*
* GlobalLobbyProcessor.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/network/NetworkInterface.h"
VCMI_LIB_NAMESPACE_BEGIN
class JsonNode;
VCMI_LIB_NAMESPACE_END
class CVCMIServer;
class GlobalLobbyProcessor : public INetworkClientListener
{
CVCMIServer & owner;
std::shared_ptr<INetworkConnection> controlConnection;
std::map<std::string, std::shared_ptr<INetworkConnection>> proxyConnections;
void onDisconnected(const std::shared_ptr<INetworkConnection> & connection) override;
void onPacketReceived(const std::shared_ptr<INetworkConnection> & connection, const std::vector<uint8_t> & message) override;
void onConnectionFailed(const std::string & errorMessage) override;
void onConnectionEstablished(const std::shared_ptr<INetworkConnection> &) override;
void sendMessage(const JsonNode & data);
void receiveLoginFailed(const JsonNode & json);
void receiveLoginSuccess(const JsonNode & json);
void receiveAccountJoinsRoom(const JsonNode & json);
void establishNewConnection();
public:
GlobalLobbyProcessor(CVCMIServer & owner);
};