# HG changeset patch
# User unc0rr
# Date 1224507496 0
# Node ID b6ab9fea22fe3e0e4a80acd18021c9f5c8ced7ed
# Parent e9754d1d61a99571dd78fe243e7510213e72e14c
- Small but very important fix
- Create a structure to store global server options
diff -r e9754d1d61a9 -r b6ab9fea22fe hedgewars.kdevelop
--- 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 @@
*.inc
*.dpr
*.hs
+ *.pro
diff -r e9754d1d61a9 -r b6ab9fea22fe netserver/Miscutils.hs
--- 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]
diff -r e9754d1d61a9 -r b6ab9fea22fe netserver/hedgewars-server.hs
--- 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 ""