PHP game server for TerranQuest. https://terranquest.net

setteam.php 428B

1234567891011121314
  1. <?php
  2. require 'required.php';
  3. require 'onlyloggedin.php';
  4. if ($VARS['teamid'] < 1 || $VARS['teamid'] > 6) {
  5. sendError(INVALID_TEAM_ID, true);
  6. }
  7. $currentteam = $database->select('players', 'teamid', ['uuid' => $_SESSION['uuid']])[0];
  8. if ($currentteam > 0 && $currentteam < 7) {
  9. sendError(TEAM_ALREADY_CHOSEN, true);
  10. }
  11. $database->update('players', ['teamid' => $VARS['teamid']], ['uuid' => $_SESSION['uuid']]);
  12. sendOK();