lfnetwork.com mark read register faq members calendar

Thread: Kick-reasons
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 10-19-2005, 10:05 AM   #1
BlÁb
Rookie
 
Join Date: Oct 2005
Posts: 23
Kick-reasons

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



Destiny is just another word for not having a choice!
Face The Truth!
// 132
BlÁb is offline   you may: quote & reply,
Old 10-19-2005, 11:40 AM   #2
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Code:
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


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 10-19-2005, 11:59 AM   #3
BlÁb
Rookie
 
Join Date: Oct 2005
Posts: 23
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 :P)



Destiny is just another word for not having a choice!
Face The Truth!
// 132
BlÁb is offline   you may: quote & reply,
Old 10-19-2005, 12:00 PM   #4
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
so do i thats why i was offering teh chat tokens code and i started a q3 engine / jka bugfix list a while back.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 10-19-2005, 02:08 PM   #5
MDN14
Rookie
 
Join Date: Sep 2003
Posts: 159
it is in xmod too.
MDN14 is offline   you may: quote & reply,
Old 10-19-2005, 06:10 PM   #6
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
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.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 10-19-2005, 08:49 PM   #7
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
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.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 10-19-2005, 11:52 PM   #8
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
Does that still give the "___ was kicked" message?


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 10-20-2005, 12:21 AM   #9
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
yes, i dont see why you would be getting that because i checked and kick and clientkick both use the dropclient function.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 10-20-2005, 12:32 AM   #10
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
Code:
		//[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) );


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 10-20-2005, 12:34 AM   #11
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
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?


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 10-20-2005, 01:25 AM   #12
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
most likely cause your using
Code:
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.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 10-20-2005, 01:21 PM   #13
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
hmmm, I doubt that the G_GetStringEdString would cause a crash problem.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 10-20-2005, 05:42 PM   #14
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
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:

Code:
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.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 10-20-2005, 06:16 PM   #15
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
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.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > Kick-reasons

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:31 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.