1
This commit is contained in:
parent
ed825ebac3
commit
b48af6a792
@ -72,7 +72,7 @@ class EquipController{
|
||||
} else {
|
||||
if ($row['active_time'] != 0) {
|
||||
$active_time = 2;
|
||||
$equip_level = 8;
|
||||
$equip_level = 10;
|
||||
} else {
|
||||
$active_time = 0;
|
||||
$equip_level = $row['equip_level'];
|
||||
@ -126,7 +126,7 @@ class EquipController{
|
||||
':accountid' => $account_id,
|
||||
':equip_id' => $equip_id,
|
||||
':equip_level' => $e['equip_nextlevel'],
|
||||
':equip_experience_level' => 8,
|
||||
':equip_experience_level' => 10,
|
||||
':active_time' => 0,
|
||||
));
|
||||
if (!$ret) {
|
||||
|
@ -21,6 +21,7 @@ class teamController{
|
||||
$team_db = array(
|
||||
'team_uuid' => $team_uuid,
|
||||
'auto_fill' => $_REQUEST['auto_fill'],
|
||||
'state' => 0,
|
||||
'member_list' => array(
|
||||
array(
|
||||
'idx' => 1,
|
||||
@ -75,6 +76,7 @@ class teamController{
|
||||
'errmsg'=> '',
|
||||
'team_uuid' => $team_uuid,
|
||||
'auto_fill' => $user_db['auto_fill'],
|
||||
'state' => $user_db['state'],
|
||||
'member_list' => $member_list,
|
||||
));
|
||||
}
|
||||
@ -83,19 +85,21 @@ class teamController{
|
||||
public function joinTeam()
|
||||
{
|
||||
$team_uuid = $_REQUEST['team_uuid'];
|
||||
|
||||
$r = $this->getRedis($team_uuid);
|
||||
|
||||
if (!$r){
|
||||
echo 'is null';
|
||||
}else {
|
||||
$user_db_str = $r->get(TEAMID_KEY.$team_uuid);
|
||||
|
||||
if (empty($user_db_str)){
|
||||
phpcommon\sendError(ERR_USER_BASE + 1,'session失效');
|
||||
phpcommon\sendError(ERR_USER_BASE + 1,'session失效1');
|
||||
return;
|
||||
}
|
||||
$user_db = json_decode($user_db_str, true);
|
||||
if (empty($user_db)){
|
||||
phpcommon\sendError(ERR_USER_BASE + 1, 'session失效');
|
||||
phpcommon\sendError(ERR_USER_BASE + 1, 'session失效2');
|
||||
return;
|
||||
}
|
||||
$member_num = count($user_db['member_list']);
|
||||
@ -262,5 +266,42 @@ class teamController{
|
||||
'errmsg' => '',
|
||||
));
|
||||
}
|
||||
|
||||
public function startGame()
|
||||
{
|
||||
$team_uuid = $_REQUEST['team_uuid'];
|
||||
$r = $this->getRedis($team_uuid);
|
||||
|
||||
if (!$r){
|
||||
echo 'is null';
|
||||
}else{
|
||||
$user_db_str = $r->get(TEAMID_KEY . $team_uuid);
|
||||
|
||||
if (empty($user_db_str)){
|
||||
phpcommon\sendError(ERR_USER_BASE + 1,'session失效1');
|
||||
return;
|
||||
}
|
||||
$user_db = json_decode($user_db_str, true);
|
||||
if (empty($user_db)){
|
||||
phpcommon\sendError(ERR_USER_BASE + 1,'session失效2');
|
||||
return;
|
||||
}
|
||||
foreach ($user_db['member_list'] as $member) {
|
||||
if ($member['account_id'] == $_REQUEST['account_id']){
|
||||
if($member['idx'] != 1){
|
||||
phpcommon\sendError(ERR_USER_BASE + 4,'你不是队长');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
$user_db['state'] = $_REQUEST['state'];
|
||||
$r->set(TEAMID_KEY . $team_uuid, json_encode($user_db));
|
||||
$r->pexpire(TEAMID_KEY . $team_uuid, 1000 * 3600);
|
||||
}
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg' => '',
|
||||
));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user