1
0
Ответвление 1

GetOnlinePlayers() does not return an indexed array #2

Закрыто
открыта 2018-07-16 11:42:08 +00:00 Ad5001 · комментариев: 0
Ad5001 оставлен комментарий в 2018-07-16 11:42:08 +00:00
Владелец

Original issue #2 by Awzaw created at 2017-11-10T21:53:15Z

6a5ddcd42d/src/Ad5001/PlayerSelectors/selector/ClosestPlayer.php (L30)

This won't work because the array returned by GetOnlinePlayers() is not an indexed array, but an associative array with the players rawUUID as the key:

https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/Server.php#L2306

Also, your function needs to return an array with the name of the player, not the Player object.

Original issue [#2](https://github.com/Ad5001/PlayerSelectors/issues/2) by [Awzaw](https://github.com/Awzaw) created at 2017-11-10T21:53:15Z https://github.com/Ad5001/PlayerSelectors/blob/6a5ddcd42da3030fbe1e0356c3fbfea17e78657f/src/Ad5001/PlayerSelectors/selector/ClosestPlayer.php#L30 This won't work because the array returned by GetOnlinePlayers() is not an indexed array, but an associative array with the players rawUUID as the key: https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/Server.php#L2306 Also, your function needs to return an array with the name of the player, not the Player object.
Ad5001 назначил(а) на себя 2018-07-16 11:42:08 +00:00
Ad5001 задача была закрыта 2018-07-16 11:42:08 +00:00
Войдите, чтобы присоединиться к обсуждению.
Нет меток
Нет этапа
Нет проекта
Нет назначенных лиц
1 участник
Уведомления
Срок выполнения
Срок выполнения недействителен или находится за пределами допустимого диапазона. Пожалуйста, используйте формат «гггг-мм-дд».

Срок выполнения не установлен.

Зависимости

Зависимостей нет.

Ссылка: Ad5001/PlayerSelectors#2
Описание отсутствует.