diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-15 12:28:19 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-15 12:28:19 +0100 |
commit | b2527a9eaa7082c50ce6230e79df88edbced9abb (patch) | |
tree | ee6ab3ddc487600690f16b48137a97c72c396218 /server/player.h | |
parent | 2c6d82abe3c82041991066ca84ac067771756818 (diff) |
Implement server program flow around GameStart.
Diffstat (limited to 'server/player.h')
-rw-r--r-- | server/player.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/server/player.h b/server/player.h index 17e8989..667d6ea 100644 --- a/server/player.h +++ b/server/player.h @@ -5,6 +5,7 @@ #include <boost/shared_ptr.hpp> #include <boost/enable_shared_from_this.hpp> #include <boost/function.hpp> +#include <boost/asio.hpp> #include "connection.h" @@ -17,7 +18,11 @@ class Player : public boost::enable_shared_from_this<Player> { private: Connection::p connection; + boost::asio::deadline_timer timer; + boost::function<void (Player::p)> lobby_callback; + boost::function<void ()> ready_callback; + std::string nick_; @@ -26,15 +31,18 @@ class Player : public boost::enable_shared_from_this<Player> { //! Start communicating. void start(); - //! Handle login. + //! Handle Login-message. void handle_login(Message::p msg); + //! Handle Ready-message. + void handle_ready(Message::p msg); + public: //! Return player's nick. std::string nick(); //! Notify client of a game start. - void game_start(); + void game_start(boost::function<void ()> callback, std::vector<Player::p> players); }; #endif |