Page MenuHomeFeedback Tracker

allPlayers delayed on mission start, on dedicated server
New, NormalPublic


allPlayers can be delayed on a dedicated server, causing issues for mods and missions that rely on it and expected it to be reliable.


Operating System
Windows 10 x64
Steps To Reproduce
  1. Start mission on a dedicated server.
  2. Observe allPlayers vs call BIS_fnc_listPlayers after briefing ends.
  3. Possibly repeat steps a few times.
Additional Information

Wiki only states that

In a player-hosted game, the complete array of allPlayers may get delayed on mission start. Use BIS_fnc_listPlayers if you need it earlier.

Which, would imply that it should be reliable on a dedicated server, however I recently ran into an issue on a dedicated server where allPlayers wasn't returning all of the players for a bit after mission start.

Mission used to confirm issue, both with and without mods:

Test mission usage:

  1. Confirm "postInit: [] != [p0]" is shown in briefing.
  2. Wait for "postInit: [p0] == [p0] after X seconds" after mission start.
  3. If seconds is < 1, restart mission and try again.

Screenshot of result on a modded dedicated server.

Screenshot of result on a locally hosted non-modded dedicated server.

Event Timeline

Coryf88 created this task.Sat, Aug 6, 1:29 AM

Ok, updated biki. Have you tried allUsers / getUserInfo instead?

Thanks for updating the wiki to reflect these findings, however I reported it to the issue tracker in hope that it could be fixed.

I was not able to replicate this issue with getUserInfo, it consistently returns the player object in a spawn on postInit.

BIS_fnc_KK added a comment.EditedSat, Aug 6, 6:12 PM

could you provide 2 scripts side by side one using allplayers and one using getuserinfo doing the same thing but allplayers failing?