- Small but very important fix
authorunc0rr
Mon, 20 Oct 2008 12:58:16 +0000
changeset 1382 b6ab9fea22fe
parent 1381 e9754d1d61a9
child 1383 d20e6e8928e3
- Small but very important fix - Create a structure to store global server options
hedgewars.kdevelop
netserver/Miscutils.hs
netserver/hedgewars-server.hs
--- a/hedgewars.kdevelop	Sat Oct 18 21:47:28 2008 +0000
+++ b/hedgewars.kdevelop	Mon Oct 20 12:58:16 2008 +0000
@@ -49,6 +49,7 @@
       <filetype>*.inc</filetype>
       <filetype>*.dpr</filetype>
       <filetype>*.hs</filetype>
+      <filetype>*.pro</filetype>
     </filetypes>
     <blacklist/>
     <general>
--- a/netserver/Miscutils.hs	Sat Oct 18 21:47:28 2008 +0000
+++ b/netserver/Miscutils.hs	Mon Oct 20 12:58:16 2008 +0000
@@ -51,6 +51,13 @@
 	}
 createRoom = (RoomInfo "" "" 0 [] "+rnd+" False Map.empty)
 
+data GlobalInfo =
+	GlobalInfo
+	{
+		isDedicated :: Bool,
+		serverMessage :: String
+	}
+
 type ClientsTransform = [ClientInfo] -> [ClientInfo]
 type RoomsTransform = [RoomInfo] -> [RoomInfo]
 type HandlesSelector = ClientInfo -> [ClientInfo] -> [RoomInfo] -> [Handle]
--- a/netserver/hedgewars-server.hs	Sat Oct 18 21:47:28 2008 +0000
+++ b/netserver/hedgewars-server.hs	Mon Oct 20 12:58:16 2008 +0000
@@ -47,7 +47,7 @@
 	unless (null recipients) $ putStrLn ("< " ++ (show answer))
 
 	clHandles' <- forM recipients $
-		\ch -> Control.Exception.handle (\e -> putStrLn (show e) >> hClose ch >> return [ch]) $
+		\ch -> Control.Exception.handle (\e -> putStrLn (show e) >> hClose ch >> return []) $ -- cannot just remove
 			do
 			forM_ answer (\str -> hPutStrLn ch str)
 			hPutStrLn ch ""