summaryrefslogtreecommitdiff
path: root/server/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server/client.cpp')
-rw-r--r--server/client.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/server/client.cpp b/server/client.cpp
index 345e3a3..3573128 100644
--- a/server/client.cpp
+++ b/server/client.cpp
@@ -152,6 +152,14 @@ void Client::get_action(boost::function<void (Action)> callback, Actions expecte
connection->recv(boost::bind(&Client::handle_action, shared_from_this(), _1, callback, expected_actions));
}
+void Client::game_end(Message::GameEnd::p msg, boost::function<void ()> callback) {
+ connection->send(msg);
+
+ if(callback) {
+ connection->recv(boost::bind(&Client::handle_ready, shared_from_this(), _1, callback));
+ }
+}
+
unsigned int ClientDumb::id() {
return 0;
}
@@ -173,9 +181,13 @@ void ClientDumb::round_state(const PlayerState& pl_d, const PlayerState& pl_r, c
}
void ClientDumb::round_end(Message::RoundEnd::p msg, boost::function<void ()> callback) {
- callback();
+ if(callback) callback();
}
void ClientDumb::get_action(boost::function<void (Action)> callback, Actions expected_actions) {
callback(expected_actions.back());
}
+
+void ClientDumb::game_end(Message::GameEnd::p msg, boost::function<void ()> callback) {
+ callback();
+}