This commit is contained in:
aozhiwei 2021-11-26 17:18:13 +08:00
parent 799c95bd75
commit 9fec70c834
22 changed files with 0 additions and 2494 deletions

View File

@ -1,119 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class Activity(object):
def __init__(self):
self.apis_ = [
{
'desc': 'newLuckDrawInfo',
'group': 'Activity',
'url': 'webapp/index.php?c=Activity&a=newLuckDrawInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getNewLuckDraw',
'group': 'Activity',
'url': 'webapp/index.php?c=Activity&a=getNewLuckDraw',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'drawTableInfo',
'group': 'Activity',
'url': 'webapp/index.php?c=Activity&a=drawTableInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getDrawTable',
'group': 'Activity',
'url': 'webapp/index.php?c=Activity&a=getDrawTable',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'doubleLuckDraw',
'group': 'Activity',
'url': 'webapp/index.php?c=Activity&a=doubleLuckDraw',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'lotteryReward',
'group': 'Activity',
'url': 'webapp/index.php?c=Activity&a=lotteryReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getBoxOrder',
'group': 'Activity',
'url': 'webapp/index.php?c=Activity&a=getBoxOrder',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getOrderReward',
'group': 'Activity',
'url': 'webapp/index.php?c=Activity&a=getOrderReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'drawBoxInfo',
'group': 'Activity',
'url': 'webapp/index.php?c=Activity&a=drawBoxInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'drawBoxReward',
'group': 'Activity',
'url': 'webapp/index.php?c=Activity&a=drawBoxReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,62 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class Additem(object):
def __init__(self):
self.apis_ = [
{
'desc': '添加道具additem',
'group': 'Additem',
'url': 'webapp/index.php?c=Additem&a=additem',
'params': [
_common.ReqHead(),
['item_id', 0, '道具id'],
['item_num', 0, '道具数量'],
['time', 0, '时间'],
],
'response': [
_common.RspHead(),
]
},
{
'desc': '添加钻石addDiamond',
'group': 'Additem',
'url': 'webapp/index.php?c=Additem&a=addDiamond',
'params': [
_common.ReqHead(),
['item_id', 0, '道具id'],
['item_num', 0, '道具数量'],
['time', 0, '时间'],
],
'response': [
_common.RspHead(),
]
},
{
'desc': '添加金币addCoin',
'group': 'Additem',
'url': 'webapp/index.php?c=Additem&a=addCoin',
'params': [
_common.ReqHead(),
['item_id', 0, '道具id'],
['item_num', 0, '道具数量'],
['time', 0, '时间'],
],
'response': [
_common.RspHead(),
]
},
{
'desc': '获取金币getCoin',
'group': 'Additem',
'url': 'webapp/index.php?c=Additem&a=getCoin',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,42 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class FesActivity(object):
def __init__(self):
self.apis_ = [
{
'desc': 'acitivityInfo',
'group': 'FesActivity',
'url': 'webapp/index.php?c=FesActivity&a=acitivityInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getActReward',
'group': 'FesActivity',
'url': 'webapp/index.php?c=FesActivity&a=getActReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getActExtraReward',
'group': 'FesActivity',
'url': 'webapp/index.php?c=FesActivity&a=getActExtraReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,42 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class GM(object):
def __init__(self):
self.apis_ = [
{
'desc': 'clearDB',
'group': 'GM',
'url': 'webapp/index.php?c=GM&a=clearDB',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getSysTime',
'group': 'GM',
'url': 'webapp/index.php?c=GM&a=getSysTime',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'setSysTime',
'group': 'GM',
'url': 'webapp/index.php?c=GM&a=setSysTime',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,110 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class GameOver(object):
def __init__(self):
self.apis_ = [
{
'desc': '首战奖励信息firstRewardInfo',
'group': 'GameOver',
'url': 'webapp/index.php?c=GameOver&a=firstRewardInfo',
'params': [
_common.ReqHead(),
['rank', 0, '排名'],
['type', 0, '类型'],
['coin', 0, '金币'],
['kills', 0, '击杀数'],
],
'response': [
_common.RspHead(),
['first_uuid', '', '唯一id'],
['!item_list', _common.RewardItemInfo, '奖励信息列表'],
['coin', 0, '金币'],
['score', 0, '积分'],
]
},
{
'desc': '获取首战奖励getFirstReward',
'group': 'GameOver',
'url': 'webapp/index.php?c=GameOver&a=getFirstReward',
'params': [
_common.ReqHead(),
['type', 0, '类型'],
['first_uuid', '', '唯一id'],
],
'response': [
_common.RspHead(),
['!item_list', _common.DropItemInfo, '掉落道具列表'],
['coin_num', 0, '当前金币数'],
['rmb_num', 0, '当前点券数量'],
['!all_item_list', _common.RewardItemInfo, '实际奖励的道具列表'],
]
},
{
'desc': '获取Fuck宝箱?getFuckBoxReward',
'group': 'GameOver',
'url': 'webapp/index.php?c=GameOver&a=getFuckBoxReward',
'params': [
_common.ReqHead(),
['id', 0, 'id'],
],
'response': [
_common.RspHead(),
['!item_list', _common.DropItemInfo, '掉落道具列表'],
['coin_num', 0, '当前金币数'],
['rmb_num', 0, '当前点券数量'],
['!all_item_list', _common.RewardItemInfo, '实际奖励的道具列表'],
]
},
{
'desc': '待删除updateDiamond',
'group': 'GameOver',
'url': 'webapp/index.php?c=GameOver&a=updateDiamond',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': '添加战利品addSpoilsItems',
'group': 'GameOver',
'url': 'webapp/index.php?c=GameOver&a=addSpoilsItems',
'params': [
_common.ReqHead(),
['data', '', '数据json格式[{"values":[item_id, item_num]}]'],
],
'response': [
_common.RspHead(),
['!item_list', _common.DropItemInfo, '掉落道具列表'],
['coin_num', 0, '当前金币数'],
['rmb_num', 0, '当前点券数量'],
['!all_item_list', _common.RewardItemInfo, '实际奖励的道具列表'],
]
},
{
'desc': '待删除fightRevive',
'group': 'GameOver',
'url': 'webapp/index.php?c=GameOver&a=fightRevive',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': '添加游戏次数addGameTimes',
'group': 'GameOver',
'url': 'webapp/index.php?c=GameOver&a=addGameTimes',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,53 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class Hang(object):
def __init__(self):
self.apis_ = [
{
'desc': 'getTime',
'group': 'Hang',
'url': 'webapp/index.php?c=Hang&a=getTime',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getRedInfo',
'group': 'Hang',
'url': 'webapp/index.php?c=Hang&a=getRedInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getOnlineReward',
'group': 'Hang',
'url': 'webapp/index.php?c=Hang&a=getOnlineReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getHangDoubleReward',
'group': 'Hang',
'url': 'webapp/index.php?c=Hang&a=getHangDoubleReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,108 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class NRR(object):
def __init__(self):
self.apis_ = [
{
'desc': 'ResetRRVIP',
'group': 'NRR',
'url': 'webapp/index.php?c=NRR&a=ResetRRVIP',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'buyRRVIP',
'group': 'NRR',
'url': 'webapp/index.php?c=NRR&a=buyRRVIP',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getRRInfo',
'group': 'NRR',
'url': 'webapp/index.php?c=NRR&a=getRRInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getAward',
'group': 'NRR',
'url': 'webapp/index.php?c=NRR&a=getAward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getAllReward',
'group': 'NRR',
'url': 'webapp/index.php?c=NRR&a=getAllReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'lvUp',
'group': 'NRR',
'url': 'webapp/index.php?c=NRR&a=lvUp',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getCurSeasonCfg',
'group': 'NRR',
'url': 'webapp/index.php?c=NRR&a=getCurSeasonCfg',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getRewardArr',
'group': 'NRR',
'url': 'webapp/index.php?c=NRR&a=getRewardArr',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getRewardByStr',
'group': 'NRR',
'url': 'webapp/index.php?c=NRR&a=getRewardByStr',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,31 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class NShop(object):
def __init__(self):
self.apis_ = [
{
'desc': 'getShopData',
'group': 'NShop',
'url': 'webapp/index.php?c=NShop&a=getShopData',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'buyItem',
'group': 'NShop',
'url': 'webapp/index.php?c=NShop&a=buyItem',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,75 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class NTask(object):
def __init__(self):
self.apis_ = [
{
'desc': 'getRewardState',
'group': 'NTask',
'url': 'webapp/index.php?c=NTask&a=getRewardState',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getLvTastRewardByTaskID',
'group': 'NTask',
'url': 'webapp/index.php?c=NTask&a=getLvTastRewardByTaskID',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getRewardByTaskID',
'group': 'NTask',
'url': 'webapp/index.php?c=NTask&a=getRewardByTaskID',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'updateTaskToDB',
'group': 'NTask',
'url': 'webapp/index.php?c=NTask&a=updateTaskToDB',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getAllTaskInfo',
'group': 'NTask',
'url': 'webapp/index.php?c=NTask&a=getAllTaskInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'InsertTaskType',
'group': 'NTask',
'url': 'webapp/index.php?c=NTask&a=InsertTaskType',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,130 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class NewPayActivity(object):
def __init__(self):
self.apis_ = [
{
'desc': 'handlePre',
'group': 'NewPayActivity',
'url': 'webapp/index.php?c=NewPayActivity&a=handlePre',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getExplode',
'group': 'NewPayActivity',
'url': 'webapp/index.php?c=NewPayActivity&a=getExplode',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'rechargeRmb',
'group': 'NewPayActivity',
'url': 'webapp/index.php?c=NewPayActivity&a=rechargeRmb',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'rechargeBuy',
'group': 'NewPayActivity',
'url': 'webapp/index.php?c=NewPayActivity&a=rechargeBuy',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'unlockPassCard',
'group': 'NewPayActivity',
'url': 'webapp/index.php?c=NewPayActivity&a=unlockPassCard',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'recAcitivityInfo',
'group': 'NewPayActivity',
'url': 'webapp/index.php?c=NewPayActivity&a=recAcitivityInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'recAcitivityReward',
'group': 'NewPayActivity',
'url': 'webapp/index.php?c=NewPayActivity&a=recAcitivityReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'shareDiscount',
'group': 'NewPayActivity',
'url': 'webapp/index.php?c=NewPayActivity&a=shareDiscount',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'flushDiscountShop',
'group': 'NewPayActivity',
'url': 'webapp/index.php?c=NewPayActivity&a=flushDiscountShop',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'changeHeadKuang',
'group': 'NewPayActivity',
'url': 'webapp/index.php?c=NewPayActivity&a=changeHeadKuang',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'addmailReward',
'group': 'NewPayActivity',
'url': 'webapp/index.php?c=NewPayActivity&a=addmailReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,75 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class Pass(object):
def __init__(self):
self.apis_ = [
{
'desc': 'getPassInfo',
'group': 'Pass',
'url': 'webapp/index.php?c=Pass&a=getPassInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getPassReward',
'group': 'Pass',
'url': 'webapp/index.php?c=Pass&a=getPassReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getWeekReward',
'group': 'Pass',
'url': 'webapp/index.php?c=Pass&a=getWeekReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getSeaReward',
'group': 'Pass',
'url': 'webapp/index.php?c=Pass&a=getSeaReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'buyExp',
'group': 'Pass',
'url': 'webapp/index.php?c=Pass&a=buyExp',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getAllPassReward',
'group': 'Pass',
'url': 'webapp/index.php?c=Pass&a=getAllPassReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,75 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class Pay(object):
def __init__(self):
self.apis_ = [
{
'desc': 'getPayInfo',
'group': 'Pay',
'url': 'webapp/index.php?c=Pay&a=getPayInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getVipInfo',
'group': 'Pay',
'url': 'webapp/index.php?c=Pay&a=getVipInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getVipReward',
'group': 'Pay',
'url': 'webapp/index.php?c=Pay&a=getVipReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'buyItem',
'group': 'Pay',
'url': 'webapp/index.php?c=Pay&a=buyItem',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getOrderInfo',
'group': 'Pay',
'url': 'webapp/index.php?c=Pay&a=getOrderInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'addADtimes',
'group': 'Pay',
'url': 'webapp/index.php?c=Pay&a=addADtimes',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,119 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class PayActivity(object):
def __init__(self):
self.apis_ = [
{
'desc': 'getExplode',
'group': 'PayActivity',
'url': 'webapp/index.php?c=PayActivity&a=getExplode',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'rechargeRmb',
'group': 'PayActivity',
'url': 'webapp/index.php?c=PayActivity&a=rechargeRmb',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'rechargeBuy',
'group': 'PayActivity',
'url': 'webapp/index.php?c=PayActivity&a=rechargeBuy',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'unlockPassCard',
'group': 'PayActivity',
'url': 'webapp/index.php?c=PayActivity&a=unlockPassCard',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'recAcitivityInfo',
'group': 'PayActivity',
'url': 'webapp/index.php?c=PayActivity&a=recAcitivityInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'recAcitivityReward',
'group': 'PayActivity',
'url': 'webapp/index.php?c=PayActivity&a=recAcitivityReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'shareDiscount',
'group': 'PayActivity',
'url': 'webapp/index.php?c=PayActivity&a=shareDiscount',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'flushDiscountShop',
'group': 'PayActivity',
'url': 'webapp/index.php?c=PayActivity&a=flushDiscountShop',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'changeHeadKuang',
'group': 'PayActivity',
'url': 'webapp/index.php?c=PayActivity&a=changeHeadKuang',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'addmailReward',
'group': 'PayActivity',
'url': 'webapp/index.php?c=PayActivity&a=addmailReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,20 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class PayNotify(object):
def __init__(self):
self.apis_ = [
{
'desc': 'payNotify',
'group': 'PayNotify',
'url': 'webapp/index.php?c=PayNotify&a=payNotify',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,53 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class Quest(object):
def __init__(self):
self.apis_ = [
{
'desc': 'questInfo',
'group': 'Quest',
'url': 'webapp/index.php?c=Quest&a=questInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'doubleQuestReward',
'group': 'Quest',
'url': 'webapp/index.php?c=Quest&a=doubleQuestReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'submitQuest',
'group': 'Quest',
'url': 'webapp/index.php?c=Quest&a=submitQuest',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'addGuildTask',
'group': 'Quest',
'url': 'webapp/index.php?c=Quest&a=addGuildTask',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,53 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class Rank(object):
def __init__(self):
self.apis_ = [
{
'desc': 'rankInfo',
'group': 'Rank',
'url': 'webapp/index.php?c=Rank&a=rankInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getGunInfo',
'group': 'NRank',
'url': 'webapp/index.php?c=NRank&a=getGunInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getRankInfo',
'group': 'NRank',
'url': 'webapp/index.php?c=NRank&a=getRankInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'mailTest',
'group': 'NRank',
'url': 'webapp/index.php?c=NRank&a=mailTest',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,218 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class Role(object):
def __init__(self):
self.apis_ = [
{
'desc': '获取角色信息roleInfo',
'group': 'Role',
'url': 'webapp/index.php?c=Role&a=roleInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
_common.RoleInfo(),
]
},
{
'desc': '客户端战报clientBattleReport',
'group': 'Role',
'url': 'webapp/index.php?c=Role&a=clientBattleReport',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': '服务器战报(客户端不用处理)battleReport',
'group': 'Role',
'url': 'webapp/index.php?c=Role&a=battleReport',
'params': [
_common.ReqHead(),
['map_id', 0, '地图id'],
['map_tpl_name', '', '地图模板名'],
['room_uuid', 0, '房间唯一id'],
['map_name', '', '地图名'],
['game_time', 0, '游戏时间'],
['hurt', 0, '收到伤害'],
['rank', 0, '排名'],
['kills', 0, '击杀数'],
['harm', 0, '伤害输出'],
['add_HP', 0, '治疗'],
['alive_time', 0, '存活时间'],
['team_status', 0, '是否是组队状态'],
['snipe_kill', 0, '狙击枪击杀数'],
['rifle_kill', 0, '步枪击杀数'],
['pistol_kill', 0, '手枪击杀数'],
['submachine_kill', 0, '冲锋枪击杀数'],
['rescue_member', 0, '救起队友次数'],
['coin_num', 0, '金币'],
['rank_score', 0, '排位积分'],
['pass_score', 0, '通行证积分'],
['items', 0, '道具|分割'],
],
'response': [
_common.RspHead(),
['kill_his', 0, '历史最高击杀数'],
['alive_time_his', 0, '历史最高存活时间'],
['harm_his', 0, '历史最高伤害'],
['add_HP_his', 0, '历史最高治疗'],
]
},
{
'desc': '获取机器人信息getRobotInfo',
'group': 'Role',
'url': 'webapp/index.php?c=Role&a=getRobotInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
['!member_list', _common.RobotInfo(), '机器人数据'],
['!sin_member', _common.RobotMetaInfo(), '机器人列表'],
['num', 0, '货币数量'],
]
},
{
'desc': '获取战斗奖励getFightReward',
'group': 'Role',
'url': 'webapp/index.php?c=Role&a=getFightReward',
'params': [
_common.ReqHead(),
['coin_num', 0, '货币数量'],
['reward_id', 0, '奖励id'],
['reward_num', 0, '奖励数量'],
],
'response': [
_common.RspHead(),
['coin_num', 0, '货币数量'],
]
},
{
'desc': '获取新手奖励getNewHandReward',
'group': 'Role',
'url': 'webapp/index.php?c=Role&a=getNewHandReward',
'params': [
_common.ReqHead(),
['type', 0, '类型1或2'],
],
'response': [
_common.RspHead(),
['!item_list', _common.DropItemInfo, '掉落道具列表'],
['coin_num', 0, '当前金币数'],
['rmb_num', 0, '当前点券数量'],
['!all_item_list', _common.RewardItemInfo, '实际奖励的道具列表'],
]
},
{
'desc': '兑换货币(该接口存在争议)exchangeCoin',
'group': 'Role',
'url': 'webapp/index.php?c=Role&a=exchangeCoin',
'params': [
_common.ReqHead(),
['id', 0, '装备?货币id'],
['num', 0, '兑换数量'],
],
'response': [
_common.RspHead(),
]
},
{
'desc': '保存新手引导saveNewbie',
'group': 'Role',
'url': 'webapp/index.php?c=Role&a=saveNewbie',
'params': [
_common.ReqHead(),
['id', 0, 'id'],
],
'response': [
_common.RspHead(),
]
},
{
'desc': '获取战斗装备(该函数存在刷道具风险)getFightEquip',
'group': 'Role',
'url': 'webapp/index.php?c=Role&a=getFightEquip',
'params': [
_common.ReqHead(),
['id', 0, 'id'],
],
'response': [
_common.RspHead(),
['!item_list', _common.DropItemInfo, '掉落道具列表'],
['!all_item_list', _common.RewardItemInfo, '实际奖励的道具列表'],
]
},
{
'desc': '获取金币数updateMoney',
'group': 'Role',
'url': 'webapp/index.php?c=Role&a=updateMoney',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
['data', [
['coin_num', 0, '金币数']
], '数据']
]
},
{
'desc': '获取金币和点券数updateMoneyAndLottery',
'group': 'Role',
'url': 'webapp/index.php?c=Role&a=updateMoneyAndLottery',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
['data', [
['coin_num', 0, '金币数'],
['rmb', 0, '点券数']
], '数据']
]
},
{
'desc': 'getPlayerInfo',
'group': 'NPlayerInfo',
'url': 'webapp/index.php?c=NPlayerInfo&a=getPlayerInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': '修改头像框信息changeHIFrameHero',
'group': 'NPlayerInfo',
'url': 'webapp/index.php?c=NPlayerInfo&a=changeHIFrameHero',
'params': [
_common.ReqHead(),
['type', 0, '类型 2:头像 3头像框 4:英雄'],
['itemID', 0, ''],
],
'response': [
_common.RspHead(),
]
},
{
'desc': '修改昵称changeName',
'group': 'NPlayerInfo',
'url': 'webapp/index.php?c=NPlayerInfo&a=changeName',
'params': [
_common.ReqHead(),
['nickName', '', '新昵称'],
],
'response': [
_common.RspHead(),
['data', '', '新昵称'],
]
},
]

View File

@ -1,20 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class ServerSwitch(object):
def __init__(self):
self.apis_ = [
{
'desc': 'getSwitch',
'group': 'ServerSwitch',
'url': 'webapp/index.php?c=ServerSwitch&a=getSwitch',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,97 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class Share(object):
def __init__(self):
self.apis_ = [
{
'desc': 'beeReward',
'group': 'Share',
'url': 'webapp/index.php?c=Share&a=beeReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'keyBoxInfo',
'group': 'Share',
'url': 'webapp/index.php?c=Share&a=keyBoxInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'keyBoxDoubleReward',
'group': 'Share',
'url': 'webapp/index.php?c=Share&a=keyBoxDoubleReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'shareFriendInfo',
'group': 'Share',
'url': 'webapp/index.php?c=Share&a=shareFriendInfo',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'shareFriendReward',
'group': 'Share',
'url': 'webapp/index.php?c=Share&a=shareFriendReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'shareDobleReward',
'group': 'Share',
'url': 'webapp/index.php?c=Share&a=shareDobleReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'getKefuReward',
'group': 'Share',
'url': 'webapp/index.php?c=Share&a=getKefuReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'kefuDoubleReward',
'group': 'Share',
'url': 'webapp/index.php?c=Share&a=kefuDoubleReward',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -1,31 +0,0 @@
# -*- coding: utf-8 -*-
import _common
class Voice(object):
def __init__(self):
self.apis_ = [
{
'desc': 'upload',
'group': 'Voice',
'url': 'webapp/index.php?c=Voice&a=upload',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
{
'desc': 'download',
'group': 'Voice',
'url': 'webapp/index.php?c=Voice&a=download',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
]
},
]

View File

@ -34,81 +34,6 @@ class GunSkinInfo(object):
['try_expire_at', 0, '试用到期时间(utc时间)'],
]
class RoleInfo(object):
def __init__(self):
self.fields = [
['game_times', 0, '游戏场次'],
['win_times', 0, '胜场'],
['high_kill', 0, '最高击杀'],
['kills', 0, '所有击杀'],
['high_harm', 0, '最高伤害'],
['harm', 0, '所有伤害'],
['add_HP', 0, '所有治疗量'],
['alive_time', 0, '所有生存时间'],
['coin_num', 0, '角色金币'],
['first_fight', 0, '是否是第一次战斗'],
['collect_status', 0, '收藏状态'],
['keys_num', 0, '钥匙数量'],
['kefu_status', 0, '客服奖励状态(0:未领取,1:已领取)'],
['box_num', 0, '空投宝箱数量'],
['diamond_num', 0, '钻石数量'],
['pass_status', 0, '周奖励状态'],
['season_status', 0, '赛季奖励状态'],
['first_gift', 0, '首充礼包领取状态'],
['sum_coin', 0, '累计充值金额'],
['recharge_times_total', 0, '累计充值次数'],
['first_login', 0, '是否第一次登陆'],
['daily_first_login', 0, '每天是否第一次登陆'],
['vip_score', 0, 'vip积分'],
['coin_nums', 0, '角色金币'],
['diamond_nums', 0, '钻石数量'],
['free_box', 0, '每日免费宝箱'],
['season_games', 0, '赛季场次总数'],
['season_win', 0, '赛季胜利场次'],
['sea_max_kill', 0, '赛季最高击杀'],
['sea_max_hart', 0, '赛季最高伤害'],
['sea_avg_kill', 0, '赛季场均淘汰'],
['free_dou_lot_ticket', 0, '免费十倍抽奖券'],
['free_lot_ticket', 0, '免费抽奖券'],
['time', 0, '当前时间'],
['newhand', 0, '新手奖励状态'],
['coin_times', 0, '角色金币'],
['newInfo', 0, '新手引导信息'],
['first_day_ad', 0, '每日看广告次数'],
['integral', 0, '角色积分'],
['share_video_times', 0, '每日分享视频次数'],
['share_video_sums', 0, '分享录频次数'],
['act_video_status', 0, '分享录频奖励领取状态'],
['act_ad_status', 0, '观看广告奖励领取状态'],
['biogame_times', 0, '生化模式场次'],
['shop_view_times', 0, '商店看广告次数'],
['new_first_equip', 0, '新玩家结算武器'],
['newhand2', 0, '新手奖励状态'],
['game_times2', 0, '精英礼包战斗场次'],
['view_times2', 0, '精英礼包视频场次'],
['guildcoin_num', 0, '战队货币'],
['new_second_equip', 0, '新玩家隔天结算武器'],
['rmb_num', 0, '点券数量'],
['max_single_recharge', 0, '最大单次充值数量'],
['passcard', 0, '购买进阶手册状态'],
['rmb_lot_ticket', 0, '充值券数量'],
['daily_max_single', 0, '每日最大单次充值数量'],
['head_kuang_id', 0, '头像框id'],
['daily_score', 0, '每日经验'],
['score', 0, '通行证积分'],
['daily_offline', 0, '每日额外离线奖励次数'],
['user_name', '', '用户名字'],
['avatar_url', '', '头像'],
['create_user', 0, '是否创角'],
['sex', 0, '性别'],
['lv', 0, '等级'],
['lv_exp', 0, '经验'],
['hiid', 0, '头像ID'],
['hero_id', 0, '当前使用的英雄ID'],
['max_seasonScore', 0, '最高积分'],
]
class UserInfo(object):
def __init__(self):
@ -173,24 +98,6 @@ class RobotMetaInfo(object):
['avatar_url', 0, '机器人头像'],
]
class DropItemInfo(object):
def __init__(self):
self.fields = [
['item_id', 0, '道具id'],
['item_num', 0, '道具数量'],
['time', 0, '时间'],
]
class RewardItemInfo(object):
def __init__(self):
self.fields = [
['item_id', 0, '道具id'],
['item_num', 0, '道具数量'],
['time', 0, '时间'],
]
class Award(object):
def __init__(self):

View File

@ -1,877 +1,9 @@
<?php
require 'classes/AddReward.php';
require_once 'metatable/shop.php';
require_once 'metatable/shopGoods.php';
require_once 'metatable/parameter.php';
require_once('mt/Parameter.php');
require_once('mt/Drop.php');
require_once('mt/Item.php');
class ShopController extends BaseAuthedController {
protected function getItemEx(&$g_conf_item_cluster, $item_id)
{
$item_conf = getItemConfig($g_conf_item_cluster, $item_id);
$it = array(
'id' => $item_conf['id'],
'price' => $item_conf['gold'],
'dprice' => $item_conf['diamond_price'],
'discount' => $item_conf['discount'],
'shop_type' => $item_conf['shop_type'],
'type' => $item_conf['fuction'],
'bug_groupnum' => $item_conf['bug_groupnum'],
'shop_list' => $item_conf['shop_list'],
'bug_groupnum' => $item_conf['bug_groupnum'],
'Isbug_again' => $item_conf['Isbug_again'],
);
return $it;
}
protected function readRecActDB($account_id) {
$conn = $this->_getMysql($account_id);
$row = $conn->execQueryOne('SELECT blobdata FROM recharge_activity WHERE accountid=:accountid;',
array(
':accountid' => $account_id
));
if (!empty($row)) {
$rec_db_str = $row['blobdata'];
$rec_db = json_decode($rec_db_str, true);
return $rec_db;
} else {
return null;
}
}
protected function saveRecActDB($account_id, $rec_db) {
$conn = $this->_getMysql($account_id);
$row = $conn->execQueryOne('SELECT accountid FROM recharge_activity WHERE accountid=:accountid;',
array(
':accountid' => $account_id
));
$rec_db_str = "";
if (!empty($rec_db)) {
$rec_db_str = json_encode($rec_db);
}
if (!empty($row)) {
//update
$row = $conn->execScript('UPDATE recharge_activity SET blobdata=:blobdata, modify_time=:modify_time WHERE accountid=:accountid;',
array(
':accountid' => $account_id,
':blobdata' => $rec_db_str,
':modify_time' => phpcommon\getNowTime()
));
} else {
//insert
$row = $conn->execScript('INSERT INTO recharge_activity(accountid, blobdata, create_time, modify_time) ' .
' VALUES(:account_id, :blobdata, :create_time, :modify_time) ' .
' ON DUPLICATE KEY UPDATE accountid=:account_id, blobdata=:blobdata, modify_time=:modify_time;',
array(
':account_id' => $account_id,
':blobdata' => $rec_db_str,
':create_time' => phpcommon\getNowTime(),
':modify_time' => phpcommon\getNowTime(),
));
}
}
protected function readShopDB($account_id) {
$conn = $this->_getMysql($account_id);
$row = $conn->execQueryOne('SELECT blobdata FROM shop_data WHERE accountid=:accountid;',
array(
':accountid' => $account_id
));
if (!empty($row)) {
$shop_db_str = $row['blobdata'];
$shop_db = json_decode($shop_db_str, true);
return $shop_db;
} else {
return null;
}
}
protected function saveShopDB($account_id, $shop_db) {
$conn = $this->_getMysql($account_id);
$beginTick = phpcommon\getTickCount();
$row = $conn->execQueryOne('SELECT accountid FROM shop_data WHERE accountid=:accountid;',
array(
':accountid' => $account_id
));
$shop_db_str = "";
if (!empty($shop_db)) {
$shop_db_str = json_encode($shop_db);
}
if (!empty($row)) {
//update
$row = $conn->execScript('UPDATE shop_data SET blobdata=:blobdata, modify_time=:modify_time WHERE accountid=:accountid;',
array(
':accountid' => $account_id,
':blobdata' => $shop_db_str,
':modify_time' => phpcommon\getNowTime()
));
} else {
//insert
$row = $conn->execScript('INSERT INTO shop_data(accountid, blobdata, create_time, modify_time) ' .
' VALUES(:account_id, :blobdata, :create_time, :modify_time) ' .
' ON DUPLICATE KEY UPDATE accountid=:account_id, blobdata=:blobdata, modify_time=:modify_time;',
array(
':account_id' => $account_id,
':blobdata' => $shop_db_str,
':create_time' => phpcommon\getNowTime(),
':modify_time' => phpcommon\getNowTime(),
));
}
}
//新版商店
public function newShopInfo()
{
$account_id = $_REQUEST['account_id'];
$conn = $this->_getMysql($account_id);
$new_shop_uuid = 'game2005api_shop_uuid_new:' . $_REQUEST['account_id'];
//商店信息
$this->getNewShopInfo($new_shop_uuid, $account_id);
$user_db = $this->readShopDB($account_id);
echo json_encode(array(
'errcode' => 0,
'errmsg'=> '',
'shop_uuid' => $new_shop_uuid,
'active_time' => $user_db['active_time'],
'act_list' => $user_db['act_list'],
'free_list' => $user_db['free_list'],
'sel_list' => $user_db['sel_list'],
'equ_list' => $user_db['equ_list'],
'clo_list' => $user_db['clo_list'],
'item_list' => $user_db['item_list'],
'guild_list' => $user_db['guild_list'],
'recharge_list' => $user_db['recharge_list'],
'tequan1_list' => $user_db['tequan1_list'],
'tequan2_list' => $user_db['tequan2_list'],
'tequan3_list' => $user_db['tequan3_list'],
'zhandui1_list' => $user_db['zhandui1_list'],
'zhandui2_list' => $user_db['zhandui2_list'],
'zhandui3_list' => $user_db['zhandui3_list'],
'zhandui4_list' => $user_db['zhandui4_list'],
'zhandui5_list' => $user_db['zhandui5_list'],
));
}
protected function getNewShopInfo($shop_uuid, $account_id)
{
$act_list = array();
$free_list = array();
$sel_list = array();
$equ_list = array();
$clo_list = array();
$item_list = array();
$guild_list = array();
$recharge_list = array();
$tequan1_list = array();
$tequan2_list = array();
$tequan3_list = array();
$zhandui1_list = array();
$zhandui2_list = array();
$zhandui3_list = array();
$zhandui4_list = array();
$zhandui5_list = array();
$user_db = $this->readShopDB($account_id);
$shop_conf = metatable\getShopConf();
if (!$shop_conf) {
phpcommon\sendError(ERR_USER_BASE + 1,'session失效');
return;
}
$active_time = 0;
if (empty($user_db)) {
$act_list = $this->getShopListInfo(1);
$free_list = $this->getShopListInfo(2);
$sel_list = $this->getShopListInfo(3);
$equ_list = $this->getShopListInfo(4);
$clo_list = $this->getShopListInfo(5);
$item_list = $this->getShopListInfo(6);
$guild_list = $this->getShopListInfo(7);
$recharge_list = $this->getShopListInfo(8);
$tequan1_list = $this->getShopListInfo(9);
$tequan2_list = $this->getShopListInfo(10);
$tequan3_list = $this->getShopListInfo(11);
$zhandui1_list = $this->getShopListInfo(21);
$zhandui2_list = $this->getShopListInfo(22);
$zhandui3_list = $this->getShopListInfo(23);
$zhandui4_list = $this->getShopListInfo(24);
$zhandui5_list = $this->getShopListInfo(25);
$active_time = phpcommon\getNowTime();
} else {
$act_list = $user_db['act_list'];
$free_list = $user_db['free_list'];
$sel_list = $user_db['sel_list'];
$equ_list = $user_db['equ_list'];
$clo_list = $user_db['clo_list'];
$item_list = $user_db['item_list'];
$guild_list = $user_db['guild_list'];
$recharge_list = $user_db['recharge_list'];
$tequan1_list = $user_db['tequan1_list'];
$tequan2_list = $user_db['tequan2_list'];
$tequan3_list = $user_db['tequan3_list'];
$active_time = $user_db['active_time'];
$zhandui1_list =$user_db['zhandui1_list'];
$zhandui2_list = $user_db['zhandui2_list'];
$zhandui3_list = $user_db['zhandui3_list'];
$zhandui4_list = $user_db['zhandui4_list'];
$zhandui5_list = $user_db['zhandui5_list'];
$nowTime = phpcommon\getdayseconds(phpcommon\getNowTime());
$passed_days = floor(($nowTime - phpcommon\getdayseconds($user_db['active_time'])) / (3600 * 24));
//$passed_days = 2;
if ($passed_days >= 1) {
for ($i = 1; $i <= 25; $i++) {
if (!isset($shop_conf[$i]) || $shop_conf[$i]['isrefresh'] == 0) {
continue;
}
if ($shop_conf[$i]['shop_id'] == 1) {
$act_list = $this->getShopListInfo(1);
} else if($shop_conf[$i]['shop_id'] == 2) {
$free_list = $this->getShopListInfo(2);
} else if($shop_conf[$i]['shop_id'] == 3) {
$sel_list = $this->getShopListInfo(3);
} else if($shop_conf[$i]['shop_id'] == 4) {
$equ_list = $this->getShopListInfo(4);
} else if($shop_conf[$i]['shop_id'] == 5) {
$clo_list = $this->getShopListInfo(5);
} else if($shop_conf[$i]['shop_id'] == 6) {
$item_list = $this->getShopListInfo(6);
} else if ($shop_conf[$i]['shop_id'] == 7) {
$guild_list = $this->getShopListInfo(7);
} else if ($shop_conf[$i]['shop_id'] == 8) {
$recharge_list = $this->getShopListInfo(8);
} else if ($shop_conf[$i]['shop_id'] == 9) {
$tequan1_list = $this->getShopListInfo(9);
} else if ($shop_conf[$i]['shop_id'] == 10) {
$tequan2_list = $this->getShopListInfo(10);
} else if ($shop_conf[$i]['shop_id'] == 11) {
$tequan3_list = $this->getShopListInfo(11);
} else if ($shop_conf[$i]['shop_id'] == 21) {
$zhandui1_list = $this->getShopListInfo(21);
} else if ($shop_conf[$i]['shop_id'] == 22) {
$zhandui2_list = $this->getShopListInfo(22);
} else if ($shop_conf[$i]['shop_id'] == 23) {
$zhandui3_list = $this->getShopListInfo(23);
} else if ($shop_conf[$i]['shop_id'] == 24) {
$zhandui4_list = $this->getShopListInfo(24);
} else if ($shop_conf[$i]['shop_id'] == 25) {
$zhandui5_list = $this->getShopListInfo(25);
}
}
$active_time = $nowTime;
}
}
$shop_db = array(
'shop_uuid' => $shop_uuid,
'active_time' => $active_time,
'act_list' => $act_list,
'free_list' => $free_list,
'sel_list' => $sel_list,
'equ_list' => $equ_list,
'clo_list' => $clo_list,
'item_list' => $item_list,
'guild_list' => $guild_list,
'recharge_list' => $recharge_list,
'tequan1_list' => $tequan1_list,
'tequan2_list' => $tequan2_list,
'tequan3_list' => $tequan3_list,
'zhandui1_list' => $zhandui1_list,
'zhandui2_list' => $zhandui2_list,
'zhandui3_list' => $zhandui3_list,
'zhandui4_list' => $zhandui4_list,
'zhandui5_list' => $zhandui5_list,
);
$this->saveShopDB($account_id, $shop_db);
}
protected function getShopListInfo($id)
{
$shop_conf = metatable\getShopById($id);
if (!$shop_conf) {
return array();
}
$act_shop_list = $this->randomNewShop($id);
$act_list = array(
'id' => $shop_conf['shop_id'],
'isdorefresh' => $shop_conf['isdorefresh'],
'hasrefreshnum' => 0,
'refreshnum' => $shop_conf['refreshnum'],
'shop_list' => $act_shop_list,
);
return $act_list;
}
protected function randomNewShop($id)
{
$shop_list = array();
$shop_conf = metatable\getShopById($id);
if (!$shop_conf) {
return array();
}
if ($id == 8) {
return metatable\shopGoodsList($shop_conf, $shop_list);
} else {
return metatable\randGoods($shop_conf, $shop_list);
}
}
public function flushShopItem()
{
$account_id = $_REQUEST['account_id'];
$id = $_REQUEST['id'];
$type = $_REQUEST['type'];
$shop_type = $_REQUEST['shop_type'];
if ($shop_type == 0) {
$this->flushNormalShop($account_id, $id, $type);
}
if ($shop_type == 1) {
$this->flushRecShop($account_id, $id);
}
$addreward = new classes\AddReward();
$rmb_num = $addreward->getRmbNum($account_id);
echo json_encode(array(
'errcode' => 0,
'errmsg'=> '',
'rmb_nums' => $rmb_num,
));
}
protected function flushNormalShop($account_id, $id, $type)
{
$conn = $this->_getMysql($account_id);
$user_db = $this->readShopDB($account_id);
if (empty($user_db) || !$user_db) {
phpcommon\sendError(ERR_USER_BASE + 2,'没有这个商品');
return;
}
if ($user_db[$type]['refreshnum'] != '') {
if ($user_db[$type]['refreshnum'] <= $user_db[$type]['hasrefreshnum']) {
phpcommon\sendError(ERR_USER_BASE + 3,'刷新次数已达上限');
return;
}
}
$cost = metatable\getParameterByName('shop_refresh') + metatable\getParameterByName('shop_refresh_add') * $user_db[$type]['hasrefreshnum'];
$row = $conn->execQueryOne('SELECT rmb_num FROM user WHERE accountid=:accountid;',
array(
':accountid' => $account_id
));
if ($row['rmb_num'] < $cost) {
phpcommon\sendError(ERR_USER_BASE + 4,'点券不足');
return;
}
$ret = $conn->execScript('UPDATE user SET rmb_num=:rmb_num, modify_time=:modify_time ' .
' WHERE accountid=:account_id;',
array(
':account_id' => $account_id,
':rmb_num' => $row['rmb_num'] - $cost,
':modify_time' => phpcommon\getNowTime()
));
if (!$ret) {
die();
return;
}
$shop_list = $this->randomNewShop($id);
$user_db[$type]['shop_list'] = $shop_list;
$user_db[$type]['hasrefreshnum']++;
$this->saveShopDB($account_id, $user_db);
}
protected function flushRecShop($account_id, $id)
{
$conn = $this->_getMysql($account_id);
$user_db = $this->readRecActDB($account_id);
if (!$user_db || empty($user_db)) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
return;
}
foreach ($user_db['shop_list'] as &$us) {
if (!isset($us['id']) || $us['id'] != $id) {
continue;
}
if ($us['reward']['refreshnum'] != '') {
if ($us['reward']['refreshnum'] <= $us['reward']['hasrefreshnum']) {
phpcommon\sendError(ERR_USER_BASE + 3,'刷新次数已达上限');
return;
}
}
$cost = metatable\getParameterByName('shop_refresh') + metatable\getParameterByName('shop_refresh_add') * $us['reward']['hasrefreshnum'];
$row = $conn->execQueryOne('SELECT rmb_num FROM user WHERE accountid=:accountid;',
array(
':accountid' => $account_id
));
if ($row['rmb_num'] < $cost) {
phpcommon\sendError(ERR_USER_BASE + 4,'点券不足');
return;
}
$ret = $conn->execScript('UPDATE user SET rmb_num=:rmb_num, modify_time=:modify_time ' .
' WHERE accountid=:account_id;',
array(
':account_id' => $account_id,
':rmb_num' => $row['rmb_num'] - $cost,
':modify_time' => phpcommon\getNowTime()
));
$shop_list = $this->randomNewShop($us['reward']['id']);
$us['reward']['shop_list'] = $shop_list;
$us['reward']['hasrefreshnum']++;
break;
}
$this->saveRecActDB($account_id, $user_db);
}
public function newBuyShopItem()
{
$account_id = $_REQUEST['account_id'];
$id = $_REQUEST['id'];
$type = $_REQUEST['type'];
$num = $_REQUEST['num'];
$user_db = $this->readShopDB($account_id);
$redis_goods = $this->getGoodsDiscount($id, $type, $user_db);
$shop_conf = metatable\getShopById($type);
if (!$shop_conf || !$redis_goods) {
phpcommon\sendError(ERR_USER_BASE + 2,'没有这个商品');
return;
}
if ($redis_goods['status'] == 1) {
phpcommon\sendError(ERR_USER_BASE + 4,'商品已购买');
return;
}
$price = $redis_goods['price'] * $num;
if ($redis_goods['isdiscount']) {
$price = ceil($price * $redis_goods['dis_num'] / 100);
}
$item_conf = mt\Item::getOldItem($id);
$item_fuctionindex = $item_conf['fuctionindex'];
$drop_conf = mt\Drop::getOldDrop($item_fuctionindex);
if (!$item_conf) {
phpcommon\sendError(ERR_USER_BASE + 5,'没有这个道具');
return;
}
//扣除货币
$addreward = new classes\AddReward();
if ($redis_goods['buy'] != 3 && $shop_conf['isvipprice'] == 1) {
$val = $addreward->getVipVal($account_id, 2);
$price = floor($price - $price * $val / 100);
}
if ($redis_goods['buy'] != 0) {
$this->subCoin($price, $account_id, $redis_goods['buy'], $shop_conf['istodayad']);
}
//增加奖励
$addreward = new classes\AddReward();
$item_list = array();
$all_item_list = array();
if ($item_conf['type'] == 13) {
$item_list = $this->getRandomShopReward($item_fuctionindex);
foreach ($item_list as $it) {
$item_id = $it['item_id'];
$num = $it['item_num'];
$time = 0;
$items = $addreward->addReward($item_id, $num, $account_id, $time,0);
foreach($items as $j) {
array_push($all_item_list, array(
'item_id' => $j['item_id'],
'item_num' => $j['item_num'],
'time' => $j['time'],
));
}
}
} else {
array_push($item_list,array(
'item_id' => $redis_goods['id'],
'item_num' => $num,
'time' => 0,
));
$items = $addreward->addReward($redis_goods['id'], $num, $account_id, 0, 0);
foreach($items as $j) {
array_push($all_item_list, array(
'item_id' => $j['item_id'],
'item_num' => $j['item_num'],
'time' => $j['time'],
));
}
}
//修改购买状态
if ($shop_conf['isrepeat'] == 0) {
$this->updateShopRedis($account_id, $id, $type, $user_db);
}
$coin_num = $addreward->getCoinNum($account_id);
$rmb_num = $addreward->getRmbNum($account_id);
$guildcoin_num = $addreward->getGuildcoinNum($account_id);
echo json_encode(array(
'errcode' => 0,
'errmsg'=> '',
'coin_nums' => $coin_num,
'item_list' => $item_list,
'all_item_list' => $all_item_list,
'id' => $id,
'rmb_nums' => $rmb_num,
'guildcoin_num' => $guildcoin_num,
));
}
protected function getRandomShopReward($drop_id)
{
$airReward_list = array();
//随机奖励
$d = mt\Drop::getOldDrop($drop_id);
if (!$d) {
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励');
die();
}
$item_id_array = $this->_getExplode($d['item_id']);
$item_num_array = $this->_getExplode($d['num']);
$weight_array = $this->_getExplode($d['weight']);
if ($d['type'] == 2) {
$weight_sum = 0;
$keys = 0;
for ($i = 0; $i < count($weight_array); $i++) {
$weight_sum += $weight_array[$i][0];
}
$random = Rand(0, $weight_sum);
$weight = 0;
for ($i = 0; $i < count($weight_array); $i++) {
$weight += $weight_array[$i][0];
if ($weight > $random) {
$keys = $i;
break;
}
}
$item_id = $item_id_array[$keys][0];
$item_num = $item_num_array[$keys][0];
array_push($airReward_list, array(
'item_id' => $item_id,
'item_num' => $item_num,
'time' => 0,
));
}
if ($d['type'] == 1) {
for ($i = 0; $i < count($weight_array); $i++) {
$random = Rand(0, 10000);
if ($weight_array[$i][0] < $random) {
continue;
}
array_push($airReward_list, array(
'item_id' => $item_id_array[$i][0],
'item_num' => $item_num_array[$i][0],
'time' => 0,
));
}
}
return $airReward_list;
}
protected function updateShopRedis($account_id, $id, $type, $user_db)
{
if ($type == 1) {
foreach ($user_db['act_list']['shop_list'] as &$re) {
if ($re['id'] == $id) {
$re['status'] = 1;
break;
}
}
} else if ($type == 2) {
foreach ($user_db['free_list']['shop_list'] as &$re) {
if ($re['id'] == $id) {
$re['status'] = 1;
break;
}
}
} else if ($type == 3) {
foreach ($user_db['sel_list']['shop_list'] as &$re) {
if ($re['id'] == $id) {
$re['status'] = 1;
break;
}
}
} else if ($type == 4) {
foreach ($user_db['equ_list']['shop_list'] as &$re) {
if ($re['id'] == $id) {
$re['status'] = 1;
break;
}
}
} else if ($type == 5) {
foreach ($user_db['clo_list']['shop_list'] as &$re) {
if ($re['id'] == $id) {
$re['status'] = 1;
break;
}
}
} else if ($type == 6) {
foreach ($user_db['item_list']['shop_list'] as &$re) {
if ($re['id'] == $id) {
$re['status'] = 1;
break;
}
}
}
$this->saveShopDB($account_id, $user_db);
}
protected function getGoodsDiscount($id, $type, $user_db)
{
if ($type == 1) {
foreach ($user_db['act_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 2) {
foreach ($user_db['free_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 3) {
foreach ($user_db['sel_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 4) {
foreach ($user_db['equ_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 5) {
foreach ($user_db['clo_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 6) {
foreach ($user_db['item_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 7) {
foreach ($user_db['guild_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 8) {
foreach ($user_db['recharge_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 9) {
foreach ($user_db['tequan1_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 10) {
foreach ($user_db['tequan2_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 11) {
foreach ($user_db['tequan3_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 21) {
foreach ($user_db['zhandui1_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 22) {
foreach ($user_db['zhandui2_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 23) {
foreach ($user_db['zhandui3_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 24) {
foreach ($user_db['zhandui4_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
} else if ($type == 25) {
foreach ($user_db['zhandui5_list']['shop_list'] as $re) {
if ($re['id'] == $id) {
return $re;
}
}
}
return null;
}
public function shopBuyMore()
{
$account_id = $_REQUEST['account_id'];
$id = $_REQUEST['id'];
$type = $_REQUEST['type'];
$num = $_REQUEST['num'];
$conn = $this->_getMysql($account_id);
$i = mt\Item::getOldItem($id);
$price = 0;
if ($i['shop_type'] == 1) {
$row_c = $conn->execQueryOne('SELECT * FROM shop WHERE accountid=:accountid AND coin_id=:id;',
array(
':accountid' => $account_id,
':id' => $id
));
$price = $i['price'] * $num;
if ($row_c) {
$price = round($i['price'] * $num * $row_c['coin_discount'] / 10);
}
$this->SubCoin($price, $account_id, 1, 0);
} else if ($i['shop_type'] == 2) {
$price = $i['dprice'] * $num;
$row_d = $conn->execQueryOne('SELECT * FROM shop WHERE accountid=:accountid AND diamond_id=:id;',
array(
':accountid' => $account_id,
':id' => $id
));
if ($row_d) {
$price = round($i['dprice'] * $num * $row_d['diamond_discount'] / 10);
}
$this->SubCoin($price, $account_id, 2, 0);
} else if ($i['shop_type'] == 3) {
if ($type == 0) {
$row_c = $conn->execQueryOne('SELECT * FROM shop WHERE accountid=:accountid AND coin_id=:id;',
array(
':accountid' => $account_id,
':id' => $id
));
$price = $i['price'] * $num;
if ($row_c) {
$price = round($i['price'] * $num * $row_c['coin_discount'] / 10);
}
$this->SubCoin($price, $account_id, 1, 0);
} else if ($type == 1) {
$price = $i['dprice'] * $num;
$row_d = $conn->execQueryOne('SELECT * FROM shop WHERE accountid=:accountid AND diamond_id=:id;',
array(
':accountid' => $account_id,
':id' => $id
));
if ($row_d) {
$price = round($i['dprice'] * $num * $row_d['diamond_discount'] / 10);
}
$this->SubCoin($price, $account_id, 2, 0);
}
}
//增加奖励
$addreward = new classes\AddReward();
$all_item_list = $addreward->addReward($id, $num, $account_id, 0, 0);
$coin_num = $addreward->getCoinNum($account_id);
$rmb_num = $addreward->getRmbNum($account_id);
$item_list = array();
array_push($item_list,array(
'item_id' => $id,
'item_num' => $num,
'time' => 0,
));
echo json_encode(array(
'errcode' => 0,
'errmsg'=> '',
'coin_nums' => $coin_num,
'rmb_nums' => $rmb_num,
'item_list' => $item_list,
'all_item_list' => $all_item_list
));
}
protected function subCoin($coin_num, $account_id, $tips, $isview)
{
$conn = $this->_getMysql($account_id);
$rowCoin = $conn->execQueryOne('SELECT coin_num, guildcoin_num, shop_view_times, first_day_ad, rmb_num FROM user WHERE accountid=:accountid;',
array(
':accountid' => $account_id
));
if ($tips == 1) {
//扣除货币
if ($rowCoin['coin_num'] < $coin_num) {
phpcommon\sendError(ERR_USER_BASE + 3, '金币不足');
die();
return;
}
$ret = $conn->execScript('UPDATE user SET coin_num=:coin_num, modify_time=:modify_time ' .
' WHERE accountid=:accountid;',
array(
':accountid' => $account_id,
':coin_num' => $rowCoin['coin_num'] - $coin_num,
':modify_time' => phpcommon\getNowTime()
));
if (!$ret) {
die();
}
}
if ($tips == 2 || $tips == 5) {
//扣除货币
if ($rowCoin['rmb_num'] < $coin_num) {
phpcommon\sendError(ERR_USER_BASE + 9, '点券不足');
die();
return;
}
$ret = $conn->execScript('UPDATE user SET rmb_num=:rmb_num, modify_time=:modify_time ' .
' WHERE accountid=:accountid;',
array(
':accountid' => $account_id,
':rmb_num' => $rowCoin['rmb_num'] - $coin_num,
':modify_time' => phpcommon\getNowTime()
));
if (!$ret) {
die();
}
}
if ($tips == 3) {
if ($isview == 1) {
if ($rowCoin['first_day_ad'] < $coin_num) {
phpcommon\sendError(ERR_USER_BASE + 7, '每日视频次数不足');
die();
return;
}
} else {
if ($rowCoin['shop_view_times'] < $coin_num) {
phpcommon\sendError(ERR_USER_BASE + 6, '视频次数不足');
die();
return;
}
}
}
if ($tips == 4) {
if ($rowCoin['guildcoin_num'] < $coin_num) {
phpcommon\sendError(ERR_USER_BASE + 8, '战队货币不足');
die();
return;
}
$ret = $conn->execScript('UPDATE user SET guildcoin_num=:guildcoin_num, modify_time=:modify_time ' .
' WHERE accountid=:accountid;',
array(
':accountid' => $account_id,
':guildcoin_num' => $rowCoin['guildcoin_num'] - $coin_num,
':modify_time' => phpcommon\getNowTime()
));
if (!$ret) {
die();
}
}
}
}
?>