summaryrefslogtreecommitdiff
path: root/server/client.cpp
diff options
context:
space:
mode:
authorAtle Hellvik Havsø <atle@havso.net>2010-12-14 23:28:19 +0100
committerAtle Hellvik Havsø <atle@havso.net>2010-12-14 23:28:19 +0100
commitb28b3c5b8ddb6d73c1e7745d15ea328326a544f9 (patch)
tree4f6d2ffa1a0e41200f7606fbe233151226b2a01d /server/client.cpp
parentd4e406b161376f8f7d195fbc5851c5d6751a01af (diff)
Made server send GameEnd.
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();
+}