[1.1.68] banned and unbanned raised with no state change
Posted: Mon Sep 12, 2022 11:59 am
The game's on_player_banned and on_player_unbanned events are raised when a player is banned or unbanned. I have outlined my 2 problems with the events below:
1. on_player_banned
When a player is banned once, the event is raised - as it should be.
When the player is however banned for the second time, the event is raised with the new description and by_player in the event data, but the banlist JSON is not updated. In my opinion, this should be changed, the event should not be raised if the player was banned previously. In my opinion, this should be changed so that the event is raised only when the state changed from unbanned to banned, and at no other time.
2. on_player_unbanned
This event is raised any time when there is an attempt to run the /unban or game.unban_player commands, even if the player was not banned. The response to /unban is that the player was not banned previously, so the game does know whether the player was actually unbanned. In my opinion, the events should be raised only when a player is actually unbanned - the player state changes from banned to unbanned.
1. on_player_banned
When a player is banned once, the event is raised - as it should be.
When the player is however banned for the second time, the event is raised with the new description and by_player in the event data, but the banlist JSON is not updated. In my opinion, this should be changed, the event should not be raised if the player was banned previously. In my opinion, this should be changed so that the event is raised only when the state changed from unbanned to banned, and at no other time.
2. on_player_unbanned
This event is raised any time when there is an attempt to run the /unban or game.unban_player commands, even if the player was not banned. The response to /unban is that the player was not banned previously, so the game does know whether the player was actually unbanned. In my opinion, the events should be raised only when a player is actually unbanned - the player state changes from banned to unbanned.