cmd) {
case CmdCode::active_day7_drawreward: # 6502 领取七日签到奖励
return self::Day7_DrawReward();
case CmdCode::active_getzonePublicTs: # 6503 查询开服时间戳
return ActiveProc::GetZonePublicTS();
case CmdCode::active_getTodayOnlineInfos: # 6504 查询当天在线时长
return self::getTotayOnlineInfos();
case CmdCode::Task_Tili: # 6508 体力变化
return ActiveProc::RecoveryTili();
case CmdCode::active_token_drawReward: # 6512 兑换码礼包
return self::drawActivePackageByCode();
case CmdCode::active_draw_onlinegift: # 6513 领取在线(时长)礼包
return self::drawOnlineGift();
case CmdCode::active_draw_reggift: # 6514 领取全服注册礼包
return self::drawRegGift();
case CmdCode::active_presentTili: # 6515 领取在线赠送体力
return self::drawTiliGift();
case CmdCode::active_get_regnum: # 6516 查询当前全服注册人数
return self::getRegNumber();
case CmdCode::active_shenmiaoDrawPrize: # 6505 什么抽奖
return self::shenmiaoDrawPrize();
case CmdCode::active_GetShenmiaoData:
return self::GetShenmiaoData();
default:
return Resp::err(ErrCode::cmd_err);
}
}
/**
* 每天重置
*/
static function DailyReset() {
self::DailyResetDay7Task();
self::ClearOnlineGiftTs();
self::ClearDailyTiliGift();
}
//
/**
* 获取神庙的主界面信息
*/
static function GetShenmiaoData() {
$req = req();
//$shenmiaoInfo = $req->userInfo->game->shenmiao;
$shenmiaoInfo = new Info_ShenMiao($req->userInfo->game->shenmiao);
$shenmiaoInfo->initActiveItem();
$req->userInfo->game->shenmiao = $shenmiaoInfo;
UserProc::updateUserInfo();
return Resp::ok(array(# # 返回值
'shenmiaoInfo' => $shenmiaoInfo,
));
}
/**
* 神庙抽奖
*/
static function ShenmiaoDrawPrize() {
$req = req();
list($type,$num) = $req->paras;
$shenmiaoInfo = $req->userInfo->game->shenmiao;
my_Assert(StlUtil::dictHasProperty($shenmiaoInfo->activeDic, $type), ErrCode::active_activeNoExistent);
$list = array();
if(Enum_Active::NewWish == $type){
my_Assert($shenmiaoInfo->activeDic->$type->num < glc()->UserWishNumLimit, ErrCode::active_NewUserActiveNumLimit);
my_Assert($num == 10, ErrCode::active_NewUserActiveNumLimit);
$shenmiaoInfo->activeDic->$type->num += $num;
$shenmiaoInfo->activeDic->$type->totalNum += $num;
$shenmo = GameConfig::shenmiao_getItem($shenmiaoInfo->activeDic->$type->id);
$sList = explode(',', $shenmo->cost);
$costVal = $sList[1];
if($shenmo->discount != 0){
$costVal = $sList[1]*$num*$shenmo->discount/100;
}
StoreProc::removeItemFromStore($req->userInfo->game->store,$sList[0],$costVal);
$tag = false;
$n = 0;
for ($index = 0; $index < $num; $index++) {
$n+=1;
$itemType = self::activeRandom($shenmo->per, $shenmo);
if($itemType >= 2){
$tag = true;
}
if($n==10 && $tag == false && $shenmiaoInfo->activeDic->$type->totalNum > 10){
$list[] =self::getActiveRandomItem(Enum_ActiveItemType::Ssr, $shenmo);//self::randSsrUr($shenmo->per)
} else {
if($shenmiaoInfo->activeDic->$type->totalNum <= 10){
$itemType = Enum_ActiveItemType::Sr;
}
$nId =self::getActiveRandomItem($itemType, $shenmo);
$list[] = $nId;
}
}
if($shenmiaoInfo->activeDic->$type->totalNum == 10 && !in_array($shenmo->must, $list)){//首次10连抽有必出--临时
$list[0] = $shenmo->must;
}
if($shenmiaoInfo->activeDic->$type->totalNum >= glc()->UserWishNumLimit){
$shenmiaoInfo->isComNewWish = 1;
StlUtil::dictRemove($shenmiaoInfo->activeDic, $type);
}
} else if(Enum_Active::OpenWish == $type){
$shenmo = GameConfig::shenmiao_getItem($shenmiaoInfo->activeDic->$type->id);
if($num == 1){
$shenmiaoInfo->activeDic->$type->num += $num;
$sList = explode(',', $shenmo->cost);
StoreProc::removeItemFromStore($req->userInfo->game->store,$sList[0],$sList[1]);
$itemType = self::activeRandom($shenmo->per, $shenmo);
$aid =self::getActiveRandomItem($itemType, $shenmo);
if($shenmiaoInfo->activeDic->$type->num % glc()->Active_UR_Num == 0 && $itemType != Enum_ActiveItemType::Ur){
$aid =self::getActiveRandomItem(Enum_ActiveItemType::Ur, $shenmo);
$list[] = $aid;
} else {
$list[] = $aid;
}
} else {//10连抽
$sList = explode(',', $shenmo->cost);
StoreProc::removeItemFromStore($req->userInfo->game->store,$sList[0],$sList[1]*$num);
$shenmiaoInfo->activeDic->$type->totalNum += $num;
$tag = false;
$n = 0;
for ($index1 = 0; $index1 < $num; $index1++) {
$n+=1;
$itemType = self::activeRandom($shenmo->per, $shenmo);
if($itemType >= 2){
$tag = true;
}
if($n==10 && $tag == false){
$list[] =self::getActiveRandomItem(Enum_ActiveItemType::Ssr, $shenmo);//self::randSsrUr($shenmo->per)
} else {
$list[] =self::getActiveRandomItem($itemType, $shenmo);
}
}
if($shenmiaoInfo->activeDic->$type->totalNum >= glc()->Active_UR_Num){//第90次必得
$aid =self::getActiveRandomItem(Enum_ActiveItemType::Ur, $shenmo);
$list[0] = $aid;
$shenmiaoInfo->activeDic->$type->totalNum = 0;
}
}
} else {//不定期活动
$shenmo = GameConfig::shenmiao_getItem($shenmiaoInfo->activeDic->$type->id);
if($num == 1){
$shenmiaoInfo->activeDic->$type->num += $num;
$sList = explode(',', $shenmo->cost);
StoreProc::removeItemFromStore($req->userInfo->game->store,$sList[0],$sList[1]);
$itemType = self::activeRandom($shenmo->per, $shenmo);
$aid =self::getActiveRandomItem_3($itemType, $shenmo,$type);//随机出的id
if($shenmiaoInfo->activeDic->$type->num% glc()->Active_UR_Num == 0){
$aid =self::getActiveRandomItem_3(Enum_ActiveItemType::Ur, $shenmo,$type);
}
$list[] = $aid;
} else {
$sList = explode(',', $shenmo->cost);
StoreProc::removeItemFromStore($req->userInfo->game->store,$sList[0],$sList[1]*$num);
$shenmiaoInfo->activeDic->$type->totalNum += $num;
$tag = false;
$n = 0;
for ($index1 = 0; $index1 < $num; $index1++) {
$n+=1;
$itemType = self::activeRandom($shenmo->per, $shenmo);
if($itemType >= 2){
$tag = true;
}
if($n==10 && $tag == false){
$list[] =self::getActiveRandomItem_3(Enum_ActiveItemType::Ssr, $shenmo,$type);//self::randSsrUr($shenmo->per)
} else {
$list[] =self::getActiveRandomItem_3($itemType, $shenmo,$type);
}
}
if($shenmiaoInfo->activeDic->$type->totalNum >= glc()->Active_UR_Num){//第90次必得
$aid =self::getActiveRandomItem_3(Enum_ActiveItemType::Ur, $shenmo,$type);
$list[0] = $aid;
$shenmiaoInfo->activeDic->$type->totalNum = 0;
}
}
}
foreach ($list as $id) {
$s = $id.',1';
StoreProc::AddMultiItemInStore($s);
}
$req->userInfo->game->shenmiao = $shenmiaoInfo;
UserProc::updateUserInfo();
return Resp::ok(array(# # 返回值
'shenmiaoInfo' => $shenmiaoInfo,
'list'=>$list,
'store'=>$req->userInfo->game->store,
));
}
/**
*
* @param type $randCtx
* @param sm_shenmiao $mo
* @return int
*/
public static function activeRandom($randCtx,$mo) {
$rand = rand(1,10000);
$type = 1;
$list = explode(',', $randCtx);
$start = 0;
foreach ($list as $val) {
$end = $val + $start;
if($rand > $start && $rand <= $end){
break;
}
$type += 1;
$start = $end;
}
return $type;
}
/**
*
* @param type $arr
* @return type
*/
public static function randList($arr) {
$rand = rand(0, count($arr)-1);
return $arr[$rand];
}
/**
*
* @param type $type
* @param type $mo
* @return type
*/
public static function getActiveRandomItem($type,$mo) {
$id = 0;
switch ($type) {
case Enum_ActiveItemType::Sr:
$id = self::randList(explode(',', $mo->srList));
break;
case Enum_ActiveItemType::Ssr:
$id = self::randList(explode(',', $mo->ssrList));
break;
case Enum_ActiveItemType::Ur:
$id = self::randList(explode(',', $mo->urList));
break;
default:
break;
}
return $id;
}
/**
*
* @param type $type
* @param sm_shenmiao $mo
* @return type
*/
public static function getActiveRandomItem_3($type,$mo,$activeType) {
$shenmiaoInfo = req()->userInfo->game->shenmiao;
$id = 0;
switch ($type) {
case Enum_ActiveItemType::Sr:
$id = self::randList(explode(',', $mo->srList));
break;
case Enum_ActiveItemType::Ssr:
if($mo->ssrUp != null){
$dic = new \stdClass();
$ssrList = explode(';', $mo->ssrUp);
$tNum = 0;
foreach ($ssrList as $val) {
$sList = explode(',', $val);
$sid = $sList[0];
$dic->$sid = $sList[1];
$tNum += $sList[1];
}
if($shenmiaoInfo->activeDic->$activeType->isUpSsr == 1){
$rand = rand(1,$tNum);
$start = 0;
foreach ($dic as $k=>$val) {
$end = $val + $start;
if($rand > $start && $rand <= $end){//随机到Up得id
$id = $k;
break;
}
$start = $end;
}
$shenmiaoInfo->activeDic->$activeType->isUpSsr = 0;
} else {
$rand = rand(1,10000);
$start = 0;
foreach ($dic as $k=>$val) {
$end = $val + $start;
if($rand > $start && $rand <= $end){//随机到Up得id
$id = $k;
break;
} else {//随机到普通的id
$shenmiaoInfo->activeDic->$activeType->isUpSsr = 1;
$id = self::randList(explode(',', $mo->ssrList));
break;
}
$start = $end;
}
}
} else {
$id = self::randList(explode(',', $mo->ssrList));
}
break;
case Enum_ActiveItemType::Ur:
if($mo->ssrUp != null){
$dic = new \stdClass();
$urList = explode(';', $mo->urUp);
$tNum = 0;
foreach ($urList as $val) {
$sList = explode(',', $val);
$sid = $sList[0];
$dic->$sid = $sList[1];
$tNum += $sList[1];
}
if($shenmiaoInfo->activeDic->$activeType->isUpUr == 1){
$rand = rand(1,$tNum);
$start = 0;
foreach ($dic as $k=>$val) {
$end = $val + $start;
if($rand > $start && $rand <= $end){//随机到Up得id
$id = $k;
break;
}
$start = $end;
}
$shenmiaoInfo->activeDic->$activeType->$isUpUr = 0;
} else {
$rand = rand(1,10000);
$start = 0;
foreach ($dic as $k=>$val) {
$end = $val + $start;
if($rand > $start && $rand <= $end){
$id = $k;
break;
} else {
$shenmiaoInfo->activeDic->$activeType->isUpUr = 1;
$id = self::randList(explode(',', $mo->urList));
break;
}
$start = $end;
}
}
} else {
$id = self::randList(explode(',', $mo->urList));
}
break;
default:
break;
}
return $id;
}
/**
* 从SSr 和 uR中得一个
* @param type $param
*/
public static function randSsrUr($randCtx) {
$list = explode(',', $randCtx);
$list = array_splice($list,1);
$total = $list[0]+$list[1];
$rand = rand(1,$total);
$start = 0;
//$type = Enum_ActiveItemType::Ssr;
$type = 2;
foreach ($list as $val) {
$end = $val + $start;
if($rand > $start && $rand <= $end){
break;
}
$type += 1;
$start = $end;
}
return $type;
}
/**
*
* @param type $activeType
* @param type $num
* @param type $shenmo
* @return type
*/
public function DrawLottery($activeType,$num,$shenmo,$maxNum) {
$list = array();
$tag = false;
$n = 0;
for ($index = 0; $index < $num; $index++) {
$n+=1;
$itemType = self::activeRandom($shenmo->per, $shenmo);
if($itemType >= 2){
$tag = true;
}
if($n==10 && $tag == false){
$list[] =self::getActiveRandomItem(Enum_ActiveItemType::Ssr, $mo);
} else {
$list[] =self::getActiveRandomItem($itemType, $mo);
}
}
return $list;
}
/**
* [6515] 领取 赠送体力
*/
static function drawTiliGift() {
$user = ctx();
$privateState = ctx()->privateData();
$base = $user->base();
$hour = date('G');
my_Assert(!in_array($hour, $privateState->dailyDrawedTiliGift), ErrCode::active_hasgetted); # 判断是否已领取
$arr = explode(',', glc()->activity_presentTili_times); # 判断是否满足领取条件
my_Assert(in_array($hour, $arr), ErrCode::active_illegal); # 不满足条件
$base->Add_tili(glc()->activity_presentTili_number); # 增加体力
$privateState->dailyDrawedTiliGift[] = $hour;
UserProc::updateUserInfo(); # 回存
return Resp::ok(array(# # 返回值
'key' => 'ok',
'record' => $privateState->dailyDrawedTiliGift,
'tili' => $base->tili,
'time' => $user->privateState->TiliTime,
));
}
////
//
//
/**
* [6516] 查询当前全服注册人数
*/
static function getRegNumber() {
return Resp::ok(array(
'num' => gMem()->get(MemKey_GameRun::Stat_UserCountByZone_int(req()->zoneid))
));
}
/**
* [6514] 领取全服注册礼包
*/
static function drawRegGift() {
$user = new Data_UserGame(req()->userInfo->game);
$privateState = new Info_PrivateState($user->privateState);
$giftId = req()->paras[0]; # 礼包id
$giftModel = GameConfig::activity_reggift_getItem($giftId); # 取礼包常亮数据
if (null == $giftModel) {
return Resp::err(ErrCode::err_const_no);
}
if (in_array($giftId, $privateState->drawedRegGift)) { # 判断是否已领取
return Resp::err(ErrCode::active_hasgetted);
}
// 判断是否满足领取条件
if (gMem()->get(MemKey_GameRun::Stat_UserCountByZone_int(req()->zoneid)) < $giftModel->regNumber) {
return Resp::err(ErrCode::active_illegal); # 不满足条件
}
$err = StoreProc::AddMultiItemInStore($giftModel->rewardstr); # 发放奖励
if ($err) {
return Resp::err($err); # 失败
}
$privateState->drawedRegGift[] = $giftId;
$user->privateState = $privateState;
req()->userInfo->game = $user;
UserProc::updateUserInfo(); # 回存
return Resp::ok(array(# # 返回值
'key' => 'ok',
'store' => $user->store
));
}
//
//
/**
* 【6504】查询当天在线时长信息
*/
static function getTotayOnlineInfos() {
return Resp::ok(array(
"onlineGiftIDs" => req()->userInfo->game->privateState->onlineGiftIDs,
"onlineGiftts" => req()->userInfo->game->privateState->onlineGiftts
));
}
/**
* [6513] 领取连续在线礼包
*/
static function drawOnlineGift() {
$giftid = req()->paras[0]; # 提取参数: 礼包的编号
$user = ctx();
$privateState = ctx()->privateData();
$giftData = GameConfig::activity_onlinegift_getItem($giftid); # 在线礼包常量数据
my_Assert(null != $giftData, ErrCode::onlinegift_constno_err); # 防御找不到配置数据
my_Assert($privateState->onlineGiftts >= $giftData->onlineSec, # # 时间未到,不可以领取
ErrCode::onlinegift_timenotenough);
my_default_Arr($privateState->onlineGiftIDs); # 防御未初始化领取记录
my_Assert(!in_array($giftid, $privateState->onlineGiftIDs), # # 判断礼包ID是否已经领取
ErrCode::active_hasgetted);
$err = StoreProc::AddMultiItemInStore($giftData->rewardstr); # 发放奖励
my_Assert(ErrCode::ok == $err, $err); # 发放奖励失败
$privateState->onlineGiftIDs[] = $giftid; # 记录已领礼包ID
UserProc::updateUserInfo(); # 回写用户数据
return Resp::ok(array(
'onlineGiftts' => $privateState->onlineGiftts,
'onlineGiftIDs' => $privateState->onlineGiftIDs,
"reward" => $giftData->rewardstr,
'gold' => $user->base()->gold,
'cash' => $user->base()->cash,
'tili' => $user->base()->tili,
'store' => $user->store(),
'hero' => $user->heros()
)); # 设置返回值
}
/**
* 清理/重置 在线礼包时间戳
*/
static private function ClearOnlineGiftTs() {
req()->userInfo->game->privateState->onlineGiftts = 0;
req()->userInfo->game->privateState->onlineGiftIDs = array();
}
//
//
/**
* [6512]凭兑换码领取礼包
*/
static function drawActivePackageByCode() {
$user = new Data_UserGame(req()->userInfo->game);
$privateState = new Info_PrivateState($user->privateState); # 快速访问
list( $activeId, $codestring) = req()->paras; # 取参数 活动id, 兑换码
$active = GameConfig::activity_getItem($activeId); # 活动数据
my_Assert(null != $active, ErrCode::active_const_no_err);
my_Assert($active->startts <= now() && $active->endts >= now(), ErrCode::active_time); # 校验开放时间
my_Assert(preg_match("/^[a-kmnp-z2-9]{10}$/", $codestring), ErrCode::active_activecode_format); # 基础格式校验(10个特定字符)
$activeCode = CipheredBase32::Decode($codestring); # 解码
$codePlatStr = GameConstants::GetPlatStringByActivteCode($activeCode); # platstr
my_Assert(GameConstants::AllPlatStr == $codePlatStr # # 忽略全平台礼包
|| req()->userInfo->getPlatStr() == $codePlatStr, # # 平台字符串必须相符
ErrCode::active_activecode_plat); # # 平台错误
my_Assert(is_int($activeCode->number) # # 编号为int值
&& $activeCode->number >= 1 && $activeCode->number <= 50000, # # 检查 兑换码的编号范围0~50000
ErrCode::active_activecode_format);
$packageID = $activeCode->package; # 礼包id
$packageInfo = GameConfig::tokenGift_getItem($packageID); # 礼包常量数据
my_Assert(null != $packageInfo, ErrCode::err_const_no); # 防御
my_Assert($packageInfo->expirets >= now() && $packageInfo->startTs <= now(),
ErrCode::active_activecode_outtime); # 激活码已经失效,或者礼包尚未开启
my_Assert(!in_array($packageID, $privateState->usedTokens), ErrCode::active_hasgetted); # 已经领取过该礼包了
my_Assert(!self::checkActiveCodeIsUsed($activeCode), ErrCode::active_activecode_used); # 检查 该激活码是否已经使用过了
$err = StoreProc::AddMultiItemInStore($packageInfo->reward); # 发放礼包
my_Assert(ErrCode::ok == $err, $err); # 防御发放礼包过程出错
req()->userInfo->game->privateState->usedTokens[] = $packageID; # 记录领取记录
$ok = self::setActiveCodeUserRecord($activeCode, req()->uid); # 插入数据库
my_Assert($ok, ErrCode::err_db); # 数据库操作失败- 重试
UserProc::updateUserInfo(); # 回存玩家数据
$ret = array(# # 返回值
"plat" => $codePlatStr,
"packageId" => $activeCode->package,
"reward" => $packageInfo->reward,
'gold' => $user->base()->gold,
'cash' => $user->base()->cash,
'tili' => $user->base()->tili,
'store' => $user->store,
'hero' => $user->heros
);
return Resp::ok($ret); # 返回成功信息
}
/**
* 检查兑换码是否已经使用过了
* @param ActiveCode $activeCode
* @return boolean true : 已经用过了, false : 激活码尚未使用过.
*/
static function checkActiveCodeIsUsed($activeCode) {
$sql = sprintf("`plat`='%d' and `package`='%d' and `number`='%d'", # # where 子句
$activeCode->plat, $activeCode->package, $activeCode->number);
$rows = daoInst()
->select()
->from(self::tab_toke_gift) # 表名
->where($sql)
->count();
return $rows > 0;
}
/**
* 将兑换码添加到使用记录中
* @param ActiveCode $actvieCode
* @param string $uid
* @return boolean true: 操作成功, false: 操作失败
*/
static function setActiveCodeUserRecord($actvieCode, $uid) {
$actvieCode->uid = $uid; # 添加uid
$ret = daoInst()
->insert(self::tab_toke_gift) # 表名
->data($actvieCode)
->exec();
return $ret > 0;
}
//
/**
* [6503] 查询当前分区开放时间戳
*/
private static function GetZonePublicTS() {
$zoneInfo = GameConfig::zonelist_getItem(req()->zoneid);
return Resp::ok($zoneInfo->publicTs);
}
//
/**
* [6508]
*/
public static function RecoveryTili() {
$useTili = req()->paras[0];
ActiveProc::ChangeTili($useTili);
UserProc::updateUserInfo();
$result = array(
'time' => req()->userInfo->game->privateState->TiliTime,
'tili' => req()->userInfo->game->baseInfo->tili
);
$resp = Resp::ok($result);
return $resp;
}
/**
* 清理每天的赠送体力领取记录
*/
private static function ClearDailyTiliGift() {
req()->userInfo->game->privateState->dailyDrawedTiliGift = ArrayInit();
}
/**
* 修改玩家体力
* @param int $useTili $useTili>0代表增加体力, $useTili<0代表消耗体力
*/
public static function ChangeTili($useTili) {
$user = req()->userInfo->game;
$moreTili = 0; # 超上限的体力值
// 如果没有tilitime这个值,说明是以前老用户新登录的,为了纠错在判断里面补值.(正常用户不会进入判断内部)
if (!CommUtil::isPropertyExists($user->privateState, "TiliTime")) {
$user->privateState->TiliTime = time() - 120;
}
if ($user->baseInfo->tili > 120) { # 如果该账户体力值本身是大于上限的,获取一下超出的体力值
$moreTili = $user->baseInfo->tili - 120; # 用moreTili保存一下额外的体力值
}
$useTime = time() - $user->privateState->TiliTime; # 距离上次修改体力值的时间
if ($useTime > 300) { # 该账户超过了单位体力时间,需要重新计算体力值
if ($moreTili <= 0) {
$user->baseInfo->tili += (int) ( (int) ($useTime / 300));
if ($user->baseInfo->tili > 120) { # 体力值上限
$user->baseInfo->tili = 120;
} // 这代码真烂,以后用的时候再修复吧... -gwang 20200110154858
}
$user->privateState->TiliTime = time();
}
if ($useTili < 0) { # 如果是消耗体力
my_Assert(abs($useTili) < $user->baseInfo->tili, ErrCode::notenough_tili); # 体力不足
$user->baseInfo->tili += $useTili; # 扣除体力
} else if ($useTili > 0) { # 如果是购买增加体力
$user->baseInfo->tili += $useTili;
}
return ErrCode::ok;
}
//
//
//
//
/**
* 重置7日签到相关计数器
*/
static function DailyResetDay7Task() {
req()->userInfo->game->gates->Times = 0;
$typeID = 6; # 7日活动
$ac = GameConfig::activity_getItem($typeID);
my_Assert(null != $ac, ErrCode::err_const_no);
$startDay = tsDay($ac->startts);
$newLoginDays = array_filter(req()->userInfo->game->privateState->LoginDays, # 剔除不符合时间的登录记录
function ($tsday)use ($startDay) {
return $startDay <= $tsday;
}
);
req()->userInfo->game->privateState->LoginDays = $newLoginDays; #
if (count(req()->userInfo->game->privateState->LoginDays) < 7) {
req()->userInfo->game->privateState->LoginDays[] = tsDay();
}
}
/**
* [6502] 领取七日签到奖励
*/
static function Day7_DrawReward() {
// 设计7日数据结构
list($day) = req()->paras; # 参数: 领取第x天的奖励
$user = req()->userInfo->game;
$private = new Info_PrivateState($user->privateState); # 私有数据
my_Assert(count($private->LoginDays) >= $day, ErrCode::active_day7_totaldays);
my_Assert(!in_array($day, $private->day7_drawed), ErrCode::active_hasgetted);
$day_rwd = GameConfig::activity_day7_getItem($day); # 查询奖励数据
my_Assert(null != $day_rwd, ErrCode::err_const_no); # 防御找不到配置
StoreProc::AddMultiItemInStore($day_rwd->reward); # 发放奖励
$private->day7_drawed[] = $day; # 添加领取记录
$user->privateState = $private; # 更新数据
UserProc::updateUserInfo(); # 回存
return Resp::ok(array(
'gold' => $user->baseInfo->gold,
'cash' => $user->baseInfo->cash,
'tili' => $user->baseInfo->tili,
'store' => $user->store,
'hero' => $user->heros
)); # 返回值
}
//
//
}