[Wesnoth-commits] r10035 - /trunk/src/server/server.cpp (February 10, 2006 - 00:00)

Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Headers

 

Author: xan
Date: Thu Feb  9 23:59:36 2006
New Revision: 10035

URL: http://svn.gna.org/viewcvs/wesnoth?rev=10035&view=rev
Log:
Show a message when a player leaves a game.

Modified:
    trunk/src/server/server.cpp

Modified: trunk/src/server/server.cpp
URL: http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/server.cpp?rev=10035&r1=10034&r2=10035&view=diff
==============================================================================
--- trunk/src/server/server.cpp (original)
+++ trunk/src/server/server.cpp Thu Feb  9 23:59:36 2006
@@ -985,6 +985,7 @@
 			lobby_players_.send_data(sync_initial_response());
 		} else {
 
+			bool obs = g->is_observer(sock);
 			g->remove_player(sock);
 			g->describe_slots();
 			lobby_players_.add_player(sock);
@@ -992,11 +993,15 @@
 			//mark the player as available in the lobby
 			const player_map::iterator pl = players_.find(sock);
 			if(pl != players_.end()) {
+				if(!obs) {
+					const config& msg = construct_server_message(pl->second.name() + " has left the game",*g);
+					g->send_data(msg);
+				}
 				pl->second.mark_available(true,"");
 			} else {
 				std::cerr << "ERROR: Could not find player in map\n";
 			}
-
+			
 			//send the player who has quit the game list
 			network::send_data(initial_response_,sock);
 



Related Mails




Powered by MHonArc, Updated Fri Feb 10 12:20:16 2006