diff options
Diffstat (limited to 'src/core/gameserver.cc')
-rw-r--r-- | src/core/gameserver.cc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc index 796b99f..1e2c9e9 100644 --- a/src/core/gameserver.cc +++ b/src/core/gameserver.cc @@ -407,7 +407,7 @@ void GameServer::broadcast(const Message::Channel channel, const std::string tex if (!text.size()) return; - for (Players::iterator it = players().begin(); it != players().end(); it++) { + for (Players::iterator it = players().begin(); it != players().end(); ++it) { Player *player = (*it); NetClient *client = player->client(); if (player != ignore_player) { @@ -441,7 +441,7 @@ void GameServer::broadcast(Zone *zone, std::string const text, Player *ignore_pl if (!text.size()) return; - for (Players::iterator it = players().begin(); it != players().end(); it++) { + for (Players::iterator it = players().begin(); it != players().end(); ++it) { Player *player = (*it); if ((player->zone() == zone) && (player != ignore_player)) { Player *player = (*it); @@ -464,7 +464,7 @@ void GameServer::broadcast_sound(const std::string name, Player *ignore_player) if (!name.size()) return; - for (Players::iterator it = players().begin(); it != players().end(); it++) { + for (Players::iterator it = players().begin(); it != players().end(); ++it) { Player *player = (*it); if (player != ignore_player) { Player *player = (*it); @@ -528,7 +528,8 @@ void GameServer::player_connect(Player *player) return; } - player->player_id = server_maxplayerid++; + player->player_id = server_maxplayerid; + server_maxplayerid++; // notify the game module server_module->player_connect(player); @@ -555,7 +556,7 @@ void GameServer::player_disconnect(Player *player) // manage player list std::list<Player *>:: iterator it = game_players.begin(); while ((it != game_players.end()) && ((*it)->id() != player->id())) { - it++; + ++it; } if (it != game_players.end()) { game_players.erase(it); @@ -615,14 +616,14 @@ void GameServer::frame(const unsigned long timestamp) Physics::frame(elapsed); // reset zone keepalive state - for (Zone::Registry::iterator zit = Zone::registry().begin(); zit != Zone::registry().end(); zit++) { + for (Zone::Registry::iterator zit = Zone::registry().begin(); zit != Zone::registry().end(); ++zit) { Zone *zone= (*zit).second; zone->set_keepalive_run(false); } // run entity game frames - for (Entity::Registry::iterator it = Entity::registry().begin(); it != Entity::registry().end(); it++) { + for (Entity::Registry::iterator it = Entity::registry().begin(); it != Entity::registry().end(); ++it) { Entity *entity = (*it).second; entity->frame(elapsed); @@ -630,7 +631,7 @@ void GameServer::frame(const unsigned long timestamp) } // expand zone keepalive bounding box - for (Zone::Registry::iterator zit = Zone::registry().begin(); zit != Zone::registry().end(); zit++) { + for (Zone::Registry::iterator zit = Zone::registry().begin(); zit != Zone::registry().end(); ++zit) { Zone *zone= (*zit).second; if (zone->keepalive_run()) { zone->keepalive_box().expand(range::fxdistance * 0.5f); @@ -638,7 +639,7 @@ void GameServer::frame(const unsigned long timestamp) } // run upkeep frames - for (Entity::Registry::iterator it = Entity::registry().begin(); it != Entity::registry().end(); it++) { + for (Entity::Registry::iterator it = Entity::registry().begin(); it != Entity::registry().end(); ++it) { Entity *entity = (*it).second; Zone *zone = entity->zone(); if (zone && entity->has_flag(Entity::KeepAlive)) { @@ -666,7 +667,7 @@ void GameServer::frame(const unsigned long timestamp) } // engine state updates for each player - for (std::list<Player *>::iterator it = game_players.begin(); it != game_players.end(); it++) { + for (std::list<Player *>::iterator it = game_players.begin(); it != game_players.end(); ++it) { Player *player = (*it); Entity *view = player->view(); EntityControlable *control = player->control(); @@ -754,7 +755,7 @@ void GameServer::save_config() ofs << "# this file is automaticly generated" << std::endl; ofs << std::endl; - for (Cvar::Registry::iterator it = Cvar::registry().begin(); it != Cvar::registry().end(); it++) { + for (Cvar::Registry::iterator it = Cvar::registry().begin(); it != Cvar::registry().end(); ++it) { if ((((*it).second->flags() & Cvar::Archive) == Cvar::Archive) && (((*it).second->flags() & Cvar::Game) == Cvar::Game)) { ofs << "# " << (*it).first << " " << (*it).second->info() << std::endl; ofs << "set " << (*it).first << " " << (*it).second->str() << std::endl; |