Raised This Month: $51 Target: $400
 12% 

get_user_time is not supported in client_disconnected?


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-26-2017 , 08:42   Re: get_user_time is not supported in client_disconnected?
Reply With Quote #11

There's no "client_disconnected" forward in 1.8.1. This topic is about 1.8.3, and you're testing it on 1.8.1 with a totally different function. Why would you use such an old version?
__________________

Last edited by OciXCrom; 04-26-2017 at 08:43.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-26-2017 , 09:02   Re: get_user_time is not supported in client_disconnected?
Reply With Quote #12

@Ocix
Quote:
Originally Posted by Craxor View Post
1.8.1
This num nut nugget is not the OP

Probably client_disconnected is the post version of client_disconnect
So this means it is called after all the data related to that index is already cleared, thus the total connection time of that index is 0

You should use client_disconnect instead of client_disconnected
__________________

Last edited by Depresie; 04-26-2017 at 09:03.
Depresie is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-26-2017 , 09:26   Re: get_user_time is not supported in client_disconnected?
Reply With Quote #13

client_disconnected is the new version of client_disconnect. You should always use it in 1.8.3, since the old one is marked as deprecated and you will get a compiler warning if you try to use it.
__________________

Last edited by OciXCrom; 04-26-2017 at 09:26.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-26-2017 , 14:13   Re: get_user_time is not supported in client_disconnected?
Reply With Quote #14

What's the difference actually ? also what does this do ? client_connectex ? sorry for off topic
__________________
Depresie is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-26-2017 , 14:19   Re: get_user_time is not supported in client_disconnected?
Reply With Quote #15

client_disconnected sometimes fails to catch the player disconnecting, so client_disconnected is a fixed version of that. See the .inc file:

PHP Code:
/**
 * @deprecated This function does not catch all cases.
 */
#pragma deprecated Use client_disconnected() instead.
forward client_disconnect(id);

/**
 * Called when a client is disconnected from the server.
 *
 * @note This will be called in some additional cases that client_disconnect doesn't cover, 
 *       most notably when a client aborts the connection process. It is guaranteed to pair 
 *       with the client_connect() forward.
 * @note By this point it is already too late to do anything that directly
 *       affects the client.
 *
 * @param id         Client index
 * @param drop       If true, client has been explicitly dropped by game
 * @param message    If drop is true, a disconnected message or buffer to copy a new message to
 * @param maxlen     Maximum size of buffer
 *
 * @noreturn
 */
forward client_disconnected(idbool:dropmessage[], maxlen); 
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 04-26-2017 , 15:53   Re: get_user_time is not supported in client_disconnected?
Reply With Quote #16

Quote:
Originally Posted by OciXCrom View Post
client_disconnected sometimes fails to catch the player disconnecting, so client_disconnected is a fixed version of that. See the .inc file:

PHP Code:
/**
 * @deprecated This function does not catch all cases.
 */
#pragma deprecated Use client_disconnected() instead.
forward client_disconnect(id);

/**
 * Called when a client is disconnected from the server.
 *
 * @note This will be called in some additional cases that client_disconnect doesn't cover, 
 *       most notably when a client aborts the connection process. It is guaranteed to pair 
 *       with the client_connect() forward.
 * @note By this point it is already too late to do anything that directly
 *       affects the client.
 *
 * @param id         Client index
 * @param drop       If true, client has been explicitly dropped by game
 * @param message    If drop is true, a disconnected message or buffer to copy a new message to
 * @param maxlen     Maximum size of buffer
 *
 * @noreturn
 */
forward client_disconnected(idbool:dropmessage[], maxlen); 
Not true, specially if you read the documentation.


* @note By this point it is already too late to do anything that directly
* affects the client.


And get_user_time i guess that is not returning a correct value in specific cases. Like timeout or something related to conection.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 04-26-2017 , 15:57   Re: get_user_time is not supported in client_disconnected?
Reply With Quote #17

Quote:
Originally Posted by ^SmileY View Post
And get_user_time i guess that is not returning a correct value in specific cases. Like timeout or something related to conection.
Timeout is not too specific. But reconnect on changelevel or disconnect while connecting can be specific.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-26-2017 , 16:57   Re: get_user_time is not supported in client_disconnected?
Reply With Quote #18

Quote:
Originally Posted by ^SmileY View Post
Not true, specially if you read the documentation.


* @note By this point it is already too late to do anything that directly
* affects the client.


And get_user_time i guess that is not returning a correct value in specific cases. Like timeout or something related to conection.
What's not true? I just said that disconnected is a fixed version of disconnect.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 04-26-2017 , 17:13   Re: get_user_time is not supported in client_disconnected?
Reply With Quote #19

The OP tested with 1.8.3 using client_disconnected() and has the same result as mine so i don't see anything fixed yet.

Btw , i'm using old versions because 1.8.3 is still not an official release.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
PartialCloning
Senior Member
Join Date: Dec 2015
Old 04-26-2017 , 18:32   Re: get_user_time is not supported in client_disconnected?
Reply With Quote #20

It works on 1.8.3.
PartialCloning 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 01:54.


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