diff options
Diffstat (limited to 'server/client.h')
-rw-r--r-- | server/client.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/server/client.h b/server/client.h index 3455056..676264e 100644 --- a/server/client.h +++ b/server/client.h @@ -16,6 +16,9 @@ class ClientBase { virtual ~ClientBase() {} + //! Return client's id. + virtual unsigned int id() = 0; + //! Return client's nick. virtual std::string nick() = 0; @@ -48,6 +51,8 @@ class Client : public ClientBase, public boost::enable_shared_from_this<Client> boost::asio::deadline_timer timer; + unsigned int id_; + std::string nick_; Client(Connection::p c); @@ -71,6 +76,9 @@ class Client : public ClientBase, public boost::enable_shared_from_this<Client> //! Inform client of lobby status (available game modes). void lobby_status(const std::vector<std::string>& game_modes, boost::function<void (int)> callback); + //! Return client's id. + virtual unsigned int id(); + //! Return client's nick. virtual std::string nick(); @@ -88,12 +96,20 @@ class Client : public ClientBase, public boost::enable_shared_from_this<Client> //! Get action. Upon connection error, last element of expected_actions will be provided. virtual void get_action(boost::function<void (Action)> callback, Actions expected_actions); + + //! Dis-connect a player. + virtual void disconnect(); + + //! Re-connect a player. + virtual void reconnect(Connection::p c); }; typedef std::vector<Client> Clients; class ClientDumb : public ClientBase { public: + virtual unsigned int id(); + virtual std::string nick(); virtual void game_start(boost::function<void ()> callback, std::vector<std::string> players); |