Hey. I have a new bug on my local test server that is actually weird.
I have a little thing monitoring the number of active players. It has been loyal and hard-working so far, but lately when I test my mod alone on my local server, he starts reporting more players.
The value it indicaties is straight out BasePlayer.activePlayerList.Count. The server console confirms that number.
I check, I dont do anything silly like "new BasePlayer", "AddComponent<BasePlayer>()", .activePlayerList.Add() or similar.
Now im not talking about a couple players added. Im talking about 50, 176, 2041, 5874 ghost players and counting ... the number grows at seemingly random intervals. I had ZLevel plugins that went crazy about because he had to save tons of players that were not initialized right.
And its not just numbers : I actually had a couple of " has disconnected" (no name) messages in-game, and some player-related events reacting to it.
What can cause extra ghost players to appear in that list ? Note that .sleepingPlayerList was unaffected.
Solved Crazy BasePlayer.activePlayerList bug filling with ghosts.
Discussion in 'Rust Development' started by Yatta, Aug 9, 2016.
-
Wulf Community Admin
Do you have any plugins adding NPCs?
-
Yes I do : I add all sorts of animals prefabs (but not nearly as many as indicated by activePlayerList), and then disable the ai with NPCAI.ServerDestroy.
Its been a while since I have those tough, and the bug just started tonight. -
Found it. Turns out I was actually doing a very silly "list = BasePlayers.activePlayers" instead of a new List with an AddRange and doing unspeakable things to that list. Sorry, im not a smart person.
