gameServer/HWProtoNEState.hs
branchui-scaling
changeset 15288 c4fd2813b127
parent 13840 acb8b5530aa8
equal deleted inserted replaced
13395:0135e64c6c66 15288:c4fd2813b127
    63     let cl = irnc `client` ci
    63     let cl = irnc `client` ci
    64 
    64 
    65     if clientProto cl < 48 && passwd == webPassword cl then
    65     if clientProto cl < 48 && passwd == webPassword cl then
    66         return $ JoinLobby : [AnswerClients [sendChan cl] ["ADMIN_ACCESS"] | isAdministrator cl]
    66         return $ JoinLobby : [AnswerClients [sendChan cl] ["ADMIN_ACCESS"] | isAdministrator cl]
    67         else
    67         else
       
    68         -- String is parsed by frontend, do not localize!
    68         return [ByeClient "Authentication failed"]
    69         return [ByeClient "Authentication failed"]
    69 
    70 
    70 
    71 
    71 handleCmd_NotEntered ["PASSWORD", passwd, clientSalt] = do
    72 handleCmd_NotEntered ["PASSWORD", passwd, clientSalt] = do
    72     (ci, irnc) <- ask
    73     (ci, irnc) <- ask
    79         return [
    80         return [
    80             AnswerClients [sendChan cl] ["SERVER_AUTH", serverHash] 
    81             AnswerClients [sendChan cl] ["SERVER_AUTH", serverHash] 
    81             , JoinLobby
    82             , JoinLobby
    82             ]
    83             ]
    83         else
    84         else
       
    85         -- String is parsed by frontend, do not localize!
    84         return [ByeClient "Authentication failed"]
    86         return [ByeClient "Authentication failed"]
    85     where
    87     where
    86         h = B.pack . showDigest . sha1 . BL.fromChunks
    88         h = B.pack . showDigest . sha1 . BL.fromChunks
    87 
    89 
    88 #if defined(OFFICIAL_SERVER)
    90 #if defined(OFFICIAL_SERVER)
    97             , CheckRegistered]
    99             , CheckRegistered]
    98     where
   100     where
    99         parsedProto = readInt_ protoNum
   101         parsedProto = readInt_ protoNum
   100 #endif
   102 #endif
   101 
   103 
   102 handleCmd_NotEntered _ = return [ProtocolError "Incorrect command (state: not entered)"]
   104 handleCmd_NotEntered (s:_) = return [ProtocolError $ "Incorrect command '" `B.append` s `B.append` "' (state: not entered)"]
       
   105 
       
   106 handleCmd_NotEntered [] = return [ProtocolError "Empty command (state: not entered)"]