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

[CSGO] Question about client serial number


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CDboy
Junior Member
Join Date: Aug 2020
Location: China
Old 08-24-2020 , 11:50   [CSGO] Question about client serial number
Reply With Quote #1

Is client index always continuous? For example, if there is 15 clients in the server, can the game guarantee that the client index is always from 1 to 15?

Last edited by CDboy; 08-24-2020 at 12:26.
CDboy is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-24-2020 , 15:49   Re: [CSGO] Question about client serial number
Reply With Quote #2

Client indexs are like server maxplayers slots, (array[] size of maxplayers.)
Client index 0 is server (or error in some cases).

Players connect to client index 1 to MaxClients.
But you need check first, make sure player is valid, is player connected into that client index (IsClientConnected(client) or IsClientInGame(client) or is it empty).

After MaxClients index, will began entity indexs to 2048 if I remember right.

Server fill slots, starting from smallest index, if there are free.
Player keep same index between map change and reconnect.
But once player disconnect and connect back to server, player could have taken another client index.


userid is handy serial number for players.
userid is like ticket number, number increase by one every time when player connect to server.
Player is keeping same userid number as long as he/she not disconnect from server.
You can look from command status or users.
- users "slot" however, start from index 0, ignore that -1 offset

Code:
status
hostname: Counter-Strike: Global Offensive
version : 1.37.6.4/13764 1176/7929 secure  [A:1:4132805633:15417]
udp/ip  : 192.168.1.21:27016  (public ip: )
os      :  Windows
type    :  community dedicated
players : 1 humans, 16 bots (32/0 max) (not hibernating)

# userid name uniqueid connected ping loss state rate adr
#  2 1 "Bacardi" STEAM_1:1:14163588 01:07 25 0 active 786432 192.168.1.21:27005
# 3 "Josh" BOT active 64
# 4 "Tom" BOT active 64
# 5 "Brandon" BOT active 64
# 6 "Irving" BOT active 64
# 7 "Greg" BOT active 64
# 8 "Mike" BOT active 64
# 9 "Gary" BOT active 64
#10 "Orin" BOT active 64
#11 "Harold" BOT active 64
#12 "Henry" BOT active 64
#13 "Scott" BOT active 64
#14 "Will" BOT active 64
#15 "Wyatt" BOT active 64
#16 "Alfred" BOT active 64
#17 "Bill" BOT active 64
#18 "Steve" BOT active 64
#end
users
<slot:userid:"name">
0:2:"Bacardi"
1:3:"Josh"
2:4:"Tom"
3:5:"Brandon"
4:6:"Irving"
5:7:"Greg"
6:8:"Mike"
7:9:"Gary"
8:10:"Orin"
9:11:"Harold"
10:12:"Henry"
11:13:"Scott"
12:14:"Will"
13:15:"Wyatt"
14:16:"Alfred"
15:17:"Bill"
16:18:"Steve"
17 users
Code:
status
hostname: Counter-Strike: Global Offensive
version : 1.37.6.4/13764 1176/7929 secure  [A:1:4132805633:15417]
udp/ip  : 192.168.1.21:27016  (public ip:)
os      :  Windows
type    :  community dedicated
players : 1 humans, 17 bots (32/0 max) (not hibernating)

# userid name uniqueid connected ping loss state rate adr
#30 "Josh" BOT active 64
#31 "Doug" BOT active 64
#33 "Gary" BOT active 64
#35 "Martin" BOT active 64
#36 "Nate" BOT active 64
#37 "Mike" BOT active 64
#38 "Perry" BOT active 64
#40 "Yahn" BOT active 64
#42 "Grant" BOT active 64
#43 "Henry" BOT active 64
#44 "Jon" BOT active 64
#45 "Jason" BOT active 64
#46 "Keith" BOT active 64
#47 "Scott" BOT active 64
#48 "Ethan" BOT active 64
#49 "Matt" BOT active 64
#50 "Jerry" BOT active 64
# 51 22 "Bacardi" STEAM_1:1:14163588 04:35 18 0 active 786432 192.168.1.21:27005
#end
users
<slot:userid:"name">
0:30:"Josh"
1:31:"Doug"
3:33:"Gary"
5:35:"Martin"
6:36:"Nate"
7:37:"Mike"
8:38:"Perry"
10:40:"Yahn"
12:42:"Grant"
13:43:"Henry"
14:44:"Jon"
15:45:"Jason"
16:46:"Keith"
17:47:"Scott"
18:48:"Ethan"
19:49:"Matt"
20:50:"Jerry"
21:51:"Bacardi"
18 users
__________________
Do not Private Message @me
Bacardi is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-24-2020 , 16:33   Re: [CSGO] Question about client serial number
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
Client indexs are like server maxplayers slots, (array[] size of maxplayers.)
Client index 0 is server (or error in some cases).

Players connect to client index 1 to MaxClients.
But you need check first, make sure player is valid, is player connected into that client index (IsClientConnected(client) or IsClientInGame(client) or is it empty).

After MaxClients index, will began entity indexs to 2048 if I remember right.

Server fill slots, starting from smallest index, if there are free.
Player keep same index between map change and reconnect.
But once player disconnect and connect back to server, player could have taken another client index.


userid is handy serial number for players.
userid is like ticket number, number increase by one every time when player connect to server.
Player is keeping same userid number as long as he/she not disconnect from server.
You can look from command status or users.
- users "slot" however, start from index 0, ignore that -1 offset

Code:
status
hostname: Counter-Strike: Global Offensive
version : 1.37.6.4/13764 1176/7929 secure  [A:1:4132805633:15417]
udp/ip  : 192.168.1.21:27016  (public ip: )
os      :  Windows
type    :  community dedicated
players : 1 humans, 16 bots (32/0 max) (not hibernating)

# userid name uniqueid connected ping loss state rate adr
#  2 1 "Bacardi" STEAM_1:1:14163588 01:07 25 0 active 786432 192.168.1.21:27005
# 3 "Josh" BOT active 64
# 4 "Tom" BOT active 64
# 5 "Brandon" BOT active 64
# 6 "Irving" BOT active 64
# 7 "Greg" BOT active 64
# 8 "Mike" BOT active 64
# 9 "Gary" BOT active 64
#10 "Orin" BOT active 64
#11 "Harold" BOT active 64
#12 "Henry" BOT active 64
#13 "Scott" BOT active 64
#14 "Will" BOT active 64
#15 "Wyatt" BOT active 64
#16 "Alfred" BOT active 64
#17 "Bill" BOT active 64
#18 "Steve" BOT active 64
#end
users
<slot:userid:"name">
0:2:"Bacardi"
1:3:"Josh"
2:4:"Tom"
3:5:"Brandon"
4:6:"Irving"
5:7:"Greg"
6:8:"Mike"
7:9:"Gary"
8:10:"Orin"
9:11:"Harold"
10:12:"Henry"
11:13:"Scott"
12:14:"Will"
13:15:"Wyatt"
14:16:"Alfred"
15:17:"Bill"
16:18:"Steve"
17 users
Code:
status
hostname: Counter-Strike: Global Offensive
version : 1.37.6.4/13764 1176/7929 secure  [A:1:4132805633:15417]
udp/ip  : 192.168.1.21:27016  (public ip:)
os      :  Windows
type    :  community dedicated
players : 1 humans, 17 bots (32/0 max) (not hibernating)

# userid name uniqueid connected ping loss state rate adr
#30 "Josh" BOT active 64
#31 "Doug" BOT active 64
#33 "Gary" BOT active 64
#35 "Martin" BOT active 64
#36 "Nate" BOT active 64
#37 "Mike" BOT active 64
#38 "Perry" BOT active 64
#40 "Yahn" BOT active 64
#42 "Grant" BOT active 64
#43 "Henry" BOT active 64
#44 "Jon" BOT active 64
#45 "Jason" BOT active 64
#46 "Keith" BOT active 64
#47 "Scott" BOT active 64
#48 "Ethan" BOT active 64
#49 "Matt" BOT active 64
#50 "Jerry" BOT active 64
# 51 22 "Bacardi" STEAM_1:1:14163588 04:35 18 0 active 786432 192.168.1.21:27005
#end
users
<slot:userid:"name">
0:30:"Josh"
1:31:"Doug"
3:33:"Gary"
5:35:"Martin"
6:36:"Nate"
7:37:"Mike"
8:38:"Perry"
10:40:"Yahn"
12:42:"Grant"
13:43:"Henry"
14:44:"Jon"
15:45:"Jason"
16:46:"Keith"
17:47:"Scott"
18:48:"Ethan"
19:49:"Matt"
20:50:"Jerry"
21:51:"Bacardi"
18 users
IDK what slots are but they aren't client index. Those don't start from 0
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
CDboy
Junior Member
Join Date: Aug 2020
Location: China
Old 08-25-2020 , 00:44   Re: [CSGO] Question about client serial number
Reply With Quote #4

Thanks a lot, I understand this now.
CDboy 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 00:40.


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