From 38bd4ee26506ba97055f5420483666c7e8bd258d Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Tue, 30 Apr 2024 11:04:04 +0800 Subject: [PATCH 01/12] 1 --- webapp/controller/BagController.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/webapp/controller/BagController.class.php b/webapp/controller/BagController.class.php index db7ac210..eb66c160 100644 --- a/webapp/controller/BagController.class.php +++ b/webapp/controller/BagController.class.php @@ -376,6 +376,15 @@ class BagController extends BaseAuthedController { } private function openBattleBox($itemDb,$itemMeta,$itemNum){ + $costItems = mt\Item::getUseCostItems($itemMeta); + if (count($costItems) > 0){ + $lackItem = null; + if (!$this->_hasEnoughItems($costItems, $lackItem)) { + $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem)); + return; + } + } + $lootMeta = mt\LootConfig::find($itemMeta['loot']); if ($lootMeta['isAffected']){ // $lucky = Hero::getAccountLucky(myself()->_getAddress()); @@ -393,6 +402,9 @@ class BagController extends BaseAuthedController { }else{ $items = \services\LootService::dropOutItem($itemMeta['loot']); } + if (count($costItems) > 0){ + $this->_decItems($costItems); + } $this->_decItems(array( array( 'item_id' => $itemMeta['id'], From 21d708581720ed8916886b39f3b428cdf0fbc79d Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Thu, 9 May 2024 11:44:41 +0800 Subject: [PATCH 02/12] 1 --- .../gamedb2006_migrate_240423_01.sql | 0 sql/gamedb.sql | 18 +++++ sql/gamedb2006_migrate_240508_01.sql | 16 ++++ webapp/bootstrap/constant.php | 1 + webapp/controller/BaseController.class.php | 30 +++++++ .../controller/OutAppNftController.class.php | 79 +++++++++++++++++++ webapp/controller/UserController.class.php | 24 ++++++ webapp/services/RoomBattleDataService.php | 19 +++++ 8 files changed, 187 insertions(+) rename sql/{ => archived}/gamedb2006_migrate_240423_01.sql (100%) create mode 100644 sql/gamedb2006_migrate_240508_01.sql diff --git a/sql/gamedb2006_migrate_240423_01.sql b/sql/archived/gamedb2006_migrate_240423_01.sql similarity index 100% rename from sql/gamedb2006_migrate_240423_01.sql rename to sql/archived/gamedb2006_migrate_240423_01.sql diff --git a/sql/gamedb.sql b/sql/gamedb.sql index cd51c00a..10310756 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1729,3 +1729,21 @@ CREATE TABLE `t_global_data` ( PRIMARY KEY (`idx`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + + +-- +-- Table structure for table `t_sub_user_bind` +-- + +DROP TABLE IF EXISTS `t_sub_user_bind`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sub_user_bind` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `org_account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '初始账号id', + `cur_account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '最新账号id', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `org_account_id` (`org_account_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; \ No newline at end of file diff --git a/sql/gamedb2006_migrate_240508_01.sql b/sql/gamedb2006_migrate_240508_01.sql new file mode 100644 index 00000000..8b7362d7 --- /dev/null +++ b/sql/gamedb2006_migrate_240508_01.sql @@ -0,0 +1,16 @@ +begin; + +CREATE TABLE `t_sub_user_bind` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `org_account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '初始账号id', + `cur_account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '最新账号id', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `org_account_id` (`org_account_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + + +insert into version (version) values(2024050801); + +commit; diff --git a/webapp/bootstrap/constant.php b/webapp/bootstrap/constant.php index e2a3d17e..8df938a5 100644 --- a/webapp/bootstrap/constant.php +++ b/webapp/bootstrap/constant.php @@ -69,6 +69,7 @@ define('TN_DAILY_BUY_LEVEL_STATE', 9018); define('TN_DAILY_RESET_HERO_LEVEL_STATE', 9019); define('TN_DAILY_REFRESH_MISSION_TIMES', 9020); define('TN_DAILY_GOLD_MODE_BATTLE_TIMES', 9021); +define('TN_DAILY_GATHER_GOLD', 9022); define('TN_WEEKLY_BEGIN', 10001); define('TN_WEEKLY_ACTIVE', 10002); diff --git a/webapp/controller/BaseController.class.php b/webapp/controller/BaseController.class.php index 3bcb445e..c8ff7e4b 100644 --- a/webapp/controller/BaseController.class.php +++ b/webapp/controller/BaseController.class.php @@ -247,4 +247,34 @@ class BaseController { return $ret; } + public function _getGameId() { + return 2006; + } + + public function _isSubAccountId($accountId) { + $str_list = explode('_', $accountId); + if (count($str_list) < 4) { + return false; + } + $channel = $str_list[0]; + $gameId = $str_list[1]; + if ($channel != BC_CHANNEL) { + return false; + } + if ($gameId != $this->_getGameId()) { + return false; + } + return $str_list[2][0] == 's'; + } + + public function _getShortAccountId($accountId) { + if (!$this->_isSubAccountId($accountId)) { + return $accountId; + } + // + $str_list = explode('_', $accountId); + unset($str_list[2]); + return implode("_",$str_list); + } + } diff --git a/webapp/controller/OutAppNftController.class.php b/webapp/controller/OutAppNftController.class.php index b1fbbc24..aee4720a 100644 --- a/webapp/controller/OutAppNftController.class.php +++ b/webapp/controller/OutAppNftController.class.php @@ -1,8 +1,10 @@ _getGameId().'_'.$channel.'_'.$openId; + $userDb = User::find($accountId); + if (!$userDb){ + $this->_rspErr(1, 'user not found'); + return; + } + + $info = array( + 'loginVal' => 0, + 'battleTimes' => 0, + 'winTimes' => 0, + 'kills' => 0, + 'getGoldVal' => 0, + ); + $accountBindDb = SqlHelper::ormSelectOne( + myself()->_getMysql($openId), + 't_sub_user_bind', + array( + 'org_account_id' => $accountId, + ) + ); + $accountId = $accountBindDb ? $accountBindDb['cur_account_id'] : $accountId ; + $loginDyn = SqlHelper::ormSelectOne( + myself()->_getMysql($openId), + 't_dyndata', + array( + 'account_id' => $accountId, + 'x' => TN_DAILY_LOGINS, + 'y' => 0, + ) + ); + if ($loginDyn){ + $info['loginVal'] = $loginDyn['val']; + if (myself()->_getDaySeconds($loginDyn['modifytime']) < myself()->_getNowDaySeconds()) { + $info['loginVal'] = 0; + } + } + + $battleDb = SqlHelper::ormSelectOne( + myself()->_getMysql($openId), + 't_battle', + array( + 'account_id' => $accountId, + ) + ); + if ($battleDb){ + $hisBattleData = json_decode($battleDb['battle_data'], true); + $todayBattleData = getXVal($hisBattleData, 'today_data', array()); + if (myself()->_getDaySeconds(getXVal($todayBattleData, 'modifytime', 0)) == myself()->_getNowDaySeconds()) { + $info['battleTimes'] = getXVal($todayBattleData, "total_battle_times", 0); + $info['winTimes'] = getXVal($todayBattleData, "total_win_times", 0); + $info['kills'] = getXVal($todayBattleData, "total_kills_times", 0); + } + } + $getGoldDyn = SqlHelper::ormSelectOne( + myself()->_getMysql($openId), + 't_dyndata', + array( + 'account_id' => $accountId, + 'x' => TN_DAILY_GATHER_GOLD, + 'y' => 0, + ) + ); + if ($getGoldDyn){ + $info['getGoldVal'] = $getGoldDyn['val']; + if (myself()->_getDaySeconds($getGoldDyn['modifytime']) < myself()->_getNowDaySeconds()) { + $info['getGoldVal'] = 0; + } + } + $this->_rspData(array( + 'info' => $info, + )); + } } diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index fafabde7..a727e37d 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -72,6 +72,7 @@ class UserController extends BaseAuthedController { $userInfo['address'] = $this->_getOpenId(); } $this->_updateLastSeason($userInfo); + $this->_updateSubUserAccount(); $this->_sign(); $event = array( 'ID' => 'luck', @@ -1168,6 +1169,29 @@ class UserController extends BaseAuthedController { } } + private function _updateSubUserAccount() { + if ($this->_getChannel() == BC_CHANNEL) { + $shortAccountId = $this->_getShortAccountId(myself()->_getAccountId()); + SqlHelper::upsert + ($this->_getSelfMysql(), + 't_sub_user_bind', + array( + 'org_account_id' => $shortAccountId + ), + array( + 'cur_account_id' => myself()->_getAccountId(), + 'modifytime' => myself()->_getNowTime(), + ), + array( + 'org_account_id' => myself()->_getAccountId(), + 'cur_account_id' => myself()->_getAccountId(), + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime(), + ) + ); + } + } + private function _sign(){ //用户是否有签到记录 if (SignLog::isSignRecord()){ diff --git a/webapp/services/RoomBattleDataService.php b/webapp/services/RoomBattleDataService.php index 011f106f..21c93c96 100644 --- a/webapp/services/RoomBattleDataService.php +++ b/webapp/services/RoomBattleDataService.php @@ -221,6 +221,7 @@ class RoomBattleDataService extends BaseService { "item_id" => V_ITEM_GOLD, "item_num" => floor($gold), )); + myself()->_incDailyV(TN_DAILY_GATHER_GOLD,0,floor($gold)); } } @@ -240,6 +241,10 @@ class RoomBattleDataService extends BaseService { public function _calBattleScore($battleInfo){ $paramMeta = mt\Parameter::getVal('performance_score_range',0); + $paramMetaMoba = mt\Parameter::getVal('performance_score_weight_4V4',0); + $paramMetaPvp = mt\Parameter::getVal('performance_score_weight_BR',0); + $weightMoba = explode("|",$paramMetaMoba); + $weightPvp = explode("|",$paramMetaPvp); $scoreParam = explode("|",$paramMeta); if (count($scoreParam) < 2){ error_log('Parameter table error'); @@ -284,10 +289,24 @@ class RoomBattleDataService extends BaseService { } switch ($room_mode){ case self::ROOM_MODE_PVP: { + if (count($weightPvp) == 5){ + $killSco *= $weightPvp[0]; + $assistSco *= $weightPvp[1]; + $damageSco *= $weightPvp[2]; + $recoverSco *= $weightPvp[3]; + $aliveSco *= $weightPvp[4]; + } $battleScore = round($killSco + $assistSco + $damageSco + $recoverSco + $aliveSco , 2); } break; case self::ROOM_MODE_MOBA :{ + if (count($weightMoba) == 5){ + $killSco *= $weightMoba[0]; + $assistSco *= $weightMoba[1]; + $damageSco *= $weightMoba[2]; + $recoverSco *= $weightMoba[3]; + $levelSco *= $weightMoba[4]; + } $battleScore = round($killSco + $assistSco + $damageSco + $recoverSco + $levelSco , 2); } break; From caa0e0c8a19845109342f556d2e1b982d17d15b8 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Thu, 9 May 2024 11:59:42 +0800 Subject: [PATCH 03/12] 1 --- doc/OutAppNft.py | 23 +++++++++++++++++++ .../controller/OutAppNftController.class.php | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/doc/OutAppNft.py b/doc/OutAppNft.py index 4b86f46b..7f397dca 100644 --- a/doc/OutAppNft.py +++ b/doc/OutAppNft.py @@ -20,8 +20,31 @@ class OutAppNft(object): ['!nfts', [NftInfo()], 'nft列表'], ] }, + { + 'name': 'getWebInfo', + 'desc': 'web信息', + 'group': 'OutAppNft', + 'url': 'webapp/index.php?c=OutAppNft&a=getWebInfo', + 'params': [ + ['channel', '', 'channel'], + ['openId', 0, 'openId'], + ], + 'response': [ + _common.RspHead(), + ['info', WebInfo(), 'info'], + ] + }, ] +class WebInfo(object): + def __init__(self): + self.fields = [ + ['loginVal', 0, '今日登录状态 1:登录 0:未登录'], + ['battleTimes', '', '战斗次数'], + ['winTimes', 0, '胜利次数'], + ['kills', 0, '击杀数'], + ['getGoldVal', 0, '获得金币数'], + ] class NftInfo(object): diff --git a/webapp/controller/OutAppNftController.class.php b/webapp/controller/OutAppNftController.class.php index aee4720a..f072e72e 100644 --- a/webapp/controller/OutAppNftController.class.php +++ b/webapp/controller/OutAppNftController.class.php @@ -41,7 +41,7 @@ class OutAppNftController extends BaseController { } - public function getOpenIdInfo(){ + public function getWebInfo(){ $channel = getReqVal('channel', ''); $openId = getReqVal('openId', ''); $accountId = BC_CHANNEL.'_'.$this->_getGameId().'_'.$channel.'_'.$openId; From 0daa3ad939fe6a89922e9d4069f05670a934c089 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Thu, 9 May 2024 16:47:55 +0800 Subject: [PATCH 04/12] 1 --- webapp/controller/BaseController.class.php | 2 +- webapp/controller/OutAppNftController.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/controller/BaseController.class.php b/webapp/controller/BaseController.class.php index c8ff7e4b..bf57fce0 100644 --- a/webapp/controller/BaseController.class.php +++ b/webapp/controller/BaseController.class.php @@ -258,7 +258,7 @@ class BaseController { } $channel = $str_list[0]; $gameId = $str_list[1]; - if ($channel != BC_CHANNEL) { + if ($channel != BC_POLY_CHANNEL) { return false; } if ($gameId != $this->_getGameId()) { diff --git a/webapp/controller/OutAppNftController.class.php b/webapp/controller/OutAppNftController.class.php index f072e72e..9b2e63e6 100644 --- a/webapp/controller/OutAppNftController.class.php +++ b/webapp/controller/OutAppNftController.class.php @@ -44,7 +44,7 @@ class OutAppNftController extends BaseController { public function getWebInfo(){ $channel = getReqVal('channel', ''); $openId = getReqVal('openId', ''); - $accountId = BC_CHANNEL.'_'.$this->_getGameId().'_'.$channel.'_'.$openId; + $accountId = BC_POLY_CHANNEL.'_'.$this->_getGameId().'_'.$channel.'_'.$openId; $userDb = User::find($accountId); if (!$userDb){ $this->_rspErr(1, 'user not found'); From 2d230ad70699c2dc7a0f26c7280a6a151eb27a6f Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Thu, 9 May 2024 17:23:14 +0800 Subject: [PATCH 05/12] 1 --- webapp/controller/OutAppNftController.class.php | 2 +- webapp/services/TameBattleDataService.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/webapp/controller/OutAppNftController.class.php b/webapp/controller/OutAppNftController.class.php index 9b2e63e6..b5e225c8 100644 --- a/webapp/controller/OutAppNftController.class.php +++ b/webapp/controller/OutAppNftController.class.php @@ -94,7 +94,7 @@ class OutAppNftController extends BaseController { $todayBattleData = getXVal($hisBattleData, 'today_data', array()); if (myself()->_getDaySeconds(getXVal($todayBattleData, 'modifytime', 0)) == myself()->_getNowDaySeconds()) { $info['battleTimes'] = getXVal($todayBattleData, "total_battle_times", 0); - $info['winTimes'] = getXVal($todayBattleData, "total_win_times", 0); + $info['winTimes'] = getXVal($todayBattleData, "total_special_win_times", 0); $info['kills'] = getXVal($todayBattleData, "total_kills_times", 0); } } diff --git a/webapp/services/TameBattleDataService.php b/webapp/services/TameBattleDataService.php index a81d537e..463210fc 100644 --- a/webapp/services/TameBattleDataService.php +++ b/webapp/services/TameBattleDataService.php @@ -1085,11 +1085,15 @@ class TameBattleDataService extends BaseService { //排名 $ranked = getXVal($this->battleInfo,'pvp_team_rank', 0); + $mapMode = getXVal($this->allInfo,'map_mode', 0); if ($ranked == 1) { //吃鸡次数 $this->incValue($battleData, 'total_win_times', 1); //地图吃鸡数 $this->incValue($battleData['total_map_win_times'], $mapId, 1); + if ($mapMode== mt\MapMode::RANKING_MODE || $mapMode == mt\MapMode::BET_MODE){ + $this->incValue($battleData, "total_special_win_times", 1); + } } if ($ranked <= 3 && $ranked>0){ //排名前十 总次数 From e4161eb0301bdc760c9668d9e1ae3bafa63cfe00 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Fri, 10 May 2024 10:41:40 +0800 Subject: [PATCH 06/12] 1 --- webapp/services/TameBattleDataService.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/webapp/services/TameBattleDataService.php b/webapp/services/TameBattleDataService.php index 463210fc..a81e0944 100644 --- a/webapp/services/TameBattleDataService.php +++ b/webapp/services/TameBattleDataService.php @@ -467,7 +467,21 @@ class TameBattleDataService extends BaseService { 'modifytime' => myself()->_getNowTime() ); } + if (!isset($hisBattleData['today_data'])) { + $hisBattleData['today_data'] = array( + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime() + ); + } + if (myself()->_getDaySeconds($hisBattleData['today_data']['modifytime']) < + myself()->_getNowDaySeconds()) { + $hisBattleData['today_data'] = array( + 'createtime' => $hisBattleData['today_data']['createtime'], + 'modifytime' => myself()->_getNowTime() + ); + } $this->apply($hisBattleData['moba_data']); + $this->apply($hisBattleData['today_data']); Battle::add(json_encode($hisBattleData)); } From fa7b11b0d9e1f6b7d8fc9f00504b1579a14662c5 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Fri, 10 May 2024 14:11:57 +0800 Subject: [PATCH 07/12] 1 --- webapp/bootstrap/constant.php | 1 + .../controller/BaseAuthedController.class.php | 15 ++++++--- .../controller/OutAppNftController.class.php | 33 +++++++++++-------- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/webapp/bootstrap/constant.php b/webapp/bootstrap/constant.php index 8df938a5..858c1cb8 100644 --- a/webapp/bootstrap/constant.php +++ b/webapp/bootstrap/constant.php @@ -9,6 +9,7 @@ define('LAST_SESSION_KEY', 'last_session:'); define('MATCH_CURRENT_TEAM_KEY', 'match:current_team:'); define('MATCH_OK_KEY', 'match:ok:'); define('DEC_BATTLE_TICKET', 'battle_ticket:'); +define('LAST_ACTIVE_TIME', 'last_active_time:'); define('V_ITEM_GOLD', 10001); //金币 define('V_ITEM_GOLDS', 10017); //金堆 diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index 54c72507..1c5eab19 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -96,11 +96,11 @@ class BaseAuthedController extends BaseController { die(); } } + $r = $this->_getRedis($this->_getAccountId()); if (!(getReqVal('c', '') == 'User' && getReqVal('a', '') == 'login')) { if ((getReqVal('c', '') == 'Battle')) { return; } - $r = $this->_getRedis($this->_getAccountId()); $sessionId = $r->get(LAST_SESSION_KEY . $this->_getAccountId()); // error_log('SERVER_ENV:' . SERVER_ENV . '_DEBUG:' . _DEBUG); if (SERVER_ENV != _DEBUG) @@ -116,9 +116,8 @@ class BaseAuthedController extends BaseController { die(); } } - } - + $this->updateActive($r); /*if (SERVER_ENV == _ONLINE) { if (phpcommon\cmpVersion(getReqVal('_version', ''), '0.2.0') > 0) { if (!$this->isWhiteList() || myself()->_getChannel() != BC_CHANNEL) { @@ -129,7 +128,15 @@ class BaseAuthedController extends BaseController { }*/ } - + protected function updateActive($r) + { + $lastActiveTime = $r->get(LAST_ACTIVE_TIME . $this->_getAccountId()); + //第一次登录或者跨天更新最后活跃时间 + if (empty($lastActiveTime) || + $lastActiveTime < $this->_getNowDaySeconds()) { + $r->setNxPx(LAST_ACTIVE_TIME . $this->_getAccountId(), $this->_getNowTime(), 1000 * 3600 * 24); + } + } protected function updateSession($accountId, $sessionId) { diff --git a/webapp/controller/OutAppNftController.class.php b/webapp/controller/OutAppNftController.class.php index b5e225c8..ed95f0fa 100644 --- a/webapp/controller/OutAppNftController.class.php +++ b/webapp/controller/OutAppNftController.class.php @@ -66,21 +66,26 @@ class OutAppNftController extends BaseController { ) ); $accountId = $accountBindDb ? $accountBindDb['cur_account_id'] : $accountId ; - $loginDyn = SqlHelper::ormSelectOne( - myself()->_getMysql($openId), - 't_dyndata', - array( - 'account_id' => $accountId, - 'x' => TN_DAILY_LOGINS, - 'y' => 0, - ) - ); - if ($loginDyn){ - $info['loginVal'] = $loginDyn['val']; - if (myself()->_getDaySeconds($loginDyn['modifytime']) < myself()->_getNowDaySeconds()) { - $info['loginVal'] = 0; - } + $redis = $this->_getRedis($accountId); + $lastActiveTime = $redis->get(LAST_ACTIVE_TIME . $accountId); + if (!empty($lastActiveTime) && $lastActiveTime > myself()->_getNowDaySeconds()){ + $info['loginVal'] = 1; } +// $loginDyn = SqlHelper::ormSelectOne( +// myself()->_getMysql($openId), +// 't_dyndata', +// array( +// 'account_id' => $accountId, +// 'x' => TN_DAILY_LOGINS, +// 'y' => 0, +// ) +// ); +// if ($loginDyn){ +// $info['loginVal'] = $loginDyn['val']; +// if (myself()->_getDaySeconds($loginDyn['modifytime']) < myself()->_getNowDaySeconds()) { +// $info['loginVal'] = 0; +// } +// } $battleDb = SqlHelper::ormSelectOne( myself()->_getMysql($openId), From 50677444b146ee0f43988b57674566ccdad8a49f Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Fri, 10 May 2024 15:00:46 +0800 Subject: [PATCH 08/12] 1 --- webapp/services/TameBattleDataService.php | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp/services/TameBattleDataService.php b/webapp/services/TameBattleDataService.php index a81e0944..c726aef4 100644 --- a/webapp/services/TameBattleDataService.php +++ b/webapp/services/TameBattleDataService.php @@ -544,6 +544,7 @@ class TameBattleDataService extends BaseService { $data = array( "battle_uuid" => $battleUuid, "map_mode_id" => getXVal($this->allInfo,'map_mode_id', 0), + "map_id" => getXVal($this->allInfo,'map_id', 0), "map_mode" => getXVal($this->allInfo,'map_mode', 0), "room_mode" => getXVal($this->allInfo,'room_mode', 0), "pvp_mode" => $pvp_mode, From 606af0bb98d492d259f30d50e6924d921297d9c5 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Sat, 11 May 2024 14:33:10 +0800 Subject: [PATCH 09/12] 1 --- webapp/services/FormulaService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/services/FormulaService.php b/webapp/services/FormulaService.php index 41063e61..02b18ae3 100644 --- a/webapp/services/FormulaService.php +++ b/webapp/services/FormulaService.php @@ -383,7 +383,7 @@ class FormulaService extends BaseService { //胜负率=1-(排名-1)/(最大排名-1) // $ranked = getXVal($params, 'pvp_personal_rank'); // $teamRank = min(getXVal($params, 'pvp_team_rank'),10); - $maxRanked = mt\Parameter::getVal('rank_order_max',40); //************** parameter 参数表获取 ************ + $maxRanked = mt\Parameter::getVal('rank_order_max',8); //************** parameter 参数表获取 ************ $winRate = 1-($ranked-1)/($maxRanked-1); //总胜率=70%*P(个人ELO值-敌队平均ELO值)+30%*P(己队平均ELO值-敌队平均ELO值) --> P(D)=1/(1+10^(-D/400)) $winRateSum = $winningPro; @@ -401,7 +401,7 @@ class FormulaService extends BaseService { //一个玩家的赛后积分 = 赛前积分+K/2*(MAX(胜负率-0.5,0))+K/2*(表现分-段位要求的及格分) 新 $kArr = explode('|',mt\Parameter::getVal('rank_k',0)); //************** parameter 参数表获取 ************ $K = $kArr[$rankMeta['rank_order2']-1]; - $battleAfterScore = $userDb['score'] + $K/2 * max(($winRate-0.5),0) + ($K/2) * ($expreScore-$askedScore); + $battleAfterScore = $userDb['score'] + $K * max(($winRate-$winningPro),0); return round($battleAfterScore); } From 6ff357f0378ba1892150dc6ac16b5fb0789be0d9 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Mon, 13 May 2024 10:53:35 +0800 Subject: [PATCH 10/12] 1 --- webapp/controller/UserController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index a727e37d..9ef1b6c3 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -1170,7 +1170,7 @@ class UserController extends BaseAuthedController { } private function _updateSubUserAccount() { - if ($this->_getChannel() == BC_CHANNEL) { + if ($this->_getChannel() == BC_POLY_CHANNEL) { $shortAccountId = $this->_getShortAccountId(myself()->_getAccountId()); SqlHelper::upsert ($this->_getSelfMysql(), From daac39597a98bc8792e488f635eaff1680d34dd5 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Mon, 13 May 2024 11:01:03 +0800 Subject: [PATCH 11/12] 1 --- webapp/controller/UserController.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 9ef1b6c3..74a2ab79 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -1168,7 +1168,10 @@ class UserController extends BaseAuthedController { } } } - +public function test(){ + $a = $this->_getShortAccountId("6517_2006_s1_0_104162729566475397176"); + print_r($a); +} private function _updateSubUserAccount() { if ($this->_getChannel() == BC_POLY_CHANNEL) { $shortAccountId = $this->_getShortAccountId(myself()->_getAccountId()); @@ -1183,7 +1186,7 @@ class UserController extends BaseAuthedController { 'modifytime' => myself()->_getNowTime(), ), array( - 'org_account_id' => myself()->_getAccountId(), + 'org_account_id' => $shortAccountId, 'cur_account_id' => myself()->_getAccountId(), 'createtime' => myself()->_getNowTime(), 'modifytime' => myself()->_getNowTime(), From 2dfdbcaf7b14403c45d4aeca2c865316067e3de2 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Mon, 13 May 2024 11:01:28 +0800 Subject: [PATCH 12/12] 1 --- webapp/controller/UserController.class.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 74a2ab79..173d50a2 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -1168,10 +1168,7 @@ class UserController extends BaseAuthedController { } } } -public function test(){ - $a = $this->_getShortAccountId("6517_2006_s1_0_104162729566475397176"); - print_r($a); -} + private function _updateSubUserAccount() { if ($this->_getChannel() == BC_POLY_CHANNEL) { $shortAccountId = $this->_getShortAccountId(myself()->_getAccountId());