diff --git a/webapp/controller/RoleController.class.php b/webapp/controller/RoleController.class.php index ee0da13..6aa09ee 100644 --- a/webapp/controller/RoleController.class.php +++ b/webapp/controller/RoleController.class.php @@ -131,7 +131,8 @@ class RoleController{ $account_id = $_REQUEST['account_id']; $user_name = $_REQUEST['name']; $avatar_url = $_REQUEST['avatar_url']; - $switch_id = $_REQUEST['switch_id']; + $switch_id = 1; + $switch_id = isset($_REQUEST['switch_id']); //登录校验 $login = loginVerify($account_id, $_REQUEST['session_id']); if (!$login) { diff --git a/webapp/controller/TeamController.class.php b/webapp/controller/TeamController.class.php index fce7549..202484e 100644 --- a/webapp/controller/TeamController.class.php +++ b/webapp/controller/TeamController.class.php @@ -23,6 +23,31 @@ class TeamController{ } $team_uuid = $node_id . '_' . md5($_REQUEST['account_id']) . time(); + $cloth_id = 0; + $hair_id = 0; + $color_id = 0; + $hat_id = 0; + $rank = 1; + $equip_id = 0; + if (isset($_REQUEST['cloth_id'])) { + $cloth_id = $_REQUEST['cloth_id']; + } + if (isset($_REQUEST['hair_id'])) { + $hair_id = $_REQUEST['hair_id']; + } + if (isset($_REQUEST['color_id'])) { + $color_id = $_REQUEST['color_id']; + } + if (isset($_REQUEST['hat_id'])) { + $hat_id = $_REQUEST['hat_id']; + } + if (isset($_REQUEST['rank'])) { + $rank = $_REQUEST['rank']; + } + if (isset($_REQUEST['equip_id'])) { + $equip_id = $_REQUEST['equip_id']; + } + $team_db = array( 'team_uuid' => $team_uuid, 'auto_fill' => $_REQUEST['auto_fill'], @@ -33,6 +58,12 @@ class TeamController{ 'account_id' => $_REQUEST['account_id'], 'name' => $_REQUEST['name'], 'avatar_url' => $_REQUEST['avatar_url'], + 'cloth_id' => $cloth_id, + 'hair_id' => $hair_id, + 'color_id' => $color_id, + 'hat_id' => $hat_id, + 'rank' => $rank, + 'equip_id' => $equip_id ) )); @@ -75,6 +106,12 @@ class TeamController{ 'account_id' => $member['account_id'], 'name' => $member['name'], 'avatar_url' => $member['avatar_url'], + 'cloth_id' => $member['cloth_id'], + 'hair_id' => $member['hair_id'], + 'color_id' => $member['color_id'], + 'hat_id' => $member['hat_id'], + 'rank' => $member['rank'], + 'equip_id' => $member['equip_id'], )); } echo json_encode(array( @@ -99,7 +136,6 @@ class TeamController{ $user_db_str = $r->get(TEAMID_KEY.$team_uuid); - error_log($team_uuid); if (empty($user_db_str)) { phpcommon\sendError(ERR_USER_BASE + 1,'session失效1'); return; @@ -127,11 +163,42 @@ class TeamController{ return; } + $cloth_id = 0; + $hair_id = 0; + $color_id = 0; + $hat_id = 0; + $rank = 1; + $equip_id = 0; + if (isset($_REQUEST['cloth_id'])) { + $cloth_id = $_REQUEST['cloth_id']; + } + if (isset($_REQUEST['hair_id'])) { + $hair_id = $_REQUEST['hair_id']; + } + if (isset($_REQUEST['color_id'])) { + $color_id = $_REQUEST['color_id']; + } + if (isset($_REQUEST['hat_id'])) { + $hat_id = $_REQUEST['hat_id']; + } + if (isset($_REQUEST['rank'])) { + $rank = $_REQUEST['rank']; + } + if (isset($_REQUEST['equip_id'])) { + $equip_id = $_REQUEST['equip_id']; + } + array_push ($user_db['member_list'], array( 'idx' => $member_num + 1, 'account_id' => $_REQUEST['account_id'], 'name' => $_REQUEST['name'], 'avatar_url' => $_REQUEST['avatar_url'], + 'cloth_id' => $cloth_id, + 'hair_id' => $hair_id, + 'color_id' => $color_id, + 'hat_id' => $hat_id, + 'rank' => $rank, + 'equip_id' => $member['equip_id'], )); $r->set(TEAMID_KEY . $team_uuid, json_encode($user_db)); $r -> pexpire(TEAMID_KEY . $team_uuid, 1000 * 600);