Raised This Month: $ Target: $400
 0% 

Does OnClientDisconnect run on mapchange?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
noodleboy347
AlliedModders Donor
Join Date: Mar 2009
Old 02-07-2011 , 23:36   Does OnClientDisconnect run on mapchange?
Reply With Quote #1

I have some stuff run on OnClientDisconnect and I was wondering if this ran for everyone on the server during a map change.
noodleboy347 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-07-2011 , 23:42   Re: Does OnClientDisconnect run on mapchange?
Reply With Quote #2

Yes it does, and Connect fires afterwards.
__________________
asherkin is offline
psychonic

BAFFLED
Join Date: May 2008
Old 02-08-2011 , 07:54   Re: Does OnClientDisconnect run on mapchange?
Reply With Quote #3

To elaborate further,

Clients, at map change, are told by the server to reconnect. They then do the equivalent of "connect <server address>", causing a disconnect and attempting to reconnect to the server. The server remembers the userids and connection time of the players it told to reconnect and matches them up for the clients that do.

If you do want to track a client disconnecting on their own (manually or from timeout, kick, etc.), the player_disconnect event is what you're looking for.

Last edited by psychonic; 02-08-2011 at 08:43.
psychonic is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 02-08-2011 , 08:32   Re: Does OnClientDisconnect run on mapchange?
Reply With Quote #4

player_disconnect
__________________
FaTony is offline
psychonic

BAFFLED
Join Date: May 2008
Old 02-08-2011 , 08:43   Re: Does OnClientDisconnect run on mapchange?
Reply With Quote #5

Quote:
Originally Posted by FaTony View Post
Yes, minor typo. Fixed.
psychonic is offline
honorcode23
BANNED
Join Date: Mar 2010
Location: Chile
Old 02-08-2011 , 09:17   Re: Does OnClientDisconnect run on mapchange?
Reply With Quote #6

May i ask something? Apart of the userid being saved, is the client index saved too for each player?
honorcode23 is offline
psychonic

BAFFLED
Join Date: May 2008
Old 02-08-2011 , 09:29   Re: Does OnClientDisconnect run on mapchange?
Reply With Quote #7

Quote:
Originally Posted by honorcode23 View Post
May i ask something? Apart of the userid being saved, is the client index saved too for each player?
Doubtful.
psychonic is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 02-08-2011 , 14:17   Re: Does OnClientDisconnect run on mapchange?
Reply With Quote #8

I'll try testing if client# are saved in a few minutes.

EDIT: I tested on TF2, and it appears it doesn't save them.
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.

Last edited by Monkeys; 02-08-2011 at 14:47.
Monkeys is offline
honorcode23
BANNED
Join Date: Mar 2010
Location: Chile
Old 02-08-2011 , 19:34   Re: Does OnClientDisconnect run on mapchange?
Reply With Quote #9

Ya seems like the indexes are assigned by connect order.
honorcode23 is offline
Reply



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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode