netserver/HWProto.hs
changeset 1083 3448dd03483f
parent 1082 596b1dcdc1df
child 1302 4290ba4a14ca
equal deleted inserted replaced
1082:596b1dcdc1df 1083:3448dd03483f
    56 
    56 
    57 handleCmd_noRoom client _ rooms ["CREATE", newRoom, roomPassword] =
    57 handleCmd_noRoom client _ rooms ["CREATE", newRoom, roomPassword] =
    58 	if haveSameRoom then
    58 	if haveSameRoom then
    59 		(noChangeClients, noChangeRooms, clientOnly, ["WARNING", "There's already a room with that name"])
    59 		(noChangeClients, noChangeRooms, clientOnly, ["WARNING", "There's already a room with that name"])
    60 	else
    60 	else
    61 		(modifyClient client{room = newRoom, isMaster = True}, addRoom (RoomInfo newRoom roomPassword), clientOnly, ["JOINED", nick client])
    61 		(modifyClient client{room = newRoom, isMaster = True}, addRoom (RoomInfo newRoom roomPassword []), clientOnly, ["JOINED", nick client])
    62 	where
    62 	where
    63 		haveSameRoom = not . null $ filter (\room -> newRoom == name room) rooms
    63 		haveSameRoom = not . null $ filter (\room -> newRoom == name room) rooms
    64 
    64 
    65 handleCmd_noRoom client clients rooms ["CREATE", newRoom] =
    65 handleCmd_noRoom client clients rooms ["CREATE", newRoom] =
    66 	handleCmd_noRoom client clients rooms ["CREATE", newRoom, ""]
    66 	handleCmd_noRoom client clients rooms ["CREATE", newRoom, ""]
    83 -- 'inRoom' clients state command handlers
    83 -- 'inRoom' clients state command handlers
    84 handleCmd_inRoom :: CmdHandler
    84 handleCmd_inRoom :: CmdHandler
    85 
    85 
    86 handleCmd_inRoom client _ _ ["CHAT_STRING", _, msg] = (noChangeClients, noChangeRooms, othersInRoom, ["CHAT_STRING", nick client, msg])
    86 handleCmd_inRoom client _ _ ["CHAT_STRING", _, msg] = (noChangeClients, noChangeRooms, othersInRoom, ["CHAT_STRING", nick client, msg])
    87 
    87 
    88 handleCmd_inRoom client clients rooms ["CONFIG_PARAM", paramName, value] = (noChangeClients, noChangeRooms, othersInRoom, ["CONFIG_PARAM", paramName, value])
    88 handleCmd_inRoom client clients rooms ["CONFIG_PARAM", paramName, value] =
       
    89 	(noChangeClients, noChangeRooms, othersInRoom, ["CONFIG_PARAM", paramName, value])
       
    90 
       
    91 handleCmd_inRoom client clients rooms ["CONFIG_PARAM", paramName, value1, value2] =
       
    92 	(noChangeClients, noChangeRooms, othersInRoom, ["CONFIG_PARAM", paramName, value1, value2])
       
    93 
       
    94 handleCmd_inRoom client clients rooms ["ADDTEAM:", teamName, teamColor, graveName, fortName, teamLevel, hh0, hh1, hh2, hh3, hh4, hh5, hh6, hh7] =
       
    95 	(noChangeClients, noChangeRooms, othersInRoom, ["TEAM_ACCEPTED", "1", teamName])
    89 
    96 
    90 handleCmd_inRoom _ _ _ _ = (noChangeClients, noChangeRooms, clientOnly, badCmd)
    97 handleCmd_inRoom _ _ _ _ = (noChangeClients, noChangeRooms, clientOnly, badCmd)