Player-specific debug output in local chat only
Posted: Mon Oct 21, 2024 5:17 pm
I want to have runtime-per-user settings for enabling debug output for some categories.
Users should also be able to enable debug output relevant to the last entity they themselves placed in their current game session.
Debug messages should only be visible as chat messages to the player, who enabled them.
Messages don't need to be saved or synced to other users as those shouldn't be able to see them anyways.
Are messages output via Player.print only visible to that player (that is what i want)?
Can I call Player.print with a message only in the local instance of the mod which runs on that player's client without causing a desync if I set game_state = false in the PrintSettings given to Player.print?
Is there any way to find out which player runs the client, my code is physically executed on?
I want to use that to skip debug code for players who didn't enable it. The debug code is free of side effects apart from outputting debug messages. It doesn't have state worth saving or syncing.
Users should also be able to enable debug output relevant to the last entity they themselves placed in their current game session.
Debug messages should only be visible as chat messages to the player, who enabled them.
Messages don't need to be saved or synced to other users as those shouldn't be able to see them anyways.
Are messages output via Player.print only visible to that player (that is what i want)?
Can I call Player.print with a message only in the local instance of the mod which runs on that player's client without causing a desync if I set game_state = false in the PrintSettings given to Player.print?
Is there any way to find out which player runs the client, my code is physically executed on?
I want to use that to skip debug code for players who didn't enable it. The debug code is free of side effects apart from outputting debug messages. It doesn't have state worth saving or syncing.