Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraria: Undefined propery when server does not return player list #712

Open
RikoDEV opened this issue Jul 15, 2023 · 0 comments
Open

Terraria: Undefined propery when server does not return player list #712

RikoDEV opened this issue Jul 15, 2023 · 0 comments

Comments

@RikoDEV
Copy link
Contributor

RikoDEV commented Jul 15, 2023

Server: penguingames.fun:7777

{
  "status": 200,
  "name": "Penguin Games",
  "serverversion": "1.4.4.9 (PC/Mobile)",
  "tshockversion": "4.4.0.15",
  "port": 7777,
  "playercount": 54,
  "maxplayers": 99999,
  "world": "Penguin Games",
  "uptime": "6.14:41:30",
  "serverpassword": false
}

Error:

  Undefined property: stdClass::$players

  at vendor\austinb\gameq\src\GameQ\Protocols\Tshock.php:132
    128▕         $result->add('numplayers', $json->playercount);
    129▕         $result->add('maxplayers', $json->maxplayers);
    130▕
    131▕         // Parse players
  ➜ 132▕         foreach ($json->players as $player) {
    133▕             $result->addPlayer('nickname', $player->nickname);
    134▕             $result->addPlayer('username', $player->username);
    135▕             $result->addPlayer('group', $player->group);
    136▕             $result->addPlayer('active', (int)$player->active);

  1   vendor\austinb\gameq\src\GameQ\Protocols\Tshock.php:132
      Illuminate\Foundation\Bootstrap\HandleExceptions::Illuminate\Foundation\Bootstrap\{closure}("Undefined property: stdClass::$players", "C:\Users\user\PhpstormProjects\project\vendor\austinb\gameq\src\GameQ\Protocols\Tshock.php")

  2   vendor\austinb\gameq\src\GameQ\GameQ.php:595
      GameQ\Protocols\Tshock::processResponse()
RikoDEV added a commit to RikoDEV/GameQ that referenced this issue Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant