def change_nickname_5(self, message): response = CommonResponse() response.ParseFromString(message) print 'change nickname result:', response.result # print "-+"*40, self.__class__, self.on_character_login_result if self.on_character_login_result: self.on_character_login_result(True) if hasattr(self, 'on_login'): self.on_login()
def handle(self): command, message, self.buff = resolveRecvdata(self.buff) print "buff", self.buff, "buff" player_id = 0 if command == 2: argument = AccountResponse() argument.ParseFromString(message) print argument request = GameLoginRequest() request.token = argument.key.key self.dateSend(request, 4) if command == 4: argument = GameLoginResponse() argument.ParseFromString(message) player_id = argument.id send_mail_request = SendMailRequest() mail = send_mail_request.mail mail.mail_id = '001' mail.sender_id = player_id mail.sender_name = 'player1' mail.receive_id = player_id mail.receive_name = 'player1' mail.title = 'title1' mail.content = 'content1' mail.mail_type = 4 self.dateSend(send_mail_request, 1304) if command == 1304: response = CommonResponse() response.ParseFromString(message) print "send response:", response.result if command == 1305: response = ReceiveMailResponse() response.ParseFromString(message) print "receive response:", response.mail
def reborn_1704(self, message): response = CommonResponse() response.ParseFromString(message) print response self.on_command_finish()
def encourage_1703(self, message): response = CommonResponse() response.ParseFromString(message) print response self.on_command_finish()
def get_accept_friend_1101(self, message): response = CommonResponse() response.ParseFromString(message) str_format = 'accept friend result:%s result_no:%s' print str_format % (response.result, response.result_no) self.on_command_finish()
def change_nickname_5(self, message): response = CommonResponse() response.ParseFromString(message) print 'change nickname result:', response.result