sourcemod icon indicating copy to clipboard operation
sourcemod copied to clipboard

Add OnKickClient() forward

Open GabenManPowered opened this issue 3 years ago • 10 comments

This forward allow kick to be detected (ie catch kick reason) or block kicking process.

GabenManPowered avatar Apr 18 '22 17:04 GabenManPowered

I think it is possible to hook the common PerformKick() (kick and kicked commands) (from engine/host_cmd.cpp) to call not only from the SourceMod abstraction trigger

Wend4r avatar Apr 18 '22 17:04 Wend4r

Or even more common, can use CBaseClient::Disconnect() with a reason

Wend4r avatar Apr 18 '22 17:04 Wend4r

I think it is possible to hook the common PerformKick() (kick and kicked commands) (from engine/host_cmd.cpp) to call not only from the SourceMod abstraction trigger

@Wend4r I have used the same design as BanClient (ie banid with forwards OnBanClient, OnBanIdentity, OnRemoveBan)

Or even more common, can use CBaseClient::Disconnect() with a reason

@Wend4r For CBaseClient::Disconnect(), we dont want to have the disconnect reason! Here we want to detect a kick and if needed catch the reason when a player/bot/tv etc is kicked

Regards

GabenManPowered avatar Apr 18 '22 18:04 GabenManPowered

For CBaseClient::Disconnect(), we dont want to have the disconnect reason! Here we want to detect a kick and if needed catch the reason when a player/bot/tv etc is kicked

@GabenManPowered In this regard, I suggest adding an reason argument to OnClientDisconnect()/OnClientDisconnected() by CBaseClient::Disconnect()

Wend4r avatar Apr 18 '22 18:04 Wend4r

From the kick follows disconnecting with the kick reason

Wend4r avatar Apr 18 '22 18:04 Wend4r

I think its fine for the moment to used the same design as BanClient.

GabenManPowered avatar Apr 18 '22 18:04 GabenManPowered

I apologize for the delay on this.

Functionally this looks ok, but what's the use-case? In what situation would you need to deny a kick? We have immunity rules that should take care of this so I'm coming to this from a place of ignorance.

KyleSanderson avatar Oct 07 '22 02:10 KyleSanderson

I dont have a reason to block a kick, but it would be wonderful to have at least a fwd for when it gets called instead of rolling my own impl

sapphonie avatar Feb 13 '23 01:02 sapphonie

I'm also against the idea to block kicks on the fly, as stated by Kyle the permission system more than cover this aspect. If one truly wants control over the game kick system, then they should do what one would when it comes to anything game related, and dhook the engine kick function.

But I agree with sappho, having a notification forwards for kicks could have its benefits, but I can't think of any right now.

Kenzzer avatar Feb 14 '23 10:02 Kenzzer

Can you make this a Post notification for now?

KyleSanderson avatar Mar 30 '23 04:03 KyleSanderson