Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-06-28 18:44:27 +0000
committerStijn Buys <ingar@osirion.org>2009-06-28 18:44:27 +0000
commitcb30a59798dc78f2e67627befefb7810e48cbfb1 (patch)
tree0b71ee50098ce7b1ccca10f798f39358c45f16bc /src
parent16ba873bd12d8748fdc8a5169f4b76867ec50a3c (diff)
correct a bug in "pif" server messages
Diffstat (limited to 'src')
-rw-r--r--src/core/netserver.cc10
-rw-r--r--src/core/player.cc1
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();
}