1
This commit is contained in:
parent
0a29ccac7b
commit
28dec0c565
@ -55,7 +55,7 @@ class FragmentPool extends BaseModel {
|
|||||||
{
|
{
|
||||||
$allocTime = self::getAllocTime();
|
$allocTime = self::getAllocTime();
|
||||||
$rows = SqlHelper::ormSelect
|
$rows = SqlHelper::ormSelect
|
||||||
(myself()->_getMysql($targetId),
|
(myself()->_getSelfMysql(),
|
||||||
't_fragment_pool',
|
't_fragment_pool',
|
||||||
array(
|
array(
|
||||||
'fragment_type' => $type,
|
'fragment_type' => $type,
|
||||||
@ -77,7 +77,7 @@ class FragmentPool extends BaseModel {
|
|||||||
{
|
{
|
||||||
$allocTime = self::getAllocTime();
|
$allocTime = self::getAllocTime();
|
||||||
SqlHelper::update
|
SqlHelper::update
|
||||||
(myself()->_getMysql($targetId),
|
(myself()->_getSelfMysql(),
|
||||||
't_fragment_pool',
|
't_fragment_pool',
|
||||||
array(
|
array(
|
||||||
'fragment_id' => $itemId,
|
'fragment_id' => $itemId,
|
||||||
|
@ -17,7 +17,7 @@ class RealtimeData extends BaseModel {
|
|||||||
private static function internalGet($name)
|
private static function internalGet($name)
|
||||||
{
|
{
|
||||||
$row = SqlHelper::ormSelectOne
|
$row = SqlHelper::ormSelectOne
|
||||||
(myself()->_getMysql($targetId),
|
(myself()->_getSelfMysql(),
|
||||||
't_realtime_data',
|
't_realtime_data',
|
||||||
array(
|
array(
|
||||||
'name' => $name
|
'name' => $name
|
||||||
|
@ -71,7 +71,7 @@ class BattleDataService extends BaseService {
|
|||||||
public function updateBattleData()
|
public function updateBattleData()
|
||||||
{
|
{
|
||||||
error_log(json_encode($_REQUEST));
|
error_log(json_encode($_REQUEST));
|
||||||
$matchMode = getReqVal('match_mode');
|
$matchMode = getReqVal('match_mode', 0);
|
||||||
{
|
{
|
||||||
$heroDb = Hero::find(getReqVal('hero_uniid', 0));
|
$heroDb = Hero::find(getReqVal('hero_uniid', 0));
|
||||||
if (!$heroDb) {
|
if (!$heroDb) {
|
||||||
@ -122,7 +122,7 @@ class BattleDataService extends BaseService {
|
|||||||
$this->updatePvpData();
|
$this->updatePvpData();
|
||||||
$this->rewardCegPvp();
|
$this->rewardCegPvp();
|
||||||
$this->rewardFragmentPvp();
|
$this->rewardFragmentPvp();
|
||||||
$this->_incDailyV(TN_DAILY_PVP_BATTLE_TIMES, 1);
|
myself()->_incDailyV(TN_DAILY_PVP_BATTLE_TIMES, 0, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case self::MATCH_MODE_MATCH:
|
case self::MATCH_MODE_MATCH:
|
||||||
@ -139,7 +139,7 @@ class BattleDataService extends BaseService {
|
|||||||
$this->rewardCegPve();
|
$this->rewardCegPve();
|
||||||
$this->rewardFragmentPve();
|
$this->rewardFragmentPve();
|
||||||
}
|
}
|
||||||
$this->_incDailyV(TN_DAILY_PVE_BATTLE_TIMES, 1);
|
myself()->_incDailyV(TN_DAILY_PVE_BATTLE_TIMES, 0, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -497,11 +497,11 @@ class BattleDataService extends BaseService {
|
|||||||
|
|
||||||
private function rewardFragmentPvp()
|
private function rewardFragmentPvp()
|
||||||
{
|
{
|
||||||
$todayPveGetFragmentNum = $this->_getDailyV(TN_DAILY_PVE_GET_FRAGMENT_NUM, 0);
|
$todayPveGetFragmentNum = myself()->_getDailyV(TN_DAILY_PVE_GET_FRAGMENT_NUM, 0);
|
||||||
$todayPvpGetFragmentNum = $this->_getDailyV(TN_DAILY_PVP_GET_FRAGMENT_NUM, 0);
|
$todayPvpGetFragmentNum = myself()->_getDailyV(TN_DAILY_PVP_GET_FRAGMENT_NUM, 0);
|
||||||
|
|
||||||
if ($todayPveGetFragmentNum + $todayPvpGetFragmentNum < self::MAX_DROP_NUM) {
|
if ($todayPveGetFragmentNum + $todayPvpGetFragmentNum < self::MAX_DROP_NUM) {
|
||||||
$todayPvpBattleTimes = $this->_getDailyV(TN_DAILY_PVP_BATTLE_TIMES, 0);
|
$todayPvpBattleTimes = myself()->_getDailyV(TN_DAILY_PVP_BATTLE_TIMES, 0);
|
||||||
|
|
||||||
$onlineNum = RealtimeData::getOnline();
|
$onlineNum = RealtimeData::getOnline();
|
||||||
$heroFragmentNum = FragmentPool::getHeroNum();
|
$heroFragmentNum = FragmentPool::getHeroNum();
|
||||||
@ -512,7 +512,7 @@ class BattleDataService extends BaseService {
|
|||||||
$onlineNum,
|
$onlineNum,
|
||||||
$heroFragmentNum,
|
$heroFragmentNum,
|
||||||
$todayPvpBattleTimes);
|
$todayPvpBattleTimes);
|
||||||
$gunProbability = FormulaService::calcGunFragmentProbabilityPvp
|
$gunProbability = FormulaService::calcWeaponFragmentProbabilityPvp
|
||||||
($_REQUEST,
|
($_REQUEST,
|
||||||
$onlineNum,
|
$onlineNum,
|
||||||
$gunFragmentNum,
|
$gunFragmentNum,
|
||||||
@ -526,9 +526,9 @@ class BattleDataService extends BaseService {
|
|||||||
|
|
||||||
private function rewardFragmentPve()
|
private function rewardFragmentPve()
|
||||||
{
|
{
|
||||||
$todayPveBattleTimes = $this->_getDailyV(TN_DAILY_PVE_BATTLE_TIMES, 0);
|
$todayPveBattleTimes = myself()->_getDailyV(TN_DAILY_PVE_BATTLE_TIMES, 0);
|
||||||
$todayPveGetFragmentNum = $this->_getDailyV(TN_DAILY_PVE_GET_FRAGMENT_NUM, 0);
|
$todayPveGetFragmentNum = myself()->_getDailyV(TN_DAILY_PVE_GET_FRAGMENT_NUM, 0);
|
||||||
$todayPvpGetFragmentNum = $this->_getDailyV(TN_DAILY_PVP_GET_FRAGMENT_NUM, 0);
|
$todayPvpGetFragmentNum = myself()->_getDailyV(TN_DAILY_PVP_GET_FRAGMENT_NUM, 0);
|
||||||
|
|
||||||
if ($todayPveGetFragmentNum + $todayPvpGetFragmentNum < self::MAX_DROP_NUM) {
|
if ($todayPveGetFragmentNum + $todayPvpGetFragmentNum < self::MAX_DROP_NUM) {
|
||||||
$onlineNum = RealtimeData::getOnline();
|
$onlineNum = RealtimeData::getOnline();
|
||||||
@ -713,7 +713,7 @@ class BattleDataService extends BaseService {
|
|||||||
|
|
||||||
private function procDrop($dropIdx)
|
private function procDrop($dropIdx)
|
||||||
{
|
{
|
||||||
$matchMode = getReqVal('match_mode');
|
$matchMode = getReqVal('match_mode', 0);
|
||||||
if ($dropIdx == 0) {
|
if ($dropIdx == 0) {
|
||||||
$itemId = FragmentPool::dropHero();
|
$itemId = FragmentPool::dropHero();
|
||||||
if ($itemId) {
|
if ($itemId) {
|
||||||
@ -723,9 +723,9 @@ class BattleDataService extends BaseService {
|
|||||||
'item_num' => 1
|
'item_num' => 1
|
||||||
));
|
));
|
||||||
if ($matchMode == self::MATCH_MODE_PVE) {
|
if ($matchMode == self::MATCH_MODE_PVE) {
|
||||||
$this->_incDailyV(TN_DAILY_PVE_GET_FRAGMENT_NUM, 1);
|
myself()->_incDailyV(TN_DAILY_PVE_GET_FRAGMENT_NUM, 0, 1);
|
||||||
} else {
|
} else {
|
||||||
$this->_incDailyV(TN_DAILY_PVP_GET_FRAGMENT_NUM, 1);
|
myself()->_incDailyV(TN_DAILY_PVP_GET_FRAGMENT_NUM, 0, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ($dropIdx == 1) {
|
} else if ($dropIdx == 1) {
|
||||||
@ -737,9 +737,9 @@ class BattleDataService extends BaseService {
|
|||||||
'item_num' => 1
|
'item_num' => 1
|
||||||
));
|
));
|
||||||
if ($matchMode == self::MATCH_MODE_PVE) {
|
if ($matchMode == self::MATCH_MODE_PVE) {
|
||||||
$this->_incDailyV(TN_DAILY_PVE_GET_FRAGMENT_NUM, 1);
|
myself()->_incDailyV(TN_DAILY_PVE_GET_FRAGMENT_NUM, 0, 1);
|
||||||
} else {
|
} else {
|
||||||
$this->_incDailyV(TN_DAILY_PVP_GET_FRAGMENT_NUM, 1);
|
myself()->_incDailyV(TN_DAILY_PVP_GET_FRAGMENT_NUM, 0, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ class FormulaService extends BaseService {
|
|||||||
if (!$meta) {
|
if (!$meta) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$weaponProbability = min($FragmentNum / $onlineNum *
|
$weaponProbability = min($weaponFragmentNum / $onlineNum *
|
||||||
5 *
|
5 *
|
||||||
(
|
(
|
||||||
0.5 * $rankedTopX * $meta['ranked_topx'] +
|
0.5 * $rankedTopX * $meta['ranked_topx'] +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user