Jump to content

Home

Kick-reasons


Blµb

Recommended Posts

Posted

I've used the search for "kick reason" and haven't found this here, so thought about posting it :)

Something which came to my mind was to make the kick command add a reason to the kick, i thought about how to do this - because i always used trap_SendConsoleCommand(EXEC_INSERT, va("clientkick \"%i\"", cNum)); - and when i remembered that there's g_inactivity in the lib code not in the source code, i looked at it and found this:

void trap_DropClient( int clientNum, const char *reason );

so you can make things like /kick Blah "Stupid name :P"

result in trap_DropClient(5, "Stupid name :P"); =)

also haven't found kickreasons in other mods yet :)

Another reason to post it :D

Posted

trap_DropClient( cnum, "reason here");

 

only thing is u'd have to make your own command not named clientkick / kick, as they are in the engine <_<

 

its in red slushie / ensimod

Posted

use clientkick # instead, it doesnt seem to mem leak for me.

 

edit: although i just noticed that SV_DropClient( cl, "was kicked" ); is called in that command on the server which is basically trap_DropClient but in the engine without the syscall.

Posted
	//[test]
	//hmmm, this method seems to be breaking stuff.  doublechecking.
	//bots that left disconnect instead of being kicked.  I think it's scaring
	//players
	//trap_DropClient( cl->ps.clientNum, va(S_COLOR_WHITE "%s\n", G_GetStringEdString("MP_SVGAME", "DISCONNECTED")) );
	//[/test]
	trap_SendConsoleCommand( EXEC_INSERT, va("kick \"%s\"\n", netname) );

Posted

the trap_DropClient method seems to cause a memory leak with bots. I'm not sure why. The defualt method seems to work, but it involves the kick message. Maybe there's something in the kickclient function for the bots specifically. What's the function name for that?

Posted

most likely cause your using

G_GetStringEdString("MP_SVGAME", "DISCONNECTED")

 

if u just typed something normal it would work fine.

 

i never suggested use the trap in the first place the bugfix list says clientkick.

Posted

i dunno...

 

u got the text from the crash (debug info?) or is it an error showing up in the jka console window after the game has crashed?

 

if not well just use:

 

trap_SendConsoleCommand( EXEC_INSERT, va("clientkick \"%d\"\n", cl->ps.clientNum));

 

like stated in the bugs thread, and remove the netname char and remove the cleanstr definition from that function.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...