From 2d645b19c14e6a95db25da7e0863884f954fc3ea Mon Sep 17 00:00:00 2001 From: hujiabin Date: Thu, 6 Apr 2023 17:31:09 +0800 Subject: [PATCH] 1 --- sql/gamedb.sql | 19 ++++++++++++ webapp/controller/BattleController.class.php | 18 +++++++++++ webapp/controller/UserController.class.php | 32 ++++++++++---------- 3 files changed, 53 insertions(+), 16 deletions(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 0776cb8f..3a6060a6 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -699,6 +699,25 @@ CREATE TABLE `t_battle_settlement_team` ( ) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `t_battle_settlement_team` +-- + +DROP TABLE IF EXISTS `t_battle_input`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_battle_input` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `battle_uuid` varchar(60) NOT NULL DEFAULT '' COMMENT '战斗记录唯一id', + `room_uuid` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'room_id', + `input` mediumblob COMMENT 'input', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `battle_room_uuid` (`battle_uuid`, `room_uuid`) +) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `t_battle_history` -- diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index 0a6f009c..f6888313 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -129,6 +129,24 @@ class BattleController extends BaseAuthedController { $this->_rspErr(1, 'Repeated request'); return; } + SqlHelper::upsert + (myself()->_getSelfMysql(), + 't_battle_input', + array( + 'battle_uuid' => $battle_uuid, + 'room_uuid' => $room_uuid, + ), + array( + 'input' => json_encode($data) + ), + array( + 'battle_uuid' => $battle_uuid, + 'room_uuid' => $room_uuid, + 'input' => json_encode($data), + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime(), + ) + ); $teamList = array(); if ($data) { $teamList = $data['team_list']; diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 5ec55eb4..7796e135 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -130,17 +130,17 @@ class UserController extends BaseAuthedController { } private function _addFreeItem(){ - $chipMeta = \mt\Item::getMetaListByType(\mt\Item::CHIP_TYPE); - foreach ($chipMeta as $row){ - Chip::addChip($row); - } - - foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) { - $heroMeta = mt\Item::get($heroId); - if ($heroMeta) { - Hero::addHero($heroMeta); - } - } +// $chipMeta = \mt\Item::getMetaListByType(\mt\Item::CHIP_TYPE); +// foreach ($chipMeta as $row){ +// Chip::addChip($row); +// } +// +// foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) { +// $heroMeta = mt\Item::get($heroId); +// if ($heroMeta) { +// Hero::addHero($heroMeta); +// } +// } $addItems =array(); foreach (mt\Parameter::getListValue('creator_present_items') as $itemsStr) { list($itemId, $itemNum) = explode(':', $itemsStr); @@ -152,11 +152,11 @@ class UserController extends BaseAuthedController { )); } } - array_push($addItems, - array( - 'item_id' => V_ITEM_GOLD, - 'item_num' => 50 - )); +// array_push($addItems, +// array( +// 'item_id' => V_ITEM_GOLD, +// 'item_num' => 50 +// )); $awardService = new services\AwardService(); $propertyChgService = new services\PropertyChgService();