Raised This Month: $32 Target: $400
 8% 

[DEBATING LOL] userid...?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JocAnis
Veteran Member
Join Date: Jun 2010
Old 10-17-2018 , 07:55   [DEBATING LOL] userid...?
Reply With Quote #1

yo guys...a question about userid: how is it generated ? i would like to know exactly in which cases, can it be repeated ever...
i thought when player connects he got his permanent userid and thats it...but when i go retry it changes (usually with +1)

thanks in advance!
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 10-17-2018 , 08:06   Re: userid...?
Reply With Quote #2

Probably something like this lastid+1;
It is set on player connect (or something along those lines).
__________________

Last edited by Airkish; 10-17-2018 at 09:01.
Airkish is offline
Kushfield
Member
Join Date: Jan 2017
Location: Estonia
Old 10-17-2018 , 08:14   Re: userid...?
Reply With Quote #3

You can think of UserID more as a connection ID - it is increased by one on every new connection to the server, meaning that a player will keep the same UserID only from connecting to the server to disconnecting from the server. When the server restarts, the IDs start counting from one again.
Kushfield is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 10-17-2018 , 08:42   Re: userid...?
Reply With Quote #4

thaaaanks
Quote:
Originally Posted by Kushfield View Post
When the server restarts, the IDs start counting from one again.
good explanation kushfield, this espeacially...but what about: playing 17/32 players...one of player's userid is 9609, from another is: 9431...huge difference, how possible?
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 10-17-2018 at 08:42.
JocAnis is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-17-2018 , 08:43   Re: userid...?
Reply With Quote #5

The one with the much lower userid has been on the server for a longer time. 178 connections is not a large number, a popular server probably goes through so many in less than an hour.
__________________
klippy is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 10-17-2018 , 08:48   Re: userid...?
Reply With Quote #6

so it means, its (max_userid+1) on client_disconnect ? cuz when map changes his ID stays the same
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 10-17-2018 at 08:48.
JocAnis is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-17-2018 , 08:52   Re: userid...?
Reply With Quote #7

It's just a number that increments by 1 on every new connection thus keeping it unique for every client, that's it, don't overthink it.
__________________
klippy is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 10-17-2018 , 09:03   Re: userid...?
Reply With Quote #8

i started to think to implement somehwere that get_user_userid...but its like only made for kick xD
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-17-2018 , 10:05   Re: userid...?
Reply With Quote #9

It's useful (and the proper way) for keeping track of a client across any asynchronous operations, like tasks, frame requests, database queries, http requests and such.
__________________

Last edited by klippy; 10-17-2018 at 10:09.
klippy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-17-2018 , 14:42   Re: userid...?
Reply With Quote #10

The userid should be saved for each steamid.

Max userids = Max clients which have connected to the server.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 10-17-2018 at 14:45.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 16:39.


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