Add a special message for old hedgewars versions
authorunc0rr
Fri, 10 Apr 2009 19:56:42 +0000
changeset 1953 fd9c8e3c734d
parent 1952 aed76eabb846
child 1954 038c18bc58a1
Add a special message for old hedgewars versions
gameServer/Actions.hs
gameServer/CoreTypes.hs
gameServer/Utils.hs
--- a/gameServer/Actions.hs	Fri Apr 10 19:51:44 2009 +0000
+++ b/gameServer/Actions.hs	Fri Apr 10 19:56:42 2009 +0000
@@ -96,8 +96,14 @@
 
 
 processAction (clID, serverInfo, clients, rooms) SendServerMessage = do
-	writeChan (sendChan $ clients ! clID) $ ["SERVER_MESSAGE", serverMessage serverInfo]
+	writeChan (sendChan $ clients ! clID) $ ["SERVER_MESSAGE", message serverInfo]
 	return (clID, serverInfo, clients, rooms)
+	where
+		client = clients ! clID
+		message = if clientProto client < 25 then
+			serverMessageForOldVersions
+			else
+			serverMessageForOldVersions
 
 
 processAction (clID, serverInfo, clients, rooms) (ProtocolError msg) = do
--- a/gameServer/CoreTypes.hs	Fri Apr 10 19:51:44 2009 +0000
+++ b/gameServer/CoreTypes.hs	Fri Apr 10 19:56:42 2009 +0000
@@ -116,6 +116,7 @@
 	{
 		isDedicated :: Bool,
 		serverMessage :: String,
+		serverMessageForOldVersions :: String,
 		listenPort :: PortNumber,
 		loginsNumber :: Int,
 		nextRoomID :: Int,
@@ -135,6 +136,7 @@
 	ServerInfo
 		True
 		"<h2><p align=center><a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a></p></h2>"
+		"<font color=yellow><h3>Hedgewars 0.9.10 is out! Please, update. Support for previous versions IS DROPPED</h3><p align=center><a href=http://hedgewars.org/download.html>Download page here</a></p><h4>New features are:</h4><ul><li></li><li></li><li></li><li>...</li></ul></font>"
 		46631
 		0
 		0
--- a/gameServer/Utils.hs	Fri Apr 10 19:51:44 2009 +0000
+++ b/gameServer/Utils.hs	Fri Apr 10 19:56:42 2009 +0000
@@ -65,5 +65,6 @@
 protoNumber2ver 23 = "0.9.9"
 protoNumber2ver 24 = "0.9.10-dev"
 protoNumber2ver 25 = "0.9.10"
+protoNumber2ver 26 = "0.9.11-dev"
 protoNumber2ver _ = "Unknown"