Remove deprecated statistics MVar
authorunc0rr
Wed, 23 Feb 2011 18:38:11 +0300
changeset 4957 3684faf5b3d1
parent 4955 84543ecae8c3
child 4959 09f4978b4fb0
Remove deprecated statistics MVar
gameServer/CoreTypes.hs
gameServer/Opts.hs
gameServer/hedgewars-server.hs
--- a/gameServer/CoreTypes.hs	Wed Feb 23 18:34:07 2011 +0300
+++ b/gameServer/CoreTypes.hs	Wed Feb 23 18:38:11 2011 +0300
@@ -136,7 +136,6 @@
         dbPassword :: B.ByteString,
         lastLogins :: [(B.ByteString, (UTCTime, B.ByteString))],
         restartPending :: Bool,
-        stats :: TMVar StatisticsInfo,
         coreChan :: Chan CoreMessage,
         dbQueries :: Chan DBQuery
     }
@@ -144,7 +143,7 @@
 instance Show ServerInfo where
     show _ = "Server Info"
 
-newServerInfo :: TMVar StatisticsInfo -> Chan CoreMessage -> Chan DBQuery -> ServerInfo
+newServerInfo :: Chan CoreMessage -> Chan DBQuery -> ServerInfo
 newServerInfo =
     ServerInfo
         True
--- a/gameServer/Opts.hs	Wed Feb 23 18:34:07 2011 +0300
+++ b/gameServer/Opts.hs	Wed Feb 23 18:38:11 2011 +0300
@@ -7,10 +7,6 @@
 import System.Environment
 import System.Console.GetOpt
 import Data.Maybe ( fromMaybe )
-#if defined(OFFICIAL_SERVER)
-import qualified Data.ByteString.Char8 as B
-import Network
-#endif
 -------------------
 import CoreTypes
 import Utils
@@ -23,11 +19,6 @@
 
 readListenPort
     , readDedicated
-#if defined(OFFICIAL_SERVER)
-    , readDbLogin
-    , readDbPassword
-    readDbHost
-#endif
     :: String -> ServerInfo -> ServerInfo
 
 
@@ -39,12 +30,6 @@
     where
         readDed = fromMaybe True (maybeRead str :: Maybe Bool)
 
-#if defined(OFFICIAL_SERVER)
-readDbLogin str opts = opts{dbLogin = B.pack str}
-readDbPassword str opts = opts{dbPassword = B.pack str}
-readDbHost str opts = opts{dbHost = B.pack str}
-#endif
-
 getOpts :: ServerInfo -> IO ServerInfo
 getOpts opts = do
     args <- getArgs
--- a/gameServer/hedgewars-server.hs	Wed Feb 23 18:34:07 2011 +0300
+++ b/gameServer/hedgewars-server.hs	Wed Feb 23 18:38:11 2011 +0300
@@ -4,7 +4,6 @@
 
 import Network.Socket
 import Network.BSD
-import Control.Concurrent.STM
 import Control.Concurrent.Chan
 import qualified Control.Exception as Exception
 import System.Log.Logger
@@ -36,10 +35,9 @@
 
     setupLoggers
 
-    stats' <- atomically $ newTMVar (StatisticsInfo 0 0)
     dbQueriesChan <- newChan
     coreChan' <- newChan
-    serverInfo' <- getOpts $ newServerInfo stats' coreChan' dbQueriesChan
+    serverInfo' <- getOpts $ newServerInfo coreChan' dbQueriesChan
 
 #if defined(OFFICIAL_SERVER)
     dbHost' <- askFromConsole "DB host: "