From 93763b9327c6b11016d1b20ea2bb7882f915e33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atle=20Hellvik=20Havs=C3=B8?= Date: Sat, 20 Nov 2010 13:35:37 +0100 Subject: Made the Player class have a ID (That gets set during a game) which they add to the Action-message. So we can keep track of which player did what action. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Atle Hellvik Havsø --- server/player.cpp | 1 + server/player.h | 3 +++ 2 files changed, 4 insertions(+) (limited to 'server') diff --git a/server/player.cpp b/server/player.cpp index cb84c9a..72ab99b 100644 --- a/server/player.cpp +++ b/server/player.cpp @@ -56,6 +56,7 @@ void Player::handle_action(Message::p msg) { Message::RoundAction::p action_msg = dynamic_pointer_cast(msg); + action_msg->action.player = id; action_callback(action_msg->action); } diff --git a/server/player.h b/server/player.h index ce37d0a..27b2757 100644 --- a/server/player.h +++ b/server/player.h @@ -41,6 +41,9 @@ class Player : public boost::enable_shared_from_this { void handle_action(Message::p msg); public: + //! The ID of the player + int id; + //! Return player's nick. std::string nick(); -- cgit v1.2.3