mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
more ISL code: join, leave, and userMessage work on both sides
This commit is contained in:
parent
5963c2239c
commit
0ae18d7b2e
16 changed files with 363 additions and 112 deletions
31
common/server_abstractuserinterface.h
Normal file
31
common/server_abstractuserinterface.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#ifndef SERVER_ABSTRACTUSERINTERFACE
|
||||
#define SERVER_ABSTRACTUSERINTERFACE
|
||||
|
||||
#include "serverinfo_user_container.h"
|
||||
#include "pb/server_message.pb.h"
|
||||
|
||||
class Response;
|
||||
class SessionEvent;
|
||||
class GameEventContainer;
|
||||
class RoomEvent;
|
||||
|
||||
class Server;
|
||||
|
||||
class Server_AbstractUserInterface : public ServerInfo_User_Container {
|
||||
protected:
|
||||
Server *server;
|
||||
public:
|
||||
Server_AbstractUserInterface(Server *_server) : server(_server) { }
|
||||
Server_AbstractUserInterface(Server *_server, const ServerInfo_User_Container &other) : ServerInfo_User_Container(other), server(_server) { }
|
||||
virtual ~Server_AbstractUserInterface() { }
|
||||
|
||||
virtual void sendProtocolItem(const Response &item) = 0;
|
||||
virtual void sendProtocolItem(const SessionEvent &item) = 0;
|
||||
virtual void sendProtocolItem(const GameEventContainer &item) = 0;
|
||||
virtual void sendProtocolItem(const RoomEvent &item) = 0;
|
||||
void sendProtocolItemByType(ServerMessage::MessageType type, const ::google::protobuf::Message &item);
|
||||
|
||||
static SessionEvent *prepareSessionEvent(const ::google::protobuf::Message &sessionEvent);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue