diff options
Diffstat (limited to 'server/client.cpp')
-rw-r--r-- | server/client.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/server/client.cpp b/server/client.cpp index 533f6ee..465da3b 100644 --- a/server/client.cpp +++ b/server/client.cpp @@ -60,7 +60,7 @@ void Client::handle_action(Message::p msg, boost::function<void (Action)> action if(possible_actions.contains(action_msg->action)) { action_callback(action_msg->action); } else { - action_callback(possible_actions[0]); + action_callback(possible_actions.back()); } } @@ -68,13 +68,12 @@ std::string Client::nick() { return nick_; } -void Client::game_start(boost::function<void ()> callback, std::vector<Client::p> players) { +void Client::game_start(boost::function<void ()> callback, std::vector<std::string> players) { Message::GameStart::p msg = make_shared<Message::GameStart>(); - for(std::vector<Client::p>::iterator i = players.begin(); i != players.end(); i++) { - msg->players.push_back((*i)->nick()); - } - msg->player_id = id; + msg->players = players; + + msg->player_id = 0; connection->send(msg); @@ -96,7 +95,3 @@ void Client::round_end() { void Client::get_action(boost::function<void (Action)> callback, Actions expected_actions) { connection->recv(boost::bind(&Client::handle_action, shared_from_this(), _1, callback, expected_actions)); } - -void Client::kill_action() { - -} |