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

Cfx/Gta5m does not work if players are on #701

Open
justinnobledev opened this issue May 11, 2023 · 1 comment
Open

Cfx/Gta5m does not work if players are on #701

justinnobledev opened this issue May 11, 2023 · 1 comment
Labels
Bug This request does fix a bug. Information Required More information required to continue v3

Comments

@justinnobledev
Copy link

While a player is online and using the Gta5m Protocol GameQ will produce the following error. I tried investigating it myself to fix it but was not able to figure out how to solve this error.

Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, string given in C:\xampp\htdocs\test\GameQ-3\src\GameQ\Filters\Normalize.php:115
Stack trace:
#0 C:\xampp\htdocs\test\GameQ-3\src\GameQ\Filters\Normalize.php(115): array_key_exists('nick', '127.0.0.1')
#1 C:\xampp\htdocs\test\GameQ-3\src\GameQ\Filters\Normalize.php(67): GameQ\Filters\Normalize->check('player', '127.0.0.1')
#2 C:\xampp\htdocs\test\GameQ-3\src\GameQ\GameQ.php(650): GameQ\Filters\Normalize->apply(Array, Object(GameQ\Server))
#3 C:\xampp\htdocs\test\GameQ-3\src\GameQ\GameQ.php(370): GameQ\GameQ->doApplyFilters(Array, Object(GameQ\Server))
#4 C:\xampp\htdocs\test\GameQ-3\src\GameQ\Protocols\Cfx.php(119): GameQ\GameQ->process()
#5 C:\xampp\htdocs\test\GameQ-3\src\GameQ\GameQ.php(483): GameQ\Protocols\Cfx->beforeSend(Object(GameQ\Server))
#6 C:\xampp\htdocs\test\GameQ-3\src\GameQ\GameQ.php(360): GameQ\GameQ->doQueries()
#7 C:\xampp\htdocs\test\index.php(14): GameQ\GameQ->process()
#8 {main}
  thrown in C:\xampp\htdocs\test\GameQ-3\src\GameQ\Filters\Normalize.php on line 115

Here is a small test script that demonstrates the issue

$GameQ = new \GameQ\GameQ();
$GameQ->addServer([
    'type' => 'Gta5m',
    'host' => '<ip>:<port>',
]);

$results = $GameQ->process();

print_r($results);

Most of the FiveM query information can be found at these two links that are self-hosted by the server

http://<serverip>:<port>/info.json
http://<serverip>:<port>/players.json

An example of the players.json is

[
  {
    "endpoint": "127.0.0.1",
    "id": 6,
    "identifiers": [
      "steam:110000105127b84",
      "license:13fb7c4176770dab3352282f4b1348d82cf36606",
      "xbl:2533274878728153",
      "live:985156547261461",
      "discord:216392362161733633",
      "fivem:113664",
      "license2:bbf289a0fdc06077cdede027161c8077df302b96"
    ],
    "name": "retro",
    "ping": 53
  }
]
@Austinb
Copy link
Owner

Austinb commented May 15, 2023

Need a couple of servers to test against. It is possible something has changed on the server output side causing the queries to fail.

@Austinb Austinb added Bug This request does fix a bug. v3 Information Required More information required to continue labels May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This request does fix a bug. Information Required More information required to continue v3
Projects
None yet
Development

No branches or pull requests

2 participants