1
This commit is contained in:
parent
e61198c2a8
commit
69fd8c5bd0
@ -7,6 +7,7 @@ define('PLANET_BUY_KEY', 'game2006api:planet_buy:');
|
|||||||
|
|
||||||
define('LAST_SESSION_KEY', 'last_session:');
|
define('LAST_SESSION_KEY', 'last_session:');
|
||||||
define('MATCH_CURRENT_TEAM_KEY', 'match:current_team:');
|
define('MATCH_CURRENT_TEAM_KEY', 'match:current_team:');
|
||||||
|
define('MATCH_OK_KEY', 'match:current_team:');
|
||||||
|
|
||||||
define('V_ITEM_GOLD', 10001); //金币
|
define('V_ITEM_GOLD', 10001); //金币
|
||||||
define('V_ITEM_DIAMOND', 10014); //钻石
|
define('V_ITEM_DIAMOND', 10014); //钻石
|
||||||
|
@ -32,7 +32,7 @@ class MatchController extends BaseAuthedController {
|
|||||||
$this->_rspErr(1, 'The team has been disbanded');
|
$this->_rspErr(1, 'The team has been disbanded');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$r->pexpire(TEAMID_KEY . $teamUuid, 1000*600);
|
$matchDb = $this->readCurrMatchTeam($r);
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
'team_info' => $teamDb
|
'team_info' => $teamDb
|
||||||
));
|
));
|
||||||
@ -54,13 +54,20 @@ class MatchController extends BaseAuthedController {
|
|||||||
if (empty($teamDbStr)) {
|
if (empty($teamDbStr)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
$r->refreshKeyExpire($r, TEAMID_KEY . $teamUuid, 1000*600);
|
||||||
$teamDb = json_decode($teamDbStr, true);
|
$teamDb = json_decode($teamDbStr, true);
|
||||||
return $teamDb;
|
return $teamDb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
{
|
||||||
|
"current_team": "dafsdf"
|
||||||
|
"match_time": 231434
|
||||||
|
}
|
||||||
|
*/
|
||||||
private function readCurrMatchTeam($r)
|
private function readCurrMatchTeam($r)
|
||||||
{
|
{
|
||||||
$teamDbStr = $r->get(MATCH_CURRENT_TEAM_KEY . $teamUuid);
|
$teamDbStr = $r->get(MATCH_CURRENT_TEAM_KEY);
|
||||||
if (empty($teamDbStr)) {
|
if (empty($teamDbStr)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -68,4 +75,26 @@ class MatchController extends BaseAuthedController {
|
|||||||
return $teamDb;
|
return $teamDb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
{
|
||||||
|
"target_team": "dafsdf"
|
||||||
|
"match_time": 231434
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
private function readMatchOk($r, $teamUuid)
|
||||||
|
{
|
||||||
|
$teamDbStr = $r->get(MATCH_OK_KEY . $teamUuid);
|
||||||
|
if (empty($teamDbStr)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$this->refreshKeyExpire($r, MATCH_OK_KEY . $teamUuid, 1000*600);
|
||||||
|
$teamDb = json_decode($teamDbStr, true);
|
||||||
|
return $teamDb;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function refreshKeyExpire($r, $key, $time)
|
||||||
|
{
|
||||||
|
$r->pexpire($key, $time);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user