Send server message on join
authorunc0rr
Thu, 26 Mar 2009 19:28:56 +0000
changeset 1923 956b6b3529bc
parent 1922 88cdabb51995
child 1924 8f8fe856ce9d
Send server message on join
gameServer/Actions.hs
--- a/gameServer/Actions.hs	Thu Mar 26 19:22:40 2009 +0000
+++ b/gameServer/Actions.hs	Thu Mar 26 19:28:56 2009 +0000
@@ -18,6 +18,7 @@
 	| AnswerThisRoom [String]
 	| AnswerOthersInRoom [String]
 	| AnswerLobby [String]
+	| SendServerMessage
 	| RoomAddThisClient Int -- roomID
 	| RoomRemoveThisClient
 	| RemoveTeam String
@@ -89,6 +90,11 @@
 		room = rooms ! 0
 
 
+processAction (clID, serverInfo, clients, rooms) SendServerMessage = do
+	writeChan (sendChan $ clients ! clID) $ ["SERVER_MESSAGE", serverMessage serverInfo]
+	return (clID, serverInfo, clients, rooms)
+
+
 processAction (clID, serverInfo, clients, rooms) (ProtocolError msg) = do
 	writeChan (sendChan $ clients ! clID) ["ERROR", msg]
 	return (clID, serverInfo, clients, rooms)
@@ -264,6 +270,7 @@
 
 
 processAction (clID, serverInfo, clients, rooms) (ProcessAccountInfo info) = do
+	processAction (clID, serverInfo, clients, rooms) SendServerMessage
 	case info of
 		HasAccount passwd isAdmin -> do
 			infoM "Clients" $ show clID ++ " has account"