gameServer/OfficialServer/extdbinterface.hs
changeset 2918 24d6dc579b47
parent 2869 93cc73dcc421
child 2919 70244c730ea0
equal deleted inserted replaced
2917:2f4320a1b31f 2918:24d6dc579b47
    28                 statement <- prepare dbConn dbQueryAccount
    28                 statement <- prepare dbConn dbQueryAccount
    29                 execute statement [SqlString $ clNick]
    29                 execute statement [SqlString $ clNick]
    30                 passAndRole <- fetchRow statement
    30                 passAndRole <- fetchRow statement
    31                 finish statement
    31                 finish statement
    32                 let response =
    32                 let response =
    33                     if isJust passAndRole then
    33                    if isJust passAndRole then
    34                         (
    34                         (
    35                             clUid,
    35                             clUid,
    36                             HasAccount
    36                             HasAccount
    37                                 (fromSql $ head $ fromJust $ passAndRole)
    37                                 (fromSql $ head $ fromJust $ passAndRole)
    38                                 ((fromSql $ last $ fromJust $ passAndRole) == (Just (3 :: Int)))
    38                                 ((fromSql $ last $ fromJust $ passAndRole) == (Just (3 :: Int)))
    39                         )
    39                         )
    40                     else
    40                    else
    41                         (clUid, Guest)
    41                         (clUid, Guest)
    42                 putStrLn (show response)
    42                 putStrLn (show response)
    43                 hFlush stdout
    43                 hFlush stdout
    44 
    44 
    45         SendStats clients rooms ->
    45         SendStats clients rooms ->