diff options
author | Stijn Buys <ingar@osirion.org> | 2009-01-25 11:57:03 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-01-25 11:57:03 +0000 |
commit | cc88902f93645b4284805f51cd7eba8b513ed5f3 (patch) | |
tree | 6dc0d22f16ed672a1b3e979f5a3814495f7c3a21 /src/core/player.cc | |
parent | 6844f88a70a7b746b74696e80a21d9b8f740afcb (diff) |
bump network protocol version to 15,
fix player level initialization,
exchange player list, credits, level, ping
Diffstat (limited to 'src/core/player.cc')
-rw-r--r-- | src/core/player.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/player.cc b/src/core/player.cc index ad6641e..a642371 100644 --- a/src/core/player.cc +++ b/src/core/player.cc @@ -41,6 +41,7 @@ void Player::clear() player_control = 0; player_ping = 0; + player_level = 1; } @@ -207,7 +208,10 @@ void Player::serialize_server_update(std::ostream & os) const << view_id << " " << control_id << " " << mission_id << " " - << player_color << " "; + << player_color << " " + << player_credits << " " + << player_level << " " + << player_ping; } void Player::receive_server_update(std::istream &is) @@ -217,7 +221,7 @@ void Player::receive_server_update(std::istream &is) if (!player_id) { player_id = id; } else if (player_id != id) { - con_warn << "received inconsistent player update for player " << id << "\n"; + con_warn << "received inconsistent update for player " << id << "\n"; return; } @@ -254,6 +258,10 @@ void Player::receive_server_update(std::istream &is) player_mission_target = 0; } is >> player_color; + is >> player_credits; + is >> player_level; + + is >> player_ping; /* std::string n; |