diff options
-rw-r--r-- | server.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); + } } |