oops, fix incorrect room owner name in ROOM UPD command again
authorunc0rr
Fri, 02 Nov 2012 10:17:52 +0400
changeset 7926 550083f61a0e
parent 7924 351f970c60e1
child 7928 88fde28bbda6
child 7929 6e01c5134eb5
oops, fix incorrect room owner name in ROOM UPD command again
gameServer/Actions.hs
--- a/gameServer/Actions.hs	Fri Nov 02 10:07:30 2012 +0400
+++ b/gameServer/Actions.hs	Fri Nov 02 10:17:52 2012 +0400
@@ -255,7 +255,7 @@
     proto <- client's clientProto
     ri <- clientRoomA
     rnc <- gets roomsClients
-    newMasterId <- liftM (head . filter (/= ci)) . io $ roomClientsIndicesM rnc ri
+    newMasterId <- liftM (last . filter (/= ci)) . io $ roomClientsIndicesM rnc ri
     newMaster <- io $ client'sM rnc id newMasterId
     oldRoomName <- io $ room'sM rnc name ri
     oldMaster <- client's nick
@@ -326,8 +326,8 @@
     rnc <- gets roomsClients
     ri <- io $ clientRoomM rnc clId
     rm <- io $ room'sM rnc id ri
+    n <- io $ client'sM rnc nick (masterID rm)
     chans <- liftM (map sendChan) $! sameProtoClientsS proto
-    n <- client's nick
     processAction $ AnswerClients chans ("ROOM" : "UPD" : name rm : roomInfo n rm)