# -*- coding: utf-8 -*- import _common class Battle(object): def __init__(self): self.apis = [ { 'method': 'POST', 'name': 'preBattleCheck', 'desc': '战前检查把CMJoin协议打包成json格式放到http body里参考gamelog处理方式(在发CMJoin之前发,如果errcode!=0则提示错误并且不再发CMJoin相当于进入失败)', 'group': 'Battle', 'url': 'webapp/index.php?c=Battle&a=preBattleCheck', 'params': [ _common.ReqHead(), ], 'response': [ _common.RspHead(), ['pre_battle_payload', '', '透传给战斗的CMJoin.pre_battle_payload(该信息里携带了战斗服需要校验的信息,防止客户端伪造数据)'] ] }, ] self.internalApis = [ { 'desc': '服务器战报(客户端不用处理)battleReport', 'group': 'Battle', 'url': 'webapp/index.php?c=Battle&a=battleReport', 'params': [ _common.ReqHead(), ], 'response': [ _common.RspHead(), ] }, { 'desc': '获取战斗数据(客户端不用处理)getBattleData', 'group': 'Battle', 'url': 'webapp/index.php?c=Battle&a=getBattleData', 'params': [ _common.ReqHead(), ], 'response': [ _common.RspHead(), ] }, ]