Inform room of quitting members
authorunc0rr
Thu, 08 Jan 2009 13:02:40 +0000
changeset 1596 4a7b9e451cb4
parent 1595 33529f567d2d
child 1597 24f2f9fa0160
Inform room of quitting members
doc/Release.txt
netserver/HWProto.hs
--- a/doc/Release.txt	Thu Jan 08 13:00:54 2009 +0000
+++ b/doc/Release.txt	Thu Jan 08 13:02:40 2009 +0000
@@ -1,8 +1,10 @@
-1. Check copyright headers
-2. Changelog
-3. Make a branch
-4. Make packages
-5. Test packages
-6. Upload (hedgewars.org, fireforge.net, gna.org)
-7. Post news (hedgewars.org, fireforge.net, gna.org, etc.)
-8. Make tag (svn copy svn+ssh://unc0rr@svn.fireforge.net/svnroot/hedgewars/branches/0.9.7 svn+ssh://unc0rr@svn.fireforge.net/svnroot/hedgewars/tags/0.9.7 -m "Tag for 0.9.7 release")
\ No newline at end of file
+1. Fix broken trainings/missions
+2. Update translations (check fireforge for patches)
+3. Check copyright headers
+4. Changelog
+5. Make a branch
+6. Make packages
+7. Test packages
+8. Upload (hedgewars.org, fireforge.net, gna.org)
+9. Post news (hedgewars.org, fireforge.net, gna.org, etc.)
+10. Make tag (svn copy svn+ssh://unc0rr@svn.fireforge.net/svnroot/hedgewars/branches/0.9.7 svn+ssh://unc0rr@svn.fireforge.net/svnroot/hedgewars/tags/0.9.7 -m "Tag for 0.9.7 release")
\ No newline at end of file
--- a/netserver/HWProto.hs	Thu Jan 08 13:00:54 2009 +0000
+++ b/netserver/HWProto.hs	Thu Jan 08 13:02:40 2009 +0000
@@ -21,6 +21,7 @@
 answerClientOnly  = makeAnswer clientOnly
 answerOthersRoom  = makeAnswer othersInRoom
 answerSameRoom    = makeAnswer sameRoom
+answerFromRoom roomName = makeAnswer (fromRoom roomName)
 answerSameProtoLobby = makeAnswer sameProtoLobbyClients
 answerAll         = makeAnswer allClients
 
@@ -69,7 +70,7 @@
 		else
 		answerOthersRoom ["LEFT", nick]
 
-answerPartInform nick = answerOthersRoom ["LEFT", nick, "bye room"]
+answerPartInform nick roomName = answerFromRoom roomName ["LEFT", nick, "bye room"]
 answerQuitLobby nick msg =
 	if not $ null nick then
 		if not $ null msg then
@@ -232,7 +233,7 @@
 	else if isRestrictedJoins clRoom then
 		(noChangeClients, noChangeRooms, answerRestricted)
 	else
-		(modifyClient client{room = roomName}, modifyRoom clRoom{playersIn = 1 + playersIn clRoom}, answerNicks ++ answerReady ++ (answerJoined $ nick client) ++ (answerNotReady $ nick client) ++ answerFullConfig clRoom ++ answerAllTeams clRoom ++ watchRound)
+		(modifyClient client{room = roomName}, modifyRoom clRoom{playersIn = 1 + playersIn clRoom}, (answerJoined $ nick client) ++ answerNicks ++ answerReady ++ (answerNotReady $ nick client) ++ answerFullConfig clRoom ++ answerAllTeams clRoom ++ watchRound)
 	where
 		noSuchRoom = isNothing $ find (\room -> roomName == name room && roomProto room == protocol client) rooms
 		answerNicks = answerClientOnly $ ["JOINED"] ++ (map nick $ sameRoomClients)
@@ -271,7 +272,7 @@
 	if isMaster client then
 		(modifyRoomClients clRoom (\cl -> cl{room = [], isReady = False}), removeRoom (room client), (answerAbandoned $ protocol client) ++ (answerRoomDeleted $ room client))
 	else
-		(modifyClient client{room = [], isReady = False}, modifyRoom clRoom{teams = othersTeams, playersIn = (playersIn clRoom) - 1, readyPlayers = newReadyPlayers}, (answerPartInform (nick client)) ++ answerRemoveClientTeams)
+		(modifyClient client{room = [], isReady = False}, modifyRoom clRoom{teams = othersTeams, playersIn = (playersIn clRoom) - 1, readyPlayers = newReadyPlayers}, (answerPartInform (room client) (nick client)) ++ answerRemoveClientTeams)
 	where
 		clRoom = roomByName (room client) rooms
 		answerRemoveClientTeams = concatMap (\tn -> answerOthersRoom ["REMOVE_TEAM", teamname tn]) clientTeams