gameServer/Actions.hs
changeset 3283 18ee933a5864
parent 2948 3f21a9dc93d0
child 3425 ead2ed20dfd4
--- a/gameServer/Actions.hs	Sat Apr 03 08:46:01 2010 +0000
+++ b/gameServer/Actions.hs	Sat Apr 03 08:47:06 2010 +0000
@@ -22,6 +22,7 @@
     | AnswerSameClan [String]
     | AnswerLobby [String]
     | SendServerMessage
+    | SendServerVars
     | RoomAddThisClient Int -- roomID
     | RoomRemoveThisClient String
     | RemoveTeam String
@@ -118,10 +119,21 @@
     return (clID, serverInfo, clients, rooms)
     where
         client = clients ! clID
-        message = if clientProto client < 29 then
-            serverMessageForOldVersions
+        message si = if clientProto client < latestReleaseVersion si then
+            serverMessageForOldVersions si
             else
-            serverMessage
+            serverMessage si
+
+processAction (clID, serverInfo, clients, rooms) SendServerVars = do
+    writeChan (sendChan $ clients ! clID) ("SERVER_VARS" : vars)
+    return (clID, serverInfo, clients, rooms)
+    where
+        client = clients ! clID
+        vars = [
+            "MOTD_NEW", serverMessage serverInfo, 
+            "MOTD_OLD", serverMessageForOldVersions serverInfo, 
+            "LATEST_PROTO", show $ latestReleaseVersion serverInfo
+            ]
 
 
 processAction (clID, serverInfo, clients, rooms) (ProtocolError msg) = do