summaryrefslogtreecommitdiff
path: root/server/client.cpp
diff options
context:
space:
mode:
authorOle Daniel Evensen <ole_daniel_evensen@hotmail.com>2010-12-06 19:30:28 +0100
committerOle Daniel Evensen <ole_daniel_evensen@hotmail.com>2010-12-06 19:30:28 +0100
commitb140aca7ab3ce6d312bc147a82dcf016af72eafd (patch)
treefc5437344c4e6a02b102d6290bb1a43c70d5d575 /server/client.cpp
parentaead77e8995cba92515c10944ff6e37d68916575 (diff)
some preliminary code and structure for dis-connection and re-connection.
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";
}