diff options
author | Stijn Buys <ingar@osirion.org> | 2009-06-28 18:44:27 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-06-28 18:44:27 +0000 |
commit | cb30a59798dc78f2e67627befefb7810e48cbfb1 (patch) | |
tree | 0b71ee50098ce7b1ccca10f798f39358c45f16bc | |
parent | 16ba873bd12d8748fdc8a5169f4b76867ec50a3c (diff) |
correct a bug in "pif" server messages
-rw-r--r-- | src/core/netserver.cc | 10 | ||||
-rw-r--r-- | src/core/player.cc | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/core/netserver.cc b/src/core/netserver.cc index 5b3a991..73aa73d 100644 --- a/src/core/netserver.cc +++ b/src/core/netserver.cc @@ -291,6 +291,13 @@ void NetServer::client_initialize(NetClient *client) { send_zone_update(client, (*it).second); } + // send player list + for (GameInterface::Players::iterator it = server()->players().begin(); it != server()->players().end(); it++) { + if (((*it)->id() != client->player()->id())) { + send_player_update(client, (*it)); + } + } + // send connect completed std::string connect("connect\n"); client->send_raw(connect); @@ -511,6 +518,7 @@ void NetServer::send_zone_update(NetClient *client, Zone *zone) client->send_raw(msg.str()); } + // send a "pif" update player information to a single player void NetServer::send_player_update(NetClient *client) { @@ -526,7 +534,7 @@ void NetServer::send_player_update(NetClient *client, Player *player) { std::ostringstream msg; msg << "pif " << player->id() << ' '; - client->player()->serialize_server_update(msg); + player->serialize_server_update(msg); msg << '\n'; client->send_raw(msg.str()); } diff --git a/src/core/player.cc b/src/core/player.cc index 6385992..9a3ec9b 100644 --- a/src/core/player.cc +++ b/src/core/player.cc @@ -17,7 +17,6 @@ namespace core Player::Player() { - player_control = 0; clear(); } |