def roleinfo_114(key, dynamicId, request_proto): '''角色信息''' argument = json.loads(request_proto) characterId = argument.get('characterId') data = login.roleLogin(dynamicId, characterId) if not data.get('result'): return json.dumps(data) placeId = data['data'].get('placeId', 1000) response = {}
def roleLogin_103(key,dynamicId,request_proto): '''角色登陆''' argument=json.loads(request_proto) userId=argument.get('userId') data=login.roleLogin(dynamicId,userId) if not data.get('result') or not data.get('data').get('hasRole'): return json.dumps(data) placeId=data['data'].get('placeId',1000) characterId=data['data'].get('characterId',0) response=login.enterScene(dynamicId,characterId,placeId,True) return json.dumps(response)
def roleLogin_103(key, dynamicId, request_proto): '''角色登陆''' argument = json.loads(request_proto) userId = argument.get('userId') data = login.roleLogin(dynamicId, userId) if not data.get('result') or not data.get('data').get('hasRole'): return json.dumps(data) placeId = data['data'].get('placeId', 1000) characterId = data['data'].get('characterId', 0) response = login.enterScene(dynamicId, characterId, placeId, True) return json.dumps(response)
def roleLogin_103(key, dynamicId, request_proto): """角色登陆""" argument = json.loads(request_proto) userId = argument.get('userId') characterId = argument.get('characterId') data = login.roleLogin(dynamicId, userId, characterId) if not data.get('result'): return json.dumps(data) placeId = data['data'].get('placeId', 1000) response = {} dd = login.enterScene(dynamicId, characterId, placeId, True) if not dd: return dd.addCallback(SerializePartialEnterScene, response) return dd
def roleLogin_103(key,dynamicId, request_proto): '''角色登陆''' argument = json.loads(request_proto) userId = argument.get('userId') characterId = argument.get('characterId') data = login.roleLogin(dynamicId, userId, characterId) if not data.get('result'): return json.dumps(data) placeId = data['data'].get('placeId',1000) response = {} dd = login.enterScene(dynamicId, characterId, placeId, True) if not dd: return dd.addCallback(SerializePartialEnterScene,response) return dd
def roleLogin_103(key, dynamicId, request_proto): '''角色登陆''' argument = json.loads(request_proto) userId = argument.get('userId') characterId = argument.get('characterId') data = login.roleLogin(dynamicId, userId, characterId) # 角色登录 if not data.get('result'): return json.dumps(data) placeId = data['data'].get('placeId', 1000) response = {} dd = login.enterScene(dynamicId, characterId, placeId, True) # 进入场景 if not dd: return # defer回调,结果出来后自动调用 # SerializePartialEnterScene 序列化进入场景的返回消息 dd.addCallback(SerializePartialEnterScene, response) return dd