- Small but very important fix
- Create a structure to store global server options
--- 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 ""