summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/server.cpp b/server.cpp
index 88a672d..77956fa 100644
--- a/server.cpp
+++ b/server.cpp
@@ -42,6 +42,8 @@ void Server::handle_connect(Connection::p connection) {
message::Player p2(1, Vector3(5, 50, 5), "b");
p2.send(connection->socket);
+ clients.push_back(connection);
+
async_read(connection);
/*boost::asio::streambuf b;
@@ -124,4 +126,9 @@ void Server::handle_message(Connection::p c) {
m.recv(c->socket);
std::string s = m.get_str();
+
+ for(std::list<Connection::p>::iterator it = clients.begin(); it != clients.end(); it++) {
+ message::Message msg(s);
+ msg.send((*it)->socket);
+ }
}