My plugin
ABM has 2 bugs (one is rare, the other extremely rare).
- Between loading screens, if a person crashes, quits, times out during a tiny window, it can screw up the counting of team mates. This is the only time I can't track a player disconnecting.
- For some reason (completely unrepeatable, very random), rarely someone gets moved to spectator.
I believe I can solve these two bugs if I can find the correct
moment to iterate over the survivors. I can set an explicit spectator flag pretty easily where if a person didn't explicitly choose to be a spectator, I'll put them back on their team. Also by finding the best time to iterate over all of the survivors, I can fix the count for those rare disconnects that don't fire the
player_disconnect event.
My approach would be this. After all players are loaded, iterate over them and find the ones that are no longer connected and remove them from the StringMap. Once this is done, start a timer that will watch out for spectators that didn't explicitly ask to spectate.
My problem is, I don't know the perfect moment, in which ALL players are really and finally connected AND where GetClientAuthId would actually work. I had some hacks that worked but I felt quite uncomfortable with them. Any help is greatly appreciated