gameServer/OfficialServer/DBInteraction.hs
changeset 1834 71cb978dc85f
parent 1833 e901ec5644b4
child 1839 5dd4cb7fd7e5
--- a/gameServer/OfficialServer/DBInteraction.hs	Mon Feb 23 20:25:07 2009 +0000
+++ b/gameServer/OfficialServer/DBInteraction.hs	Mon Feb 23 20:34:29 2009 +0000
@@ -10,13 +10,19 @@
 import Control.Concurrent
 import Control.Exception
 import Monad
+import Maybe
 ------------------------
 import CoreTypes
 
 dbInteractionLoop queries dbConn = do
 	q <- readChan queries
 	case q of
-		HasRegistered queryStr -> putStrLn queryStr
+		HasRegistered name -> do
+			statement <- prepare dbConn "SELECT uid FROM users WHERE name=?"
+			execute statement [SqlString name]
+			uid <- fetchRow statement
+			finish statement
+			putStrLn (show $ isJust uid)
 		CheckPassword queryStr -> putStrLn queryStr
 
 	dbInteractionLoop queries dbConn