每日任务迭代
This commit is contained in:
parent
ed9b26bae7
commit
3b3d8d1c69
298
doc/Mission.py
298
doc/Mission.py
@ -1,137 +1,161 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import _common
|
||||
|
||||
class Mission(object):
|
||||
|
||||
def __init__(self):
|
||||
self.apis = [
|
||||
{
|
||||
'name': 'missionList',
|
||||
'desc': '获取任务列表',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=missionList',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['type', 0, '任务类型(!!!注意这里的类型和任务表里的任务不是一回事) 1:每日任务 2:赛季周任务 3:悬赏任务'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['current_day_active_value', 0, '当前日活跃度'],
|
||||
['current_week_active_value', 0, '当前周活跃度'],
|
||||
['day_active_limit', 0, '每日活跃度上限'],
|
||||
['week_active_limit', 0, '每周活跃度上限'],
|
||||
['day_time_end', 0, '每日活动结算时间'],
|
||||
['week_time_end', 0, '每周活动结算时间'],
|
||||
['!mission_list1', [_common.Mission()], '任务列表1'],
|
||||
['!mission_list2', [_common.Mission()], '任务列表2'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'sendOfferRewardMission',
|
||||
'desc': '派遣悬赏任务',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=sendOfferRewardMission',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['mission_id', 0, '任务id'],
|
||||
['objects', '', '悬赏任务对象列表type:id|']
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['award', _common.Award(), '奖励信息'],
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
['mission_chg', _common.Mission(), '任务的最新信息(可能为null客户端需要做容错处理)'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'cancelOfferRewardMission',
|
||||
'desc': '撤销派遣悬赏任务',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=cancelOfferRewardMission',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['mission_id', 0, '任务id'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['award', _common.Award(), '奖励信息'],
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'boostOfferRewardMissionPreview',
|
||||
'desc': '加速悬赏任务',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=boostOfferRewardMissionPreview',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['mission_id', 0, '任务id'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['boost_chg', 0, '加速所需ceg'],
|
||||
]
|
||||
},{
|
||||
'name': 'boostOfferRewardMission',
|
||||
'desc': '加速悬赏任务',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=boostOfferRewardMission',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['mission_id', 0, '任务id'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['award', _common.Award(), '奖励信息'],
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
['mission_chg', _common.Mission(), '任务的最新信息(可能为null客户端需要做容错处理)'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'offerRewardMissionPreview',
|
||||
'desc': '悬赏任务奖励预览',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=boostOfferRewardMission',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['mission_id', 0, '任务id'],
|
||||
['objects', '', '悬赏任务对象列表type:id|']
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['!data', _common.AwardItem(), '奖励信息'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'commitMission',
|
||||
'desc': '提交任务(领取奖励)',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=commitMission',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['mission_id', 0, '任务id'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['award', _common.Award(), '奖励信息'],
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
['mission_chg', _common.Mission(), '任务的最新信息(可能为null客户端需要做容错处理)'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'commitAll',
|
||||
'desc': '提交所有任务(全部领取)',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=commitAll',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['types', [0], '任务类型数组'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['award', _common.Award(), '奖励信息'],
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
]
|
||||
},
|
||||
]
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import _common
|
||||
|
||||
class Mission(object):
|
||||
|
||||
def __init__(self):
|
||||
self.apis = [
|
||||
{
|
||||
'name': 'missionList',
|
||||
'desc': '获取任务列表',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=missionList',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['type', 0, '任务类型(!!!注意这里的类型和任务表里的任务不是一回事) 1:每日任务 2:赛季周任务 3:悬赏任务'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['current_day_active_value', 0, '当前日活跃度'],
|
||||
['current_week_active_value', 0, '当前周活跃度'],
|
||||
['day_active_limit', 0, '每日活跃度上限'],
|
||||
['week_active_limit', 0, '每周活跃度上限'],
|
||||
['day_time_end', 0, '每日活动结算时间'],
|
||||
['week_time_end', 0, '每周活动结算时间'],
|
||||
['!mission_list1', [_common.Mission()], '任务列表1'],
|
||||
['!mission_list2', [_common.Mission()], '任务列表2'],
|
||||
['refreshInfo', RefreshInfo(), '刷新任务信息'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'sendOfferRewardMission',
|
||||
'desc': '派遣悬赏任务',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=sendOfferRewardMission',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['mission_id', 0, '任务id'],
|
||||
['objects', '', '悬赏任务对象列表type:id|']
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['award', _common.Award(), '奖励信息'],
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
['mission_chg', _common.Mission(), '任务的最新信息(可能为null客户端需要做容错处理)'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'cancelOfferRewardMission',
|
||||
'desc': '撤销派遣悬赏任务',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=cancelOfferRewardMission',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['mission_id', 0, '任务id'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['award', _common.Award(), '奖励信息'],
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'boostOfferRewardMissionPreview',
|
||||
'desc': '加速悬赏任务',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=boostOfferRewardMissionPreview',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['mission_id', 0, '任务id'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['boost_chg', 0, '加速所需ceg'],
|
||||
]
|
||||
},{
|
||||
'name': 'boostOfferRewardMission',
|
||||
'desc': '加速悬赏任务',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=boostOfferRewardMission',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['mission_id', 0, '任务id'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['award', _common.Award(), '奖励信息'],
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
['mission_chg', _common.Mission(), '任务的最新信息(可能为null客户端需要做容错处理)'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'offerRewardMissionPreview',
|
||||
'desc': '悬赏任务奖励预览',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=boostOfferRewardMission',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['mission_id', 0, '任务id'],
|
||||
['objects', '', '悬赏任务对象列表type:id|']
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['!data', _common.AwardItem(), '奖励信息'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'commitMission',
|
||||
'desc': '提交任务(领取奖励)',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=commitMission',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['mission_id', 0, '任务id'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['award', _common.Award(), '奖励信息'],
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
['mission_chg', _common.Mission(), '任务的最新信息(可能为null客户端需要做容错处理)'],
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'commitAll',
|
||||
'desc': '提交所有任务(全部领取)',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=commitAll',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['types', [0], '任务类型数组'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['award', _common.Award(), '奖励信息'],
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
]
|
||||
},{
|
||||
'name': 'refreshMissionList',
|
||||
'desc': '刷新任务',
|
||||
'group': 'Mission',
|
||||
'url': 'webapp/index.php?c=Mission&a=refreshMissionList',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
class RefreshInfo(object):
|
||||
|
||||
def __init__(self):
|
||||
self.fields = [
|
||||
['refreshTimes', 0, '当前刷新次数'],
|
||||
['maxRefreshTimes', 0, '最大刷新次数'],
|
||||
['item_id', 0, '消耗道具id'],
|
||||
['item_num', 0, '消耗道具数量'],
|
||||
]
|
@ -1,120 +1,121 @@
|
||||
<?php
|
||||
|
||||
define('TEAMID_KEY', 'team_uuid:');
|
||||
define('RANKING_KEY', 'game2006api:');
|
||||
define('DAILY_SELECTION_KEY', 'game2006api:daily_selection:');
|
||||
define('PLANET_BUY_KEY', 'game2006api:planet_buy:');
|
||||
|
||||
define('LAST_SESSION_KEY', 'last_session:');
|
||||
|
||||
define('V_ITEM_GOLD', 10001); //金币
|
||||
define('V_ITEM_DIAMOND', 10014); //钻石
|
||||
define('V_ITEM_EXP', 10003); //经验
|
||||
define('V_ITEM_ACTIVE', 10004); //活跃度
|
||||
define('V_ITEM_BCEG', 10010); //BCEG
|
||||
define('V_ITEM_STAR', 10011); //星星
|
||||
define('V_ITEM_PASS', 10012); //通行证
|
||||
define('V_ITEM_RESET_CARD', 10013); //重置卡
|
||||
define('V_ITEM_REVIVE_COIN', 140001); //复活币
|
||||
define('V_ITEM_HERO_META', 100005); //英雄升级材料
|
||||
define('V_ITEM_GUN_META', 100006); //枪械升级材料
|
||||
define('V_ITEM_CHIP_META', 100007); //芯片升级材料
|
||||
|
||||
define('TN_BEGIN', 8001);
|
||||
define('TN_ACTIVE', 8002);
|
||||
define('TN_SHOP', 8003);
|
||||
define('TN_RECHARGE_UPGRADE_TIMES', 8004);
|
||||
define('TN_SHARE_GAMES', 8005);
|
||||
define('TN_HERO_LEVEL_UP', 8006);
|
||||
define('TN_END', 8007);
|
||||
define('TN_HERO_MAX_LEVEL', 8008);
|
||||
define('TN_LAST_RANKING_TIME', 8009);
|
||||
define('TN_MISSION_STAR_SEASON', 8010);
|
||||
define('TN_RANK_STATUS', 8011);
|
||||
define('TN_FIRST_TUPOP_STATUS', 8012);
|
||||
define('TN_TOTAL_KILLS_NUM', 8013);
|
||||
define('TN_TOTAL_STAR_NUM', 8014);
|
||||
define('TN_TOTAL_RANK_NUM', 8015);
|
||||
define('TN_TOTAL_DIAMOND_CONSUME', 8016);//钻石消耗
|
||||
define('TN_TOTAL_CEG_CONSUME', 8017);//ceg消耗
|
||||
|
||||
define('TN_DAILY_BEGIN', 9001);
|
||||
define('TN_DAILY_LOGINS', 9001);
|
||||
define('TN_DAILY_ACTIVE', 9002);
|
||||
define('TN_DAILY_SHOP', 9003);
|
||||
define('TN_DAILY_RECHARGE_UPGRADE_TIMES', 9004);
|
||||
define('TN_DAILY_SHARE_GAMES', 9005);
|
||||
define('TN_DAILY_PVE_BATTLE_TIMES', 9006);
|
||||
define('TN_DAILY_PVE_GET_FRAGMENT_NUM', 9007);
|
||||
define('TN_DAILY_PVP_BATTLE_TIMES', 9008);
|
||||
define('TN_DAILY_PVP_GET_FRAGMENT_NUM', 9009);
|
||||
define('TN_DAILY_PVE_LAST_GET_FRAGMENT_BATTLE', 9010);
|
||||
define('TN_DAILY_RANK_BATTLE_TIMES', 9011);
|
||||
define('TN_DAILY_END', 9011);
|
||||
define('TN_DAILY_PVE_GET_HERO_FRAGMENT_NUM', 9012);
|
||||
define('TN_DAILY_PVE_GET_GUN_FRAGMENT_NUM', 9013);
|
||||
define('TN_DAILY_COMPLETE_TASK_NUM', 9014);
|
||||
define('TN_DAILY_USED_GOLD_NUM', 9015);
|
||||
define('TN_DAILY_GET_STAR_NUM', 9016);
|
||||
define('TN_DAILY_BUY_PASS_STATE', 9017);
|
||||
define('TN_DAILY_BUY_LEVEL_STATE', 9018);
|
||||
define('TN_DAILY_RESET_HERO_LEVEL_STATE', 9019);
|
||||
|
||||
define('TN_WEEKLY_BEGIN', 10001);
|
||||
define('TN_WEEKLY_ACTIVE', 10002);
|
||||
define('TN_WEEKLY_SHOP', 10003);
|
||||
define('TN_WEEKLY_RECHARGE_UPGRADE_TIMES', 10004);
|
||||
define('TN_WEEKLY_SHARE_GAMES', 10005);
|
||||
define('TN_WEEKLY_END', 10005);
|
||||
|
||||
define('SHOP_BUY_MODE_NORMAL', 0);
|
||||
define('SHOP_BUY_MODE_DAILY_SELECTION', 1);
|
||||
define('MARKET_BUY_MODE_NORMAL', 2);
|
||||
|
||||
const kHAT_Begin = 0;
|
||||
const kHAT_Hp = 1;
|
||||
const kHAT_HPRecover = 2;
|
||||
const kHAT_Atk = 3;
|
||||
const kHAT_Def = 4;
|
||||
const kHAT_Speed = 5;
|
||||
const kHAT_ShotRange = 6;
|
||||
const kHAT_ShotSpeed = 7;
|
||||
const kHAT_ReloadSpeed = 8;
|
||||
const kHAT_FireRate = 9;
|
||||
const kHAT_Volume = 10;
|
||||
const kHAT_MaxHp = 11;
|
||||
const kHAT_ShotView = 12;
|
||||
const kHAT_View = 13;
|
||||
const kHAT_ReloadTime = 14;
|
||||
|
||||
const kHAT_WeaponDmg = 20;
|
||||
const kHAT_WeaponShotSpeed = 21;
|
||||
const kHAT_WeaponReloadTime = 22;
|
||||
const kHAT_WeaponExplosionRange = 23;
|
||||
const kHAT_WeaponExplosionContinueTime = 24;
|
||||
const kHAT_PoisoningReduction = 25;
|
||||
const kHAT_RescueTime = 26;
|
||||
const kHAT_DrugTime = 27;
|
||||
const kHAT_DrugEfficacy = 28;
|
||||
const kHAT_CarOil = 29;
|
||||
const kHAT_WeaponExplosionDealyTime = 30;
|
||||
const kHAT_RecoverHpAdd = 31;
|
||||
const kHAT_SkillTime = 32;
|
||||
const kHAT_WeaponThrowRange = 33;
|
||||
const kHAT_LUCKY = 34;
|
||||
const kHAT_Critical = 42;
|
||||
const kHAT_CriDamage = 43;
|
||||
const kHAT_Dodge = 44;
|
||||
const kHAT_Ruduce = 45;
|
||||
const kHAT_BrainLifePct = 47;
|
||||
const kHAT_BulletSpeed = 49;
|
||||
const kHAT_BulletSpeedPct = 50;
|
||||
|
||||
const kHAT_ABS_VAL = 1;
|
||||
const kHAT_RATE_VAL = 2;
|
||||
|
||||
const kWantedLockType = 3;
|
||||
|
||||
const kMaxHeroUpLevelNum = 2;
|
||||
const kMaxHeroUpQualityNum = 2;
|
||||
const kMaxEmojiNum = 6;
|
||||
<?php
|
||||
|
||||
define('TEAMID_KEY', 'team_uuid:');
|
||||
define('RANKING_KEY', 'game2006api:');
|
||||
define('DAILY_SELECTION_KEY', 'game2006api:daily_selection:');
|
||||
define('PLANET_BUY_KEY', 'game2006api:planet_buy:');
|
||||
|
||||
define('LAST_SESSION_KEY', 'last_session:');
|
||||
|
||||
define('V_ITEM_GOLD', 10001); //金币
|
||||
define('V_ITEM_DIAMOND', 10014); //钻石
|
||||
define('V_ITEM_EXP', 10003); //经验
|
||||
define('V_ITEM_ACTIVE', 10004); //活跃度
|
||||
define('V_ITEM_BCEG', 10010); //BCEG
|
||||
define('V_ITEM_STAR', 10011); //星星
|
||||
define('V_ITEM_PASS', 10012); //通行证
|
||||
define('V_ITEM_RESET_CARD', 10013); //重置卡
|
||||
define('V_ITEM_REVIVE_COIN', 140001); //复活币
|
||||
define('V_ITEM_HERO_META', 100005); //英雄升级材料
|
||||
define('V_ITEM_GUN_META', 100006); //枪械升级材料
|
||||
define('V_ITEM_CHIP_META', 100007); //芯片升级材料
|
||||
|
||||
define('TN_BEGIN', 8001);
|
||||
define('TN_ACTIVE', 8002);
|
||||
define('TN_SHOP', 8003);
|
||||
define('TN_RECHARGE_UPGRADE_TIMES', 8004);
|
||||
define('TN_SHARE_GAMES', 8005);
|
||||
define('TN_HERO_LEVEL_UP', 8006);
|
||||
define('TN_END', 8007);
|
||||
define('TN_HERO_MAX_LEVEL', 8008);
|
||||
define('TN_LAST_RANKING_TIME', 8009);
|
||||
define('TN_MISSION_STAR_SEASON', 8010);
|
||||
define('TN_RANK_STATUS', 8011);
|
||||
define('TN_FIRST_TUPOP_STATUS', 8012);
|
||||
define('TN_TOTAL_KILLS_NUM', 8013);
|
||||
define('TN_TOTAL_STAR_NUM', 8014);
|
||||
define('TN_TOTAL_RANK_NUM', 8015);
|
||||
define('TN_TOTAL_DIAMOND_CONSUME', 8016);//钻石消耗
|
||||
define('TN_TOTAL_CEG_CONSUME', 8017);//ceg消耗
|
||||
|
||||
define('TN_DAILY_BEGIN', 9001);
|
||||
define('TN_DAILY_LOGINS', 9001);
|
||||
define('TN_DAILY_ACTIVE', 9002);
|
||||
define('TN_DAILY_SHOP', 9003);
|
||||
define('TN_DAILY_RECHARGE_UPGRADE_TIMES', 9004);
|
||||
define('TN_DAILY_SHARE_GAMES', 9005);
|
||||
define('TN_DAILY_PVE_BATTLE_TIMES', 9006);
|
||||
define('TN_DAILY_PVE_GET_FRAGMENT_NUM', 9007);
|
||||
define('TN_DAILY_PVP_BATTLE_TIMES', 9008);
|
||||
define('TN_DAILY_PVP_GET_FRAGMENT_NUM', 9009);
|
||||
define('TN_DAILY_PVE_LAST_GET_FRAGMENT_BATTLE', 9010);
|
||||
define('TN_DAILY_RANK_BATTLE_TIMES', 9011);
|
||||
define('TN_DAILY_END', 9011);
|
||||
define('TN_DAILY_PVE_GET_HERO_FRAGMENT_NUM', 9012);
|
||||
define('TN_DAILY_PVE_GET_GUN_FRAGMENT_NUM', 9013);
|
||||
define('TN_DAILY_COMPLETE_TASK_NUM', 9014);
|
||||
define('TN_DAILY_USED_GOLD_NUM', 9015);
|
||||
define('TN_DAILY_GET_STAR_NUM', 9016);
|
||||
define('TN_DAILY_BUY_PASS_STATE', 9017);
|
||||
define('TN_DAILY_BUY_LEVEL_STATE', 9018);
|
||||
define('TN_DAILY_RESET_HERO_LEVEL_STATE', 9019);
|
||||
define('TN_DAILY_REFRESH_MISSION_TIMES', 9020);
|
||||
|
||||
define('TN_WEEKLY_BEGIN', 10001);
|
||||
define('TN_WEEKLY_ACTIVE', 10002);
|
||||
define('TN_WEEKLY_SHOP', 10003);
|
||||
define('TN_WEEKLY_RECHARGE_UPGRADE_TIMES', 10004);
|
||||
define('TN_WEEKLY_SHARE_GAMES', 10005);
|
||||
define('TN_WEEKLY_END', 10005);
|
||||
|
||||
define('SHOP_BUY_MODE_NORMAL', 0);
|
||||
define('SHOP_BUY_MODE_DAILY_SELECTION', 1);
|
||||
define('MARKET_BUY_MODE_NORMAL', 2);
|
||||
|
||||
const kHAT_Begin = 0;
|
||||
const kHAT_Hp = 1;
|
||||
const kHAT_HPRecover = 2;
|
||||
const kHAT_Atk = 3;
|
||||
const kHAT_Def = 4;
|
||||
const kHAT_Speed = 5;
|
||||
const kHAT_ShotRange = 6;
|
||||
const kHAT_ShotSpeed = 7;
|
||||
const kHAT_ReloadSpeed = 8;
|
||||
const kHAT_FireRate = 9;
|
||||
const kHAT_Volume = 10;
|
||||
const kHAT_MaxHp = 11;
|
||||
const kHAT_ShotView = 12;
|
||||
const kHAT_View = 13;
|
||||
const kHAT_ReloadTime = 14;
|
||||
|
||||
const kHAT_WeaponDmg = 20;
|
||||
const kHAT_WeaponShotSpeed = 21;
|
||||
const kHAT_WeaponReloadTime = 22;
|
||||
const kHAT_WeaponExplosionRange = 23;
|
||||
const kHAT_WeaponExplosionContinueTime = 24;
|
||||
const kHAT_PoisoningReduction = 25;
|
||||
const kHAT_RescueTime = 26;
|
||||
const kHAT_DrugTime = 27;
|
||||
const kHAT_DrugEfficacy = 28;
|
||||
const kHAT_CarOil = 29;
|
||||
const kHAT_WeaponExplosionDealyTime = 30;
|
||||
const kHAT_RecoverHpAdd = 31;
|
||||
const kHAT_SkillTime = 32;
|
||||
const kHAT_WeaponThrowRange = 33;
|
||||
const kHAT_LUCKY = 34;
|
||||
const kHAT_Critical = 42;
|
||||
const kHAT_CriDamage = 43;
|
||||
const kHAT_Dodge = 44;
|
||||
const kHAT_Ruduce = 45;
|
||||
const kHAT_BrainLifePct = 47;
|
||||
const kHAT_BulletSpeed = 49;
|
||||
const kHAT_BulletSpeedPct = 50;
|
||||
|
||||
const kHAT_ABS_VAL = 1;
|
||||
const kHAT_RATE_VAL = 2;
|
||||
|
||||
const kWantedLockType = 3;
|
||||
|
||||
const kMaxHeroUpLevelNum = 2;
|
||||
const kMaxHeroUpQualityNum = 2;
|
||||
const kMaxEmojiNum = 6;
|
||||
|
@ -18,6 +18,7 @@ require_once('services/PropertyChgService.php');
|
||||
require_once('services/SeasonService.php');
|
||||
require_once('services/MissionService.php');
|
||||
require_once('services/FormulaService.php');
|
||||
require_once('services/LogService.php');
|
||||
|
||||
use phpcommon\SqlHelper;
|
||||
use models\User;
|
||||
@ -26,6 +27,7 @@ use models\Mission;
|
||||
use models\Season;
|
||||
use models\Hero;
|
||||
use models\Gun;
|
||||
use services\LogService;
|
||||
|
||||
class MissionController extends BaseAuthedController {
|
||||
|
||||
@ -102,6 +104,22 @@ class MissionController extends BaseAuthedController {
|
||||
//// $specMissionDto['state'] = Mission::RECEIVEABLE_STATE;
|
||||
// $specMissionDto['state'] = 9636;
|
||||
// }
|
||||
|
||||
//刷新任务所需
|
||||
{
|
||||
$refreshTimes = $this->_getDailyV(TN_DAILY_REFRESH_MISSION_TIMES, 0);
|
||||
$maxRefreshTimes = mt\Parameter::getVal('task_refresh_max', 0);
|
||||
$taskCostParam = explode("|",mt\Parameter::getVal('task_refresh_cost', 10));
|
||||
|
||||
$key = min($refreshTimes,count($taskCostParam)-1);
|
||||
|
||||
$refreshInfo = array(
|
||||
"refreshTimes" =>$refreshTimes,
|
||||
"maxRefreshTimes" =>$maxRefreshTimes,
|
||||
"item_id" =>V_ITEM_GOLD,
|
||||
"item_num" =>$taskCostParam[$key],
|
||||
);
|
||||
}
|
||||
$this->_rspData(array(
|
||||
'current_day_active_value' => min($this->_getDailyV(TN_DAILY_ACTIVE, 0), mt\Parameter::getVal('activeness_limit', 0)),
|
||||
'current_week_active_value' => min($this->_getWeeklyV(TN_WEEKLY_ACTIVE, 0), mt\Parameter::getVal('max_weekly', 0)),
|
||||
@ -110,7 +128,8 @@ class MissionController extends BaseAuthedController {
|
||||
'day_time_end' => $this->_getDaySeconds(time())+3600*24,
|
||||
'week_time_end' => $this->_getMondaySeconds() + 7*24*3600,
|
||||
'mission_list1' => $missionDtoList1,
|
||||
'mission_list2' => $missionDtoList2
|
||||
'mission_list2' => $missionDtoList2,
|
||||
'refreshInfo' => $refreshInfo
|
||||
));
|
||||
}
|
||||
|
||||
@ -325,6 +344,7 @@ class MissionController extends BaseAuthedController {
|
||||
$this->propertyChgService);
|
||||
}
|
||||
|
||||
|
||||
private function procSpecMissionCommit($missionDto, $missionMeta)
|
||||
{
|
||||
switch ($missionMeta['type']) {
|
||||
@ -363,4 +383,67 @@ class MissionController extends BaseAuthedController {
|
||||
}
|
||||
}
|
||||
|
||||
public function refreshMissionList()
|
||||
{
|
||||
|
||||
$missionMetaList = mt\Task::getCustomTypeMetaList(0, $this->missionService);
|
||||
$missionHash = Mission::allToHash();
|
||||
$missionDtoList = array();
|
||||
$refreshList = array();
|
||||
$specMissionDto = null;
|
||||
$num =1;
|
||||
foreach ($missionMetaList as $missionMeta) {
|
||||
$num ++;
|
||||
$missionDb = getXVal($missionHash, $missionMeta['id'], null);
|
||||
$missionDto = $this->missionService->getMissionDto(
|
||||
$this->userInfo, $this->seasonDb, $missionDb, $missionMeta);
|
||||
array_push($missionDtoList, $num);
|
||||
if ($missionDto['state'] == Mission::NOT_FINISHED_STATE) {
|
||||
array_push($refreshList, $missionDto['mission_id']);
|
||||
}
|
||||
}
|
||||
// //任务全完成不刷新
|
||||
|
||||
//刷新次数上限不刷新
|
||||
$refreshTimes = $this->_getDailyV(TN_DAILY_REFRESH_MISSION_TIMES, 0);
|
||||
$maxRefreshTimes = mt\Parameter::getVal('task_refresh_max', 0);
|
||||
if ($refreshTimes >= $maxRefreshTimes || count($refreshList) < 1){
|
||||
$this->_rspErr(1, 'Unable to refresh');
|
||||
return;
|
||||
}
|
||||
//消耗不足不刷新
|
||||
$taskCostParam = explode("|",mt\Parameter::getVal('task_refresh_cost', 10));
|
||||
$key = min($refreshTimes,count($taskCostParam)-1);
|
||||
$costNum = $taskCostParam[$key];
|
||||
$costItems = array(
|
||||
array(
|
||||
'item_id' => V_ITEM_GOLD,
|
||||
'item_num' => $costNum
|
||||
),
|
||||
);
|
||||
$lackItem = null;
|
||||
if (!$this->_hasEnoughItems($costItems, $lackItem)) {
|
||||
$this->_rspErr(3, $this->_getLackItemErrMsg($lackItem));
|
||||
return;
|
||||
}
|
||||
foreach ($refreshList as $value){
|
||||
$this->missionService->updateDailyRewardMission($value);
|
||||
}
|
||||
|
||||
$this->_incDailyV(TN_DAILY_REFRESH_MISSION_TIMES, 0,1);
|
||||
$this->_decItems($costItems);
|
||||
{
|
||||
//埋点
|
||||
$event = [
|
||||
'name' => LogService::REFRESH_MISSION,
|
||||
'val' => $costNum
|
||||
];
|
||||
LogService::consumeGold($event);
|
||||
}
|
||||
$this->propertyChgService->addUserChg();
|
||||
$this->_rspData(array(
|
||||
'property_chg' => $this->propertyChgService->toDto(),
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,235 +1,236 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace services;
|
||||
|
||||
require_once('phpcommon/tglog.php');
|
||||
|
||||
require_once('models/User.php');
|
||||
|
||||
use mt;
|
||||
use models\User;
|
||||
use phpcommon\TGLog;
|
||||
class LogService extends BaseService
|
||||
{
|
||||
const USER_RENAME = "user_rename"; //用户改名
|
||||
const HERO_LEVEL_UP = "hero_level_Up"; //英雄升级
|
||||
const CHIP_LEVEL_UP = "chip_level_Up"; //芯片升级
|
||||
const BUY_BATTLE_PASS = "buy_battle_pass"; //通行证购买
|
||||
const BUY_PASS_EXP = "buy_pass_exp"; //购买通行证经验
|
||||
const BUY_HERO_AVATAR = "buy_hero_avatar"; //购买英雄装饰
|
||||
|
||||
const SHOP_BUY_ITEM = "shop_buy_item_normal"; //商城购买物品
|
||||
const SHOP_BUY_ITEM_DAILY = "shop_buy_item_daily"; //商城每日精选购买物品
|
||||
const SHOP_BUY_ITEM_BLIND_BOX = "shop_buy_item_blind_box"; //商城限购购买物品
|
||||
|
||||
const CONSUME_TYPE = 0; //消耗 ↑
|
||||
const PRODUCT_TYPE = 1; //产出 ↓
|
||||
|
||||
const BATTLE_AWARD_PVP = "battle_award_pvp"; //PVP战斗奖励
|
||||
const STAR_MISSION_AWARD = "star_mission_award"; //星星之路奖励
|
||||
const BATTLE_PASS_AWARD = "battle_pass_award"; //通行证奖励
|
||||
const SIGN_AWARD = "sign_award"; //签到奖励
|
||||
|
||||
const CEBG_TO_DIAMOND = "cebg_to_diamond"; //CEBG兑换钻石
|
||||
const RECHARGE_DIAMOND = "recharge_diamond"; //充值钻石
|
||||
const RECHARGE_CEBG_BONUS = "recarge_cebg_bonus"; //充值CEBG奖励
|
||||
|
||||
const MARKET_SELL_GOLD = "market_sell_gold"; //市场出售金币
|
||||
const MARKET_CANCEL_SELL_GOLD = "market_cancel_sell_gold"; //市场取消出售金币
|
||||
const MARKET_BUY_GOLD = "market_buy_gold"; //市场购买金币
|
||||
|
||||
const PRONAME = 'game_2006_api';
|
||||
const GAMEID = 2006;
|
||||
|
||||
const GOLD_TYPE = 0;
|
||||
const DIAMOND_TYPE = 1;
|
||||
|
||||
public static function consumeGold($event,$param = [])
|
||||
{
|
||||
$logInfo = self::goldRecord($param);
|
||||
$data = self::userInfo();
|
||||
$data['type'] = self::CONSUME_TYPE;
|
||||
$data['event_name'] = $event['name'];
|
||||
$data['event_type'] = self::GOLD_TYPE;
|
||||
$data['event_demand'] = 'gold';
|
||||
$data['event_demand_val'] = $event['val'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
|
||||
public static function consumeDiamond($event,$param = [])
|
||||
{
|
||||
$logInfo = self::diamondRecord(myself()->_getAccountId());
|
||||
$data = self::userInfo();
|
||||
$data['type'] = self::CONSUME_TYPE;
|
||||
$data['event_name'] = $event['name'];
|
||||
$data['event_type'] = self::DIAMOND_TYPE;
|
||||
$data['event_demand'] = 'diamond';
|
||||
$data['event_demand_val'] = $event['val'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
|
||||
public static function productGold($event,$param = [])
|
||||
{
|
||||
$logInfo = self::goldRecord($param);
|
||||
$data = self::userInfo();
|
||||
$data['type'] = self::PRODUCT_TYPE;
|
||||
$data['event_name'] = $event['name'];
|
||||
$data['event_type'] = self::GOLD_TYPE;
|
||||
$data['event_product'] = 'gold';
|
||||
$data['event_product_val'] = $event['val'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
public static function productGoldCallback($base, $event,$param = [])
|
||||
{
|
||||
$logInfo = self::goldRecord($base);
|
||||
$data = self::userInfoByAccountId($base['account_id']);
|
||||
$data['type'] = self::PRODUCT_TYPE;
|
||||
$data['event_name'] = $event['name'];
|
||||
$data['event_type'] = self::GOLD_TYPE;
|
||||
$data['event_product'] = 'gold';
|
||||
$data['event_product_val'] = $event['val'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
|
||||
|
||||
public static function productDiamondCallback($base, $event,$param = [])
|
||||
{
|
||||
$logInfo = self::diamondRecord($base['account_id']);
|
||||
$data = self::userInfoByAccountId($base['account_id']);
|
||||
$data['type'] = self::PRODUCT_TYPE;
|
||||
$data['event_name'] = $event['name'];
|
||||
$data['event_type'] = self::DIAMOND_TYPE;
|
||||
$data['event_product'] = 'diamond';
|
||||
$data['event_product_val'] = $event['val'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
|
||||
public static function consumeItem($event,$param = [])
|
||||
{
|
||||
$logInfo = self::ItemRecord();
|
||||
$data = self::userInfo();
|
||||
$data['type'] = self::CONSUME_TYPE;
|
||||
// $data['event_name'] = $event['name'];
|
||||
// $data['event_type'] = self::GOLD_TYPE;
|
||||
$data['item_id'] = $event['item_id'];
|
||||
$data['item_num'] = $event['item_num'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
|
||||
public static function productItem($event,$param = [])
|
||||
{
|
||||
$logInfo = self::ItemRecord();
|
||||
$data = self::userInfo();
|
||||
$data['type'] = self::PRODUCT_TYPE;
|
||||
// $data['event_name'] = $event['name'];
|
||||
// $data['event_type'] = self::GOLD_TYPE;
|
||||
$data['item_id'] = $event['item_id'];
|
||||
$data['item_num'] = $event['item_num'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
|
||||
|
||||
private static function userInfo()
|
||||
{
|
||||
$user = User::find(myself()->_getAccountId());
|
||||
$info = array(
|
||||
'account_id' => myself()->_getAccountId(), //账号id
|
||||
'channel' => myself()->_getChannel(), //账号channel
|
||||
'openid' => myself()->_getOpenId(), //账号openid
|
||||
'adress' => myself()->_getAddress(), //账号openid
|
||||
'name' => $user['name'], //用户名字
|
||||
'rank' => $user['rank'], //段位
|
||||
'gold' => $user['gold'], //金币
|
||||
'diamond' => $user['diamond'], //钻石
|
||||
'account_register_time' => myself()->_getRegisterTime(), //账号注册时间
|
||||
'ip' => $_SERVER['REMOTE_ADDR'], //用户ip
|
||||
'_os' => getReqVal('_os', ''),
|
||||
'_net' => getReqVal('_net', ''),
|
||||
);
|
||||
return $info;
|
||||
}
|
||||
|
||||
private static function userInfoByAccountId($account_id) {
|
||||
$user = User::find($account_id);
|
||||
$info = array(
|
||||
'account_id' => $user['account_id'], //账号id
|
||||
'channel' => $user['channel'], //账号channel
|
||||
'openid' => 'unknown',
|
||||
'adress' => $user['address'], //账号openid
|
||||
'name' => $user['name'], //用户名字
|
||||
'rank' => $user['rank'], //段位
|
||||
'gold' => $user['gold'], //金币
|
||||
'diamond' => $user['diamond'], //钻石
|
||||
'account_register_time' => $user['createtime'], //账号注册时间
|
||||
'ip' => $_SERVER['REMOTE_ADDR'], //用户ip
|
||||
'_os' => getReqVal('_os', ''),
|
||||
'_net' => getReqVal('_net', ''),
|
||||
);
|
||||
return $info;
|
||||
}
|
||||
private static function goldRecord($params = [])
|
||||
{
|
||||
if (isset($params['account_id']) && !empty($params['account_id'])) {
|
||||
$account_id = $params['account_id'];
|
||||
} else {
|
||||
$account_id = myself()->_getAccountId();
|
||||
}
|
||||
|
||||
// $logInfo['log_class'] = $logInfo['log_class'];
|
||||
// unset($logInfo['log_class']);
|
||||
$data = array(
|
||||
"#account_id" => $account_id,
|
||||
"#event_name"=> "gold_record",
|
||||
"#ip"=> $_SERVER['REMOTE_ADDR'],
|
||||
"#time"=> myself()->_getNowTime(),
|
||||
"#type"=> "track",
|
||||
"properties"=>''
|
||||
);
|
||||
return $data;
|
||||
}
|
||||
|
||||
private static function diamondRecord($account_id)
|
||||
{
|
||||
$data = [
|
||||
"#account_id" => $account_id,
|
||||
"#event_name"=> "diamond_record",
|
||||
"#ip"=> $_SERVER['REMOTE_ADDR'],
|
||||
"#time"=> myself()->_getNowTime(),
|
||||
"#type"=> "track",
|
||||
"properties"=>''
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
|
||||
private static function ItemRecord(){
|
||||
$data = [
|
||||
"#account_id" => myself()->_getAccountId(),
|
||||
"#event_name"=> "item_record",
|
||||
"#ip"=> $_SERVER['REMOTE_ADDR'],
|
||||
"#controller"=> getReqVal('c', ''),
|
||||
"#artion"=> getReqVal('a', ''),
|
||||
"#time"=> myself()->_getNowTime(),
|
||||
"#type"=> "track",
|
||||
"properties"=>''
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
|
||||
namespace services;
|
||||
|
||||
require_once('phpcommon/tglog.php');
|
||||
|
||||
require_once('models/User.php');
|
||||
|
||||
use mt;
|
||||
use models\User;
|
||||
use phpcommon\TGLog;
|
||||
class LogService extends BaseService
|
||||
{
|
||||
const USER_RENAME = "user_rename"; //用户改名
|
||||
const HERO_LEVEL_UP = "hero_level_Up"; //英雄升级
|
||||
const CHIP_LEVEL_UP = "chip_level_Up"; //芯片升级
|
||||
const BUY_BATTLE_PASS = "buy_battle_pass"; //通行证购买
|
||||
const BUY_PASS_EXP = "buy_pass_exp"; //购买通行证经验
|
||||
const BUY_HERO_AVATAR = "buy_hero_avatar"; //购买英雄装饰
|
||||
const REFRESH_MISSION = "refresh_mission"; //刷新每日任务
|
||||
|
||||
const SHOP_BUY_ITEM = "shop_buy_item_normal"; //商城购买物品
|
||||
const SHOP_BUY_ITEM_DAILY = "shop_buy_item_daily"; //商城每日精选购买物品
|
||||
const SHOP_BUY_ITEM_BLIND_BOX = "shop_buy_item_blind_box"; //商城限购购买物品
|
||||
|
||||
const CONSUME_TYPE = 0; //消耗 ↑
|
||||
const PRODUCT_TYPE = 1; //产出 ↓
|
||||
|
||||
const BATTLE_AWARD_PVP = "battle_award_pvp"; //PVP战斗奖励
|
||||
const STAR_MISSION_AWARD = "star_mission_award"; //星星之路奖励
|
||||
const BATTLE_PASS_AWARD = "battle_pass_award"; //通行证奖励
|
||||
const SIGN_AWARD = "sign_award"; //签到奖励
|
||||
|
||||
const CEBG_TO_DIAMOND = "cebg_to_diamond"; //CEBG兑换钻石
|
||||
const RECHARGE_DIAMOND = "recharge_diamond"; //充值钻石
|
||||
const RECHARGE_CEBG_BONUS = "recarge_cebg_bonus"; //充值CEBG奖励
|
||||
|
||||
const MARKET_SELL_GOLD = "market_sell_gold"; //市场出售金币
|
||||
const MARKET_CANCEL_SELL_GOLD = "market_cancel_sell_gold"; //市场取消出售金币
|
||||
const MARKET_BUY_GOLD = "market_buy_gold"; //市场购买金币
|
||||
|
||||
const PRONAME = 'game_2006_api';
|
||||
const GAMEID = 2006;
|
||||
|
||||
const GOLD_TYPE = 0;
|
||||
const DIAMOND_TYPE = 1;
|
||||
|
||||
public static function consumeGold($event,$param = [])
|
||||
{
|
||||
$logInfo = self::goldRecord($param);
|
||||
$data = self::userInfo();
|
||||
$data['type'] = self::CONSUME_TYPE;
|
||||
$data['event_name'] = $event['name'];
|
||||
$data['event_type'] = self::GOLD_TYPE;
|
||||
$data['event_demand'] = 'gold';
|
||||
$data['event_demand_val'] = $event['val'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
|
||||
public static function consumeDiamond($event,$param = [])
|
||||
{
|
||||
$logInfo = self::diamondRecord(myself()->_getAccountId());
|
||||
$data = self::userInfo();
|
||||
$data['type'] = self::CONSUME_TYPE;
|
||||
$data['event_name'] = $event['name'];
|
||||
$data['event_type'] = self::DIAMOND_TYPE;
|
||||
$data['event_demand'] = 'diamond';
|
||||
$data['event_demand_val'] = $event['val'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
|
||||
public static function productGold($event,$param = [])
|
||||
{
|
||||
$logInfo = self::goldRecord($param);
|
||||
$data = self::userInfo();
|
||||
$data['type'] = self::PRODUCT_TYPE;
|
||||
$data['event_name'] = $event['name'];
|
||||
$data['event_type'] = self::GOLD_TYPE;
|
||||
$data['event_product'] = 'gold';
|
||||
$data['event_product_val'] = $event['val'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
public static function productGoldCallback($base, $event,$param = [])
|
||||
{
|
||||
$logInfo = self::goldRecord($base);
|
||||
$data = self::userInfoByAccountId($base['account_id']);
|
||||
$data['type'] = self::PRODUCT_TYPE;
|
||||
$data['event_name'] = $event['name'];
|
||||
$data['event_type'] = self::GOLD_TYPE;
|
||||
$data['event_product'] = 'gold';
|
||||
$data['event_product_val'] = $event['val'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
|
||||
|
||||
public static function productDiamondCallback($base, $event,$param = [])
|
||||
{
|
||||
$logInfo = self::diamondRecord($base['account_id']);
|
||||
$data = self::userInfoByAccountId($base['account_id']);
|
||||
$data['type'] = self::PRODUCT_TYPE;
|
||||
$data['event_name'] = $event['name'];
|
||||
$data['event_type'] = self::DIAMOND_TYPE;
|
||||
$data['event_product'] = 'diamond';
|
||||
$data['event_product_val'] = $event['val'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
|
||||
public static function consumeItem($event,$param = [])
|
||||
{
|
||||
$logInfo = self::ItemRecord();
|
||||
$data = self::userInfo();
|
||||
$data['type'] = self::CONSUME_TYPE;
|
||||
// $data['event_name'] = $event['name'];
|
||||
// $data['event_type'] = self::GOLD_TYPE;
|
||||
$data['item_id'] = $event['item_id'];
|
||||
$data['item_num'] = $event['item_num'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
|
||||
public static function productItem($event,$param = [])
|
||||
{
|
||||
$logInfo = self::ItemRecord();
|
||||
$data = self::userInfo();
|
||||
$data['type'] = self::PRODUCT_TYPE;
|
||||
// $data['event_name'] = $event['name'];
|
||||
// $data['event_type'] = self::GOLD_TYPE;
|
||||
$data['item_id'] = $event['item_id'];
|
||||
$data['item_num'] = $event['item_num'];
|
||||
|
||||
$logInfo['properties'] = array_merge($data,$param);
|
||||
TGLog::writeToLog(self::PRONAME,self::GAMEID,$logInfo);
|
||||
}
|
||||
|
||||
|
||||
private static function userInfo()
|
||||
{
|
||||
$user = User::find(myself()->_getAccountId());
|
||||
$info = array(
|
||||
'account_id' => myself()->_getAccountId(), //账号id
|
||||
'channel' => myself()->_getChannel(), //账号channel
|
||||
'openid' => myself()->_getOpenId(), //账号openid
|
||||
'adress' => myself()->_getAddress(), //账号openid
|
||||
'name' => $user['name'], //用户名字
|
||||
'rank' => $user['rank'], //段位
|
||||
'gold' => $user['gold'], //金币
|
||||
'diamond' => $user['diamond'], //钻石
|
||||
'account_register_time' => myself()->_getRegisterTime(), //账号注册时间
|
||||
'ip' => $_SERVER['REMOTE_ADDR'], //用户ip
|
||||
'_os' => getReqVal('_os', ''),
|
||||
'_net' => getReqVal('_net', ''),
|
||||
);
|
||||
return $info;
|
||||
}
|
||||
|
||||
private static function userInfoByAccountId($account_id) {
|
||||
$user = User::find($account_id);
|
||||
$info = array(
|
||||
'account_id' => $user['account_id'], //账号id
|
||||
'channel' => $user['channel'], //账号channel
|
||||
'openid' => 'unknown',
|
||||
'adress' => $user['address'], //账号openid
|
||||
'name' => $user['name'], //用户名字
|
||||
'rank' => $user['rank'], //段位
|
||||
'gold' => $user['gold'], //金币
|
||||
'diamond' => $user['diamond'], //钻石
|
||||
'account_register_time' => $user['createtime'], //账号注册时间
|
||||
'ip' => $_SERVER['REMOTE_ADDR'], //用户ip
|
||||
'_os' => getReqVal('_os', ''),
|
||||
'_net' => getReqVal('_net', ''),
|
||||
);
|
||||
return $info;
|
||||
}
|
||||
private static function goldRecord($params = [])
|
||||
{
|
||||
if (isset($params['account_id']) && !empty($params['account_id'])) {
|
||||
$account_id = $params['account_id'];
|
||||
} else {
|
||||
$account_id = myself()->_getAccountId();
|
||||
}
|
||||
|
||||
// $logInfo['log_class'] = $logInfo['log_class'];
|
||||
// unset($logInfo['log_class']);
|
||||
$data = array(
|
||||
"#account_id" => $account_id,
|
||||
"#event_name"=> "gold_record",
|
||||
"#ip"=> $_SERVER['REMOTE_ADDR'],
|
||||
"#time"=> myself()->_getNowTime(),
|
||||
"#type"=> "track",
|
||||
"properties"=>''
|
||||
);
|
||||
return $data;
|
||||
}
|
||||
|
||||
private static function diamondRecord($account_id)
|
||||
{
|
||||
$data = [
|
||||
"#account_id" => $account_id,
|
||||
"#event_name"=> "diamond_record",
|
||||
"#ip"=> $_SERVER['REMOTE_ADDR'],
|
||||
"#time"=> myself()->_getNowTime(),
|
||||
"#type"=> "track",
|
||||
"properties"=>''
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
|
||||
private static function ItemRecord(){
|
||||
$data = [
|
||||
"#account_id" => myself()->_getAccountId(),
|
||||
"#event_name"=> "item_record",
|
||||
"#ip"=> $_SERVER['REMOTE_ADDR'],
|
||||
"#controller"=> getReqVal('c', ''),
|
||||
"#artion"=> getReqVal('a', ''),
|
||||
"#time"=> myself()->_getNowTime(),
|
||||
"#type"=> "track",
|
||||
"properties"=>''
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
@ -1447,4 +1447,41 @@ class MissionService extends BaseService {
|
||||
return round($cegNum,2);
|
||||
}
|
||||
|
||||
public function updateDailyRewardMission($missionId)
|
||||
{
|
||||
|
||||
$metas = mt\Task::getDaildyMission();
|
||||
$selectMeta = null;
|
||||
shuffle($metas);
|
||||
foreach ($metas as $meta) {
|
||||
if (!$this->inDailyRewardMission($meta['id'])) {
|
||||
$selectMeta = $meta;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($selectMeta) {
|
||||
foreach ($this->dailyMission['missions'] as $k=>&$mission) {
|
||||
if ($mission['mission_id'] == $missionId) {
|
||||
$mission['mission_id'] = $selectMeta['id'];
|
||||
$mission['createtime'] = myself()->_getNowTime();
|
||||
$mission['modifytime'] = myself()->_getNowTime();
|
||||
$mission['objects'] = array();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->saveDailyMission();
|
||||
}
|
||||
|
||||
private function inDailyRewardMission($missionId)
|
||||
{
|
||||
foreach ($this->dailyMission['missions'] as $mission) {
|
||||
if ($mission['mission_id'] == $missionId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user