[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src/server game.cpp
From: |
Jon Daniel |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src/server game.cpp |
Date: |
Tue, 08 Feb 2005 06:42:13 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Jon Daniel <address@hidden> 05/02/08 11:42:12
Modified files:
src/server : game.cpp
Log message:
Fixed bug #11809 which causes observers not to see observers who have
joined before them in the top right report.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/server/game.cpp.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
Patches:
Index: wesnoth/src/server/game.cpp
diff -u wesnoth/src/server/game.cpp:1.26 wesnoth/src/server/game.cpp:1.27
--- wesnoth/src/server/game.cpp:1.26 Sun Feb 6 10:40:13 2005
+++ wesnoth/src/server/game.cpp Tue Feb 8 11:42:12 2005
@@ -339,17 +339,30 @@
return;
}
- const player_map::const_iterator info =
player_info_->find(player);
+ player_map::const_iterator info = player_info_->find(player);
if(info != player_info_->end()) {
config observer_join;
observer_join.add_child("observer").values["name"] =
info->second.name();
- send_data(observer_join);
+ //send observer join to everyone except player
+ send_data(observer_join, player);
}
//tell this player that the game has started
config cfg;
cfg.add_child("start_game");
- network::queue_data(cfg,player);
+ network::queue_data(cfg, player);
+
+ //send observer join of all the observers in the game to player
+ for(std::vector<network::connection>::const_iterator pl =
players_.begin()+1; pl != players_.end(); ++pl) {
+ if(sides_.count(*pl) == 0) {
+ info = player_info_->find(*pl);
+ if(info != player_info_->end()) {
+ cfg.clear();
+
cfg.add_child("observer").values["name"] = info->second.name();
+ network::queue_data(cfg, player);
+ }
+ }
+ }
}
//if the player is already in the game, don't add them.