System Information
Field | Value |
---|---|
Operating System | Linux - Debian GNU/Linux 12 on x86_64 |
Product | AMP ‘Phobos’ v2.6.0.6 (Mainline) |
Virtualization | Docker |
Application | Valheim |
Module | GenericModule |
Running in Container | Yes |
Current State | Ready |
Task
Valheim @User and @UserCount wrong
Problem Description
Issue
I have scheduled tasks for the events of when a player either leaves or joins my Valheim server. It is formatted like this “{@User} has joined ({@UserCount} playing).” and posted to our Discord server. This seems to work just fine for when players are joining the server, but then the values become erratic when someone leaves.
For example, we had 8 people playing and the last message was (names redacted):
Player 8 has joined (8 playing).
But then as people starting leaving we got these messages:
Player 1 has left (7 playing). → Correct
Player 8 has left (0 playing). → The issue. Why down to 0 players now?
Player 3 has left (3 playing). → Somehow we are at 3 now
Player 2 has left (2 playing). → Counting down again?
Additionally one of my players reported that it incorrectly reported that he left the server, even though he was still playing.
It seems like the server has trouble keeping track of the active players. I took a look at the docker logs and players are identified by SteamID so in theory it should be straight forward to keep track of who is there. Is there something I need to configure that would help fix this? Please let me know if there’s anything else you need, thank you!
Reproduction Steps
- Create a stock Valheim server
- Add scheduled tasks to emit user and usercount values when a player leaves or joins
- Have several players join
- Have several players leave