示例#1
0
 def login_with_param(self, username, auth_info):
     param = authentication.ValidateAndRequestTicketParam()
     param.username = username
     if auth_info:
         param.data = auth_info
     else:
         param.data = common.NullData()
     param.nex_version = self.settings.get("server.version")
     response = self.auth_proto.login_with_param(param)
     return LoginResult(response.pid, response.ticket, response.server_url)
示例#2
0
    async def login_with_param(self, username, auth_info):
        param = authentication.ValidateAndRequestTicketParam()
        param.username = username
        if auth_info:
            param.data = auth_info
        else:
            param.data = common.NullData()
        param.nex_version = self.settings["nex.version"]
        param.client_version = self.settings["nex.client_version"]

        response = await self.auth_proto.validate_and_request_ticket_with_param(
            param)
        return LoginResult(response.pid, response.ticket,
                           bytes.fromhex(response.source_key),
                           response.server_url)