game2005api/doc/_common.py
aozhiwei 39ea2144c5 1
2021-12-10 11:39:45 +08:00

305 lines
9.8 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- coding: utf-8 -*-
class ReqHead(object):
def __init__(self):
self.params = [
['account_id', '', '账号id'],
['session_id', '', '会话id'],
]
class RspHead(object):
def __init__(self):
self.fields = [
['errcode', 0, '错误码'],
['errmsg', '', '错误描述'],
]
class GunSkin(object):
def __init__(self):
self.fields = [
['gun_id', 0, '枪支id'],
['skin_id', 0, '皮肤id'],
['try_expire_at', 0, '试用到期时间(utc时间)'],
]
class GunTalent(object):
def __init__(self):
self.fields = [
['talent_id', 0, '天赋'],
['talent_lv', 0, '天赋等级'],
]
class UserInfo(object):
def __init__(self):
self.fields = [
['activated', 0, '是否已激活'],
['account_id', '', '账号id'],
['name', '', '用户名字'],
['head_id', 0, '头像id'],
['head_frame', 0, '头像框id'],
['level', 0, '等级'],
['exp', 0, '经验'],
['max_exp', 0, '经验(上限)'],
['gold', 0, '金币'],
['diamond', 0, '钻石'],
['hero_id', 0, '当前使用的英雄ID'],
['first_fight', 0, '是否是第一次战斗'],
['!head_list', [0], '拥有的头像列表'],
['!head_frame_list', [0], '拥有的头像框列表'],
]
class UserDetailInfo(object):
def __init__(self):
self.fields = [
['activated', 0, '是否已激活'],
['account_id', '', '账号id'],
['name', '', '用户名字'],
['head_id', 0, '头像id'],
['head_frame', 0, '头像框id'],
['level', 0, '等级'],
['exp', 0, '经验'],
['max_exp', 0, '经验(上限)'],
['gold', 0, '金币'],
['diamond', 0, '钻石'],
['hero_id', 0, '当前使用的英雄ID'],
['current_rank', 0, '当前段位'],
['history_best_rank', 0, '历史最高段位'],
['!history_seasons', [UserHisSeason()], '历史打过的赛季列表'],
]
class UserHisSeason(object):
def __init__(self):
self.fields = [
['season_id', 0, '赛季'],
['total_kills', 0, '击杀总数(个人信息)'],
['game_times', 0, '游戏场次(个人信息)'],
['win_times', 0, '胜利场次(个人信息)'],
['win_rate', 0, '胜率(个人信息,百分比数值整数部分)'],
['max_kills', 0, '最高击杀(游戏信息)'],
['avg_kills', 0, '平均击杀(游戏信息)'],
['max_damage_out', 0, '最高伤害输出(游戏信息)'],
['avg_damage_out', 0, '平均伤害输出(游戏信息)'],
['star_kills', 0, '击败(5纬图-击败, 百分比数值整数部分)'],
['star_damage', 0, '伤害(5纬图-伤害, 百分比数值整数部分)'],
['star_alive', 0, '生存(5纬图-生存, 百分比数值整数部分)'],
['star_recover', 0, '治疗(5纬图-治疗, 百分比数值整数部分)'],
['star_win', 0, '胜利(5纬图-胜利, 百分比数值整数部分)'],
]
class Hero(object):
def __init__(self):
self.fields = [
['hero_id', 0, '英雄id'],
['hero_lv', 0, '英雄等级'],
['skin_id', 0, '英雄皮肤id'],
['skill_lv1', 0, '必杀技等级'],
['skill_lv2', 0, '躲避技能等级'],
['yoke_lv', 0, '羁绊等级'],
['yoke_exp', 0, '羁绊经验'],
]
class HeroSkin(object):
def __init__(self):
self.fields = [
['skin_id', 0, '英雄皮肤id'],
['skin_state', 0, '英雄皮肤状态 0=已经购1 = 试用状态'],
['try_expire_at', 0, '试用到期时间(utc时间)'],
]
class Item(object):
def __init__(self):
self.fields = [
['item_id', 0, '道具id'],
['item_num', 0, '道具数量'],
]
class AwardItem(object):
def __init__(self):
self.fields = [
['item_id', 0, '道具id'],
['item_num', 0, '道具数量'],
]
class Award(object):
def __init__(self):
self.fields = [
['!items', [AwardItem()], '奖励物品列表']
]
class PropertyChg(object):
def __init__(self):
self.fields = [
['user_info', UserInfo(), '用户信息变更(用来更新本地客户端字段(有则更新无则不变))'],
['!container_chg', [''], '容器类数据变更(bag、hero、heroSkin、gunSkin)']
]
class CostInfoItem(object):
def __init__(self):
self.fields = [
['item_id', 0, '购买需要消耗的道具id'],
['item_num', 0, '购买需要消耗的道具数量'],
['discount', 0, '折扣百分比0-100'],
]
class CostInfo(object):
def __init__(self):
self.fields = [
['!cost_group', [CostInfoItem()], '一组扣费项目,(金币、钻石视为道具,可能有多种价格)'],
]
class PriceInfo(object):
def __init__(self):
self.fields = [
['!cost_list', [CostInfo()], '扣费方式列表'],
['discount_begin_time', 0, '折扣开始时间(utc时间)'],
['discount_end_time', 0, '折扣结束时间(utc时间)'],
]
class DiscountInfo(object):
def __init__(self):
self.fields = [
['item_id', 0, '道具id'],
['gold_discount', 0, '金币折扣百分比0-100'],
['diamond_discount', 0, '钻石折扣百分比0-100'],
]
class ItemPriceInfo(object):
def __init__(self):
self.fields = [
['item_id', 0, '道具id'],
['price_info', PriceInfo(), '价格信息'],
]
class Goods(object):
def __init__(self):
self.fields = [
['goods_id', 0, '商品id 用于购买的时候回传'],
['item_id', 0, '配置表id'],
['price_info', PriceInfo(), '价格信息'],
['flag_icon', '', '商品标记(商品左上角的显示图标,超值、9折等)'],
['limit_type', 0, '0:不限购(这时忽略bought_times、total_buy_times) 1:每日限购 2:周限购 3:累计限购'],
['bought_times', 0, '已购买次数'],
['total_buy_times', 0, '总的可购买次数'],
]
class Shop(object):
def __init__(self):
self.fields = [
['shop_id', 0, '商店id'],
['!goods_list1', [Goods()], '商品列表1'],
['!goods_list2', [Goods()], '商品列表2'],
]
class Mission(object):
def __init__(self):
self.fields = [
['mission_id', 0, '任务id'],
['current', 0, '任务进度-当前'],
['target', 0, '任务进度-目标'],
['state', 0, '任务状态 0:可领取 1:已领取 2:未完成(不可领取)'],
['show_progress', 0, '是否显示任务进度'],
]
class SeasonCardGiftPackage(object):
def __init__(self):
self.fields = [
['package_id', 0, '礼包id'],
['item_id', 0, '礼包道具表id(目前客户端没用到先不用管)'],
['state', 0, '0:未购买 1:已购买'],
['price_info', PriceInfo(), '价格信息'],
]
class SeasonCard(object):
def __init__(self):
self.fields = [
['season_id', 0, '赛季id(客户端显示为Sxxx)'],
['season_begin_time', 0, '赛季开始时间(utc时间)'],
['season_end_time', 0, '赛季结束时间(utc时间)'],
['card_lv', 0, '手册等级'],
['card_exp', 0, '手册经验'],
['card_max_exp', 0, '手册经验上限'],
['!gift_packages', [SeasonCardGiftPackage()], '礼包列表'],
['!received_level_rewards1', [0], '等级解锁的奖励已领取等级列表(普通手册)'],
['!received_level_rewards2', [0], '等级解锁的奖励已领取等级列表(精英)'],
]
class SeasonMission(object):
def __init__(self):
self.fields = [
['state', 0, '任务状态 0:可领取 1:已领取 2:未完成(不可领取)'],
['current', 0, '当前匹配场次'],
['target', 0, '目标匹配场次'],
['target_rank', 0, '目标段位'],
]
class Season(object):
def __init__(self):
self.fields = [
['season_id', 0, '赛季id(客户端显示为Sxxx)'],
['rank', 0, '段位'],
['score', 0, '积分'],
['max_score', 0, '积分上限'],
['noshow_score_bar', 0, '不要显示积分条界面(xx/xx)'],
['mission', SeasonMission(), '赛季任务'],
]
class RankingItem(object):
def __init__(self):
self.fields = [
['ranked', 0, '排名'],
['account_id', '', '账号id'],
['name', '', '用户名字'],
['head_id', 0, '头像id'],
['head_frame', 0, '头像框id'],
['level', 0, '等级'],
['exp', 0, '经验'],
['gold', 0, '金币'],
['diamond', 0, '钻石'],
['hero_id', 0, '当前使用的英雄ID'],
['rank', 0, '段位'],
['score', 0, '积分'],
]
class RankingList(object):
def __init__(self):
self.fields = [
['type', 0, '排行榜类型 1积分榜'],
['!ranking_list', [RankingItem()], '排行榜'],
['my_ranked', RankingItem(), '我的排名(如果ranked<1则表示自己未上榜)'],
]
class RedDot(object):
def __init__(self):
self.fields = [
['type', 0, '红点类型'],
['state', 0, '红点状态 0:无 1:有'],
]