diff --git a/config/annc.php b/config/annc.php new file mode 100644 index 00000000..faa28647 --- /dev/null +++ b/config/annc.php @@ -0,0 +1,23 @@ + 2024070901, + 'title' => $title, + 'content' => $content +); diff --git a/doc/Annc.py b/doc/Annc.py new file mode 100644 index 00000000..56f5a84b --- /dev/null +++ b/doc/Annc.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- + +import _common + +class Annc(object): + + def __init__(self): + self.apis = [ + { + 'name': 'getAnnc', + 'desc': '获取公告', + 'group': 'Annc', + 'url': 'webapp/index.php?c=Annc&a=getAnnc', + 'params': [ + _common.ReqHead(), + ], + 'response': [ + _common.RspHead(), + ['id', '', 'id'], + ['tile', '', '标题'], + ['content', '', '正文'], + ] + } + ] diff --git a/webapp/controller/AnncController.class.php b/webapp/controller/AnncController.class.php new file mode 100644 index 00000000..e11a2e4d --- /dev/null +++ b/webapp/controller/AnncController.class.php @@ -0,0 +1,10 @@ +_rspData(require('../config/annc.php')); + } + +} diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index 4786c182..c30edb15 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -1123,8 +1123,11 @@ class BattleController extends BaseAuthedController { private function checkTicket($r, $customData, $mapModeMeta) { - if ($mapModeMeta['mapMode'] == 501) { - error_log("checkTick error :501"); + if (!mt\MapMode::checkLimitTime($mapModeMeta)) { + error_log(json_encode(array( + 'msg' => 'MapMode::CheckLimitTime error', + 'meta' => $mapModeMeta + ))); return false; } $itemId = $mapModeMeta['admission_item_id']; diff --git a/webapp/controller/GMController.class.php b/webapp/controller/GMController.class.php index 08aeea3a..c8bff8c1 100644 --- a/webapp/controller/GMController.class.php +++ b/webapp/controller/GMController.class.php @@ -65,8 +65,8 @@ class GMController extends BaseAuthedController { '.addhero' => function () use($params) { $this->addHero($params); }, - '.dechp' => function () use($params) { - $this->decHP($params); + '.decgold' => function () use($params) { + $this->decGold($params); }, '.loot' => function () use($params) { $this->lootTest($params); @@ -345,23 +345,28 @@ END myself()->_rspOk(); } - private function decHP($params) + private function decGold($params) { $itemNum = getXVal($params, 0, 0); - $userInfo = myself()->_getUserInfo('gold'); + $userInfo = myself()->_getUserInfo(array('gold')); $oldGold = myself()->_getItemCount(V_ITEM_GOLD, $userInfo); $decItems = array( array( 'item_id' => V_ITEM_GOLD, - 'item_num' => $iteNum + 'item_num' => $itemNum ) ); - $newUserInfo = myself()->_getUserInfo('gold'); + myself()->_decItems($decItems); + $newUserInfo = myself()->_getUserInfo(array('gold')); $newGold = myself()->_getItemCount(V_ITEM_GOLD, $newUserInfo); + $propertyChgService = new services\PropertyChgService(); + $propertyChgService->addUserChg(); + myself()->_rspData(array( 'oldGold' => $oldGold, 'newGold' => $newGold, 'itemNum' => $itemNum, + 'property_chg' => $propertyChgService->toDto() )); } diff --git a/webapp/mt/MapMode.php b/webapp/mt/MapMode.php index 0d8d87e5..c1349b93 100644 --- a/webapp/mt/MapMode.php +++ b/webapp/mt/MapMode.php @@ -1,8 +1,9 @@