--- a/gameServer/Opts.hs Mon Feb 23 19:01:36 2009 +0000
+++ b/gameServer/Opts.hs Mon Feb 23 20:15:02 2009 +0000
@@ -14,10 +14,17 @@
options = [
Option ['p'] ["port"] (ReqArg readListenPort "PORT") "listen on PORT",
Option ['d'] ["dedicated"] (ReqArg readDedicated "BOOL") "start as dedicated (True or False)",
- Option [] ["password"] (ReqArg readPassword "STRING") "admin password"
+ Option [] ["db-login"] (ReqArg readDbLogin "STRING") "database access login",
+ Option [] ["db-password"] (ReqArg readDbPassword "STRING") "database access password",
+ Option [] ["db-host"] (ReqArg readDbHost "STRING") "database host"
]
-readListenPort, readDedicated, readPassword :: String -> ServerInfo -> ServerInfo
+readListenPort,
+ readDedicated,
+ readDbLogin,
+ readDbPassword,
+ readDbHost :: String -> ServerInfo -> ServerInfo
+
readListenPort str opts = opts{listenPort = readPort}
where
readPort = fromInteger $ fromMaybe 46631 (maybeRead str :: Maybe Integer)
@@ -26,7 +33,9 @@
where
readDedicated = fromMaybe True (maybeRead str :: Maybe Bool)
-readPassword str opts = opts{adminPassword = str}
+readDbLogin str opts = opts{dbLogin = str}
+readDbPassword str opts = opts{dbPassword = str}
+readDbHost str opts = opts{dbHost = str}
getOpts :: ServerInfo -> IO ServerInfo
getOpts opts = do