1
This commit is contained in:
parent
4afdbba4b9
commit
2f81f84c70
@ -237,8 +237,10 @@ class SeasonCard(object):
|
||||
['season_id', 0, '赛季id(客户端显示为Sxxx)'],
|
||||
['card_lv', 0, '手册等级'],
|
||||
['card_exp', 0, '手册经验'],
|
||||
['card_max_exp', 0, '手册经验上限'],
|
||||
['!gift_packages', [SeasonCardGiftPackage()], '礼包列表'],
|
||||
['!received_level_rewards', [0], '等级解锁的奖励已领取等级列表'],
|
||||
['!received_level_rewards1', [0], '等级解锁的奖励已领取等级列表(普通手册)'],
|
||||
['!received_level_rewards2', [0], '等级解锁的奖励已领取等级列表(精英)'],
|
||||
]
|
||||
|
||||
class SeasonMission(object):
|
||||
|
@ -363,4 +363,27 @@ CREATE TABLE `t_drop_log` (
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `t_game_log`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `t_game_log`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `t_game_log` (
|
||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
||||
`type` varchar(255) NOT NULL DEFAULT '' COMMENT '日志类型',
|
||||
`subtype` varchar(255) NOT NULL DEFAULT '' COMMENT '日志子类型',
|
||||
`param1` varchar(666) NOT NULL DEFAULT '' COMMENT 'param1',
|
||||
`param2` varchar(666) NOT NULL DEFAULT '' COMMENT 'param2',
|
||||
`param3` varchar(666) NOT NULL DEFAULT '' COMMENT 'param3',
|
||||
`param4` varchar(666) NOT NULL DEFAULT '' COMMENT 'param4',
|
||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
KEY `account_id_type_subtype` (`account_id`, `type`, `subtype`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
-- Dump completed on 2015-08-19 18:51:22
|
||||
|
@ -1,12 +1,19 @@
|
||||
<?php
|
||||
|
||||
require_once('mt/Item.php');
|
||||
|
||||
require_once('models/Bag.php');
|
||||
require_once('models/DynData.php');
|
||||
require_once('mt/Item.php');
|
||||
require_once('models/Hero.php');
|
||||
require_once('models/HeroSkin.php');
|
||||
require_once('models/GunSkin.php');
|
||||
|
||||
use phpcommon\SqlHelper;
|
||||
use models\Bag;
|
||||
use models\DynData;
|
||||
use models\Hero;
|
||||
use models\HeroSkin;
|
||||
use models\GunSkin;
|
||||
|
||||
class BaseAuthedController extends BaseController {
|
||||
|
||||
@ -204,12 +211,78 @@ class BaseAuthedController extends BaseController {
|
||||
|
||||
public function _addItems($items, $awardService, $propertyService)
|
||||
{
|
||||
$heads = array();
|
||||
$headFrames = array();
|
||||
foreach ($items as $item) {
|
||||
if ($this->_isVirtualItem($item['item_id'])) {
|
||||
$this->_addVirtualItem($item['item_id'], $item['item_num']);
|
||||
$propertyService->addUserChg();
|
||||
} else {
|
||||
Bag::addItem($item['item_id'], $item['item_num']);
|
||||
$itemMeta = mt\Item::get($item['item_id']);
|
||||
if ($itemMeta) {
|
||||
if (mt\Item::isBagItem($itemMeta['type'], $itemMeta['sub_type'])) {
|
||||
Bag::addItem($item['item_id'], $item['item_num']);
|
||||
$propertyService->addBagChg();
|
||||
} else {
|
||||
switch ($itemMeta['type']) {
|
||||
case mt\Item::HERO_TYPE:
|
||||
{
|
||||
Hero::addHero($itemMeta);
|
||||
$propertyService->addHeroChg();
|
||||
}
|
||||
break;
|
||||
case mt\Item::HERO_SKIN_TYPE:
|
||||
{
|
||||
HeroSkin::addSkin($itemMeta);
|
||||
$propertyService->addHeroSkinChg();
|
||||
}
|
||||
break;
|
||||
case mt\Item::HEAD_TYPE:
|
||||
{
|
||||
array_push($heads, $itemMeta['id']);
|
||||
$propertyService->addUserChg();
|
||||
}
|
||||
break;
|
||||
case mt\Item::HEAD_FRAME_TYPE:
|
||||
{
|
||||
array_push($headFrames, $itemMeta['id']);
|
||||
$propertyService->addUserChg();
|
||||
}
|
||||
break;
|
||||
case mt\Item::GUN_TYPE:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
case mt\Item::GUN_SKIN_TYPE:
|
||||
{
|
||||
GunSkin::addSkin($itemMeta['id']);
|
||||
$propertyService->addGunSkinChg();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
$this->_addLog('additems', 'invalid_item', array(
|
||||
'param1' => $item['item_id'],
|
||||
'param2' => $item['item_num'],
|
||||
));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}//end foreach
|
||||
if (!empty($heads) || !empty($headFrames)) {
|
||||
$userInfo = $this->_getOrmUserInfo();
|
||||
$headsDb = emptyReplae(json_decode($userInfo['head_list'], true), array());
|
||||
$headFramesDb = emptyReplae(json_decode($userInfo['head_frame_list'], true), array());
|
||||
$heads = array_unique(array_merge($heads, $headsDb));
|
||||
$headFrames = array_unique(array_merge($headFrames, $headFramesDb));
|
||||
$this->_updateUserInfo(array(
|
||||
'head_list' => json_encode($heads),
|
||||
'head_frame_list' => json_encode($headFrames),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@ -328,6 +401,26 @@ class BaseAuthedController extends BaseController {
|
||||
);
|
||||
}
|
||||
|
||||
public function _addLog($type, $subtype, $params)
|
||||
{
|
||||
$fieldsKv = array(
|
||||
'account_id' => $this->_getAccountId(),
|
||||
'type' => $type,
|
||||
'subtype' => $subtype,
|
||||
'param1' => getXVale($params, 'param1', ''),
|
||||
'param2' => getXVale($params, 'param2', ''),
|
||||
'param3' => getXVale($params, 'param3', ''),
|
||||
'param4' => getXVale($params, 'param4', ''),
|
||||
'createtime' => myself()->_getNowTime(),
|
||||
'modifytime' => myself()->_getNowTime()
|
||||
);
|
||||
SqlHelper::insert(
|
||||
myself()->_getSelfMysql(),
|
||||
't_game_log',
|
||||
$fieldsKv
|
||||
);
|
||||
}
|
||||
|
||||
public function _getV($x, $y, $defVal = 0)
|
||||
{
|
||||
return DynData::getV($x, $y, $defVal);
|
||||
|
@ -69,6 +69,7 @@ class Item {
|
||||
const GUN_SKIN_TYPE = 8;
|
||||
const FUNC_TYPE = 9;
|
||||
const MATERIAL_TYPE = 10;
|
||||
const FRAGMENT_TYPE = 11;
|
||||
|
||||
const FUNC_RENAME_CARD_SUBTYPE = 1;
|
||||
|
||||
@ -133,6 +134,16 @@ class Item {
|
||||
return $info;
|
||||
}
|
||||
|
||||
public static function isBagItem($type, $subType)
|
||||
{
|
||||
return in_array($type, array(
|
||||
self::GIFT_PACKAGE_TYPE,
|
||||
self::FUNC_TYPE,
|
||||
self::MATERIAL_TYPE,
|
||||
self::FRAGMENT_TYPE
|
||||
));
|
||||
}
|
||||
|
||||
protected static function getMetaList()
|
||||
{
|
||||
if (!self::$metaList) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user