gameServer/ServerCore.hs
changeset 2184 f59f80e034b1
parent 2173 98cde8645e21
child 2349 ba7a0813c532
--- a/gameServer/ServerCore.hs	Sun Jun 21 17:48:05 2009 +0000
+++ b/gameServer/ServerCore.hs	Sun Jun 21 18:00:43 2009 +0000
@@ -17,10 +17,7 @@
 
 
 timerLoop :: Int -> Chan CoreMessage -> IO()
-timerLoop tick messagesChan = do
-	threadDelay (30 * 10^6) -- 30 seconds
-	writeChan messagesChan $ TimerAction tick
-	timerLoop (tick + 1) messagesChan
+timerLoop tick messagesChan = threadDelay (30 * 10^6) >> (writeChan messagesChan $ TimerAction tick) >> timerLoop (tick + 1) messagesChan
 
 firstAway (_, a, b, c) = (a, b, c)
 
@@ -85,4 +82,6 @@
 
 	startDBConnection $ serverInfo
 
-	mainLoop serverInfo IntMap.empty (IntMap.singleton 0 newRoom)
+	forkIO $ mainLoop serverInfo IntMap.empty (IntMap.singleton 0 newRoom)
+
+	forever $ threadDelay (60 * 60 * 10^6) >> putStrLn "***"
\ No newline at end of file