summaryrefslogtreecommitdiff
path: root/server/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server/client.cpp')
-rw-r--r--server/client.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/server/client.cpp b/server/client.cpp
index 0d0b0ba..329da82 100644
--- a/server/client.cpp
+++ b/server/client.cpp
@@ -12,6 +12,16 @@ Client::Client(Connection::p c) : connection(c), timer(c->socket.get_io_service(
}
+void Client::disconnect() {
+ //delete connection;
+ //connection = NULL;
+ //We need to make this player dumb?
+}
+
+void Client::reconnect(Connection::p c) {
+ connection = c;
+}
+
void Client::start(boost::function<void (Client::p)> f) {
// Send Hello.
connection->send(make_shared<Message::Hello>("aotenjoud git"));
@@ -84,6 +94,10 @@ void Client::lobby_status(const std::vector<std::string>& game_modes, boost::fun
connection->recv(boost::bind(&Client::handle_lobby, shared_from_this(), _1, callback));
}
+unsigned int Client::id() {
+ return id_;
+}
+
std::string Client::nick() {
return nick_;
}
@@ -121,6 +135,10 @@ 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));
}
+unsigned int ClientDumb::id() {
+ return 0;
+}
+
std::string ClientDumb::nick() {
return "CPU";
}