Blµb Posted October 19, 2005 Share Posted October 19, 2005 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 Link to comment Share on other sites More sharing options...
ensiform Posted October 19, 2005 Share Posted October 19, 2005 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 Link to comment Share on other sites More sharing options...
Blµb Posted October 19, 2005 Author Share Posted October 19, 2005 i don't know this mods that's why i've posted it So everyone knows how to do it =) (i like sharing sources/ideas ) Link to comment Share on other sites More sharing options...
ensiform Posted October 19, 2005 Share Posted October 19, 2005 so do i thats why i was offering teh chat tokens code and i started a q3 engine / jka bugfix list a while back. Link to comment Share on other sites More sharing options...
MDN14 Posted October 19, 2005 Share Posted October 19, 2005 it is in xmod too. Link to comment Share on other sites More sharing options...
razorace Posted October 19, 2005 Share Posted October 19, 2005 I seem to recall that using drop command to remove bots seemed to cause memory leaks, at least when I attempted it. Just a word of caution. Link to comment Share on other sites More sharing options...
ensiform Posted October 20, 2005 Share Posted October 20, 2005 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. Link to comment Share on other sites More sharing options...
razorace Posted October 20, 2005 Share Posted October 20, 2005 Does that still give the "___ was kicked" message? Link to comment Share on other sites More sharing options...
ensiform Posted October 20, 2005 Share Posted October 20, 2005 yes, i dont see why you would be getting that because i checked and kick and clientkick both use the dropclient function. Link to comment Share on other sites More sharing options...
razorace Posted October 20, 2005 Share Posted October 20, 2005 //[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) ); Link to comment Share on other sites More sharing options...
razorace Posted October 20, 2005 Share Posted October 20, 2005 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? Link to comment Share on other sites More sharing options...
ensiform Posted October 20, 2005 Share Posted October 20, 2005 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. Link to comment Share on other sites More sharing options...
razorace Posted October 20, 2005 Share Posted October 20, 2005 hmmm, I doubt that the G_GetStringEdString would cause a crash problem. Link to comment Share on other sites More sharing options...
ensiform Posted October 20, 2005 Share Posted October 20, 2005 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. Link to comment Share on other sites More sharing options...
razorace Posted October 20, 2005 Share Posted October 20, 2005 It's been a while but I seem to remember it being an internal engine error crash that seemed to occur randomly after bots were disconnected from the game. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.