gameServer/ConfigFile.hs
changeset 4992 408301a9d2d6
parent 4990 4b5d62ac01f7
child 5009 12135f659bf1
--- a/gameServer/ConfigFile.hs	Tue Mar 08 21:27:44 2011 +0300
+++ b/gameServer/ConfigFile.hs	Tue Mar 08 21:45:00 2011 +0300
@@ -7,8 +7,11 @@
 -------------------
 import CoreTypes
 
+cfgFileName :: String
 cfgFileName = "hedgewars-server.ini"
 
+
+readServerConfig :: ServerInfo -> IO ServerInfo
 readServerConfig serverInfo' = do
     cfg <- readConfig cfgFileName
     let si = serverInfo'{
@@ -28,6 +31,7 @@
         fromJust2 _ (Just a) = a
 
 
+writeServerConfig :: ServerInfo -> IO ()
 writeServerConfig ServerInfo{serverConfig = Nothing} = return ()
 writeServerConfig ServerInfo{
     dbHost = dh,
@@ -40,7 +44,7 @@
     serverConfig = Just cfg}
         = do
     let newCfg = foldl (\c (n, v) -> repConfig n (B.unpack v) c) cfg entries
-    writeConfig cfgFileName (repConfig "sv_latestProto" (show ver) cfg)
+    writeConfig cfgFileName (repConfig "sv_latestProto" (show ver) newCfg)
     where
         entries = [
             ("dbHost", dh)