gameServer/HWProtoNEState.hs
changeset 10077 ca67740f19b2
parent 10076 b235e520ea21
child 10212 5fb3bb2de9d2
equal deleted inserted replaced
10076:b235e520ea21 10077:ca67740f19b2
    56 
    56 
    57     let clientHash = h [clientSalt, serverSalt cl, webPassword cl, showB $ clientProto cl, "!hedgewars"]
    57     let clientHash = h [clientSalt, serverSalt cl, webPassword cl, showB $ clientProto cl, "!hedgewars"]
    58     let serverHash = h [serverSalt cl, clientSalt, webPassword cl, showB $ clientProto cl, "!hedgewars"]
    58     let serverHash = h [serverSalt cl, clientSalt, webPassword cl, showB $ clientProto cl, "!hedgewars"]
    59 
    59 
    60     if passwd == clientHash then
    60     if passwd == clientHash then
    61         return $
    61         return [
    62             AnswerClients [sendChan cl] ["SERVER_AUTH", serverHash] 
    62             AnswerClients [sendChan cl] ["SERVER_AUTH", serverHash] 
    63             : JoinLobby
    63             , JoinLobby
    64             : [AnswerClients [sendChan cl] ["ADMIN_ACCESS"] | isAdministrator cl]
    64             ]
    65         else
    65         else
    66         return [ByeClient "Authentication failed"]
    66         return [ByeClient "Authentication failed"]
    67     where
    67     where
    68         h = B.pack . showDigest . sha1 . BL.fromChunks
    68         h = B.pack . showDigest . sha1 . BL.fromChunks
    69 
    69