OnPlayer/UserUnbanned hooks not being calledFixed
This universal hook is never called:
void OnUserUnbanned(string name, string id, string ipAddress)
{
    Puts($"Player {name} ({id}) at {ipAddress} was unbanned");
}​
How are you unbanning users?
That hook is only called when Rust removes a user from the Banned user group, I.e. bans.cfg.
I have tried various ways to trigger the hook call, such as the console command and the IPlayer.Unban interface.

I still can not reproduce a call to the hook. I am using console `unban` followed by `writecfg`.

The only reliable method that I have found, so far, is to cache a list of banned users and run a periodic check/update against the ServerUsers list. This is not an ideal way, however, because it is an event driven by a timer.

5e13a8d5b2bc5.jpg Wulf
That hook is only called when Rust removes a user from the Banned user group, I.e. bans.cfg.

This never occurs. I have confirmed that, while the entry is in fact removed from bans.cfg, the hook is not called.

Indeed it is not, can confirm now - that is because the user is removed from ServerUsers and only after that Oxide checks if it is there and has banned group, so that never happens and the hook is never called.
Yes, the hook call in RustHooks.cs is unreachable code. Ideally, the function should have a signature like:
IOnServerUsersRemove(ulong steamId, ServerUsers.UserGroup group)​
So that IOnServerUsersRemove can decide if the user was banned.
The hook index was wrong, should be fixed in the next update.
Thank you. Can you confirm also that the test in RustHooks.cs(279)
if (ServerUsers.Is(steamId, ServerUsers.UserGroup.Banned))​

is also valid after the fix, due to order of operations? If the user is removed before that test takes place, it will always evaluate to false.

The user is removed after the hooks are called now, which is the index change.
Cheers.
Locked automatically