Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-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();
}