This hook appears not to be working anymore since update?
OnPlayerBanned hook stopped workingFixed
How exactly are you using it?
As stated in the API Doc page: void OnPlayerBanned(string name, ulong id, string address, string reason)
Merged post
Is this a oxide issue or am I calling the wrong parameters?
That should work fine. Could you try adding "ulongexpiry" as a 5th arg though?
void OnPlayerBanned(string name, ulong id, string address, string reason, ulong expiry)
doesnt work either
Merged post
This was working fine before update, I didn't change anything .. if that helps you.
The only change to the hook was that arg additional, which is entirely optional.
I tried both ways, it doesn't trigger, can you take a better look at it when you get a chance?
Interface.CallHook("OnPlayerBanned", connection, message);
Merged post
Looking it at, it seems now it only triggers when a EAC ban is issued?
private static void HandleClientUpdate(ClientStatusUpdate<Client> clientStatus)
{
DateTime? nullable;
using (TimeWarning timeWarning = TimeWarning.New("AntiCheatKickPlayer", 10))
{
Client client = clientStatus.Client;
Connection connection = EACServer.GetConnection(client);
if (connection == null)
{
Debug.LogError(string.Concat("EAC status update for invalid client: ", client.ClientID));
}
else if (!EACServer.ShouldIgnore(connection))
{
if (clientStatus.RequiresKick)
{
string message = clientStatus.Message;
if (string.IsNullOrEmpty(message))
{
message = clientStatus.Status.ToString();
}
Debug.Log(string.Format("[EAC] Kicking {0} / {1} ({2})", connection.userid, connection.username, message));
connection.authStatus = "eac";
Net.sv.Kick(connection, string.Concat("EAC: ", message), false);
Interface.CallHook("OnPlayerKicked", connection, message);
if (clientStatus.IsBanned(out nullable))
{
connection.authStatus = "eacbanned";
object[] objArray = new object[] { 2, 0, string.Concat("<color=#fff>SERVER</color> Kicking ", connection.username, " (banned by anticheat)") };
Interface.CallHook("OnPlayerBanned", connection, message);
ConsoleNetwork.BroadcastToAllClients("chat.add", objArray);
Merged post
Yea its confirmed, it only triggers when a user is EAC banned, manual bans are ignored.
Merged post
**bump**
There are multiple hook locations for that, the EAC locaton is only one of them. The one documented that you were using originally is only for use with the "ban" command.
I only see one of them: https://gyazo.com/a299825bcd1ffe10ac8e1adeb1df8fa9
What am I missing?
Merged post
I know its not a popular hook but it's essential for me, has you or any of the oxide devs tested it? You'll find out it doesn't work.
Yeah - stopped working for me also...
void OnPlayerBanned(string name, ulong id, string address, string reason) {
// do stuff
}
I use it to send a message to Discord when someone is banned, not been working this wipe.
Found the cause. That ulong should have been a long. It'll be available in the next develop build else release when Rust updates again.
Give it about 5-10 minutes, then you can get the build here:
https://ci.appveyor.com/api/projects/oxidemod/oxide-rust/artifacts/Oxide.Rust-develop.zip?branch=develop
https://ci.appveyor.com/api/projects/oxidemod/oxide-rust/artifacts/Oxide.Rust-linux-develop.zip?branch=develop
Thanks Wulf, to be clear this As stated in the API Doc page: void OnPlayerBanned(string name, ulong id, string address, string reason) will work on next update? or does it need different args?
Yes, that would work still.HerroThanks Wulf, to be clear this As stated in the API Doc page: void OnPlayerBanned(string name, ulong id, string address, string reason) will work on next update? or does it need different args?
Aight, thanks again for double looking into it.
Locked automatically