AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Client ID problem (https://forums.alliedmods.net/showthread.php?t=317906)

orel56000 08-04-2019 06:17

Client ID problem
 
Hello, I don't know if its a new update or something because I havn't noticed that before but its f***** up all my plugins..

when you write Status in the console its shows players' ID
and lets say someone is id 2, when he disconnects, the server automaticlly changing id 3 to id 2 to sort the list, and when id 2 reconnect to the server, its resorting again and moving him back to id 2 and putting id 3 again to id 3. its doing that so it will be sorted in the status from 1 to current online players

How to change it back to what it was, when id 2 disconnects, it remaining as a hole and when the next player connect he will take id 2?

orel56000 08-04-2019 06:34

Re: Client ID problem
 
Quote:

Originally Posted by thEsp (Post 2661815)
You can't change player index, I guess it's sorted based on name (or something similar). Therefore, I guess you are having problem with bool array, in which case you should reset them (change to default, based on the array, true or false) when a player disconnects.

im not trying to change the player index, it is changes automaticlly when a player disconnects, that what I'm trying to fix

here, look at this:
Code:

# 1 "Player 1" 2 STEAM_0:0:xxxxxxx  0  1:12:45  13    0
# 2 "Player 2" 40 STEAM_0:0:xxxxxxxxx  0 00:52  20    0
# 3 "Player 3" 5 STEAM_0:1:xxxxxxxxx  0  1:08:45  27    0
# 4 "Player 4" 6 STEAM_0:0:xxxxxxxxx      9  1:08:11  24    0
# 5  "Player 5" 7 STEAM_0:1:xxxxxxxxx    -2  1:07:35  18    0
# 6 "Player 6" 39 STEAM_0:0:xxxxxxxxx      0 08:57  19    0
# 7 "Player 7" 16 STEAM_0:0:xxxxxxxxx      0 50:03  34    0
# 8 "Player 8" 31 STEAM_0:0:xxxxxxxxx    -1 20:54  28    0
# 9 "Player 9" 34 STEAM_0:1:xxxxxxxxx    -1 15:58  25    0
#10 "Player 10" 27 STEAM_0:1:xxxxxxxxx      9 34:27  29    0
#11 "Player 11" 35 STEAM_0:1:xxxxxxxxx      0 14:48  26    0

now if "Player 2 disconnects, and you write Status again, it is becoming to this for some reason:

Code:

# 1 "Player 1" 2 STEAM_0:0:xxxxxxx  0  1:12:45  13    0
# 2 "Player 3" 5 STEAM_0:1:xxxxxxxxx  0  1:08:45  27    0
# 3 "Player 4" 6 STEAM_0:0:xxxxxxxxx      9  1:08:11  24    0
# 4  "Player 5" 7 STEAM_0:1:xxxxxxxxx    -2  1:07:35  18    0
# 5 "Player 6" 39 STEAM_0:0:xxxxxxxxx      0 08:57  19    0
# 6 "Player 7" 16 STEAM_0:0:xxxxxxxxx      0 50:03  34    0
# 7 "Player 8" 31 STEAM_0:0:xxxxxxxxx    -1 20:54  28    0
# 8 "Player 9" 34 STEAM_0:1:xxxxxxxxx    -1 15:58  25    0
# 9 "Player 10" 27 STEAM_0:1:xxxxxxxxx      9 34:27  29    0
# 10 "Player 11" 35 STEAM_0:1:xxxxxxxxx      0 14:48  26    0

and when "Player 2" comes back to the server, its changes again to this somehow:

Code:

# 1 "Player 1" 2 STEAM_0:0:xxxxxxx  0  1:12:45  13    0
# 2 "Player 2" 40 STEAM_0:0:xxxxxxxxx  0 00:52  20    0
# 3 "Player 3" 5 STEAM_0:1:xxxxxxxxx  0  1:08:45  27    0
# 4 "Player 4" 6 STEAM_0:0:xxxxxxxxx      9  1:08:11  24    0
# 5  "Player 5" 7 STEAM_0:1:xxxxxxxxx    -2  1:07:35  18    0
# 6 "Player 6" 39 STEAM_0:0:xxxxxxxxx      0 08:57  19    0
# 7 "Player 7" 16 STEAM_0:0:xxxxxxxxx      0 50:03  34    0
# 8 "Player 8" 31 STEAM_0:0:xxxxxxxxx    -1 20:54  28    0
# 9 "Player 9" 34 STEAM_0:1:xxxxxxxxx    -1 15:58  25    0
#10 "Player 10" 27 STEAM_0:1:xxxxxxxxx      9 34:27  29    0
#11 "Player 11" 35 STEAM_0:1:xxxxxxxxx      0 14:48  26    0


OciXCrom 08-04-2019 07:09

Re: Client ID problem
 
You can't change the client id, nor modify the "status" command.

orel56000 08-04-2019 07:30

Re: Client ID problem
 
Quote:

Originally Posted by OciXCrom (Post 2661823)
You can't change the client id, nor modify the "status" command.


im not trying to change, im asking if it is a bug or something new, and how I should deal with that? because I save things like cash on players' id and when they disconnected its saving into a file, so if someone with id 3 becoming id 2 and id 4 becoming id 3, it will give the the 3rd player cash to the 4th player, because his id is now 3

Mordekay 08-04-2019 08:39

Re: Client ID problem
 
1. the output above does not show any "id-changing". The id should not be given a second time.
2 use STEAM_ID instead of ID to store whatever you want to store, this is unique and therefore no one can get the others data/saved stats/whatever

Fuck For Fun 08-04-2019 08:41

Re: Client ID problem
 
Quote:

The problem is in a file we use to change client ID so NON-STEAM is not supported

orel56000 08-04-2019 09:07

Re: Client ID problem
 
@Fuck For Fun what the hell are you talking about

Quote:

Originally Posted by Mordekay (Post 2661832)
1. the output above does not show any "id-changing". The id should not be given a second time.
2 use STEAM_ID instead of ID to store whatever you want to store, this is unique and therefore no one can get the others data/saved stats/whatever

thanks

Natsheh 08-05-2019 00:39

Re: Client ID problem
 
This is not a bug that's the normal behaviour.

The list of numbers after # are not ids they are either listing numbers or you can also call them slots.

fysiks 08-05-2019 22:48

Re: Client ID problem
 
No, it is not normal behavior. The first column is indeed the entity number (sometimes referred to as "slot"; the same entity number used in plugins for most user-specific functions) and will not change for a player that hasn't left the server regardless of if people with a lower id leave.

When "Player 2" leaves, every player above slot/id 2 will remain with the same slot/id that they had before "Player 2" left. I.e. it is common to see skipped numbers in that first column when people leave. The next person to join will get the lowest available slot. So, if "Player 2" leaves and comes back before someone else joins, he will get slot 2 again. If "Player 2" leaves and "Player 12" joins then "Player 12" will get slot 2.

If this is indeed happening like you say then you likely have a corrupt/illegitimate version of the server. Make sure that you download your server via SteamCMD only and don't add anything that tries to bypass Steam authentication.

The only exception that I can think of is if Valve changed it for Counter-Strike only because I verified with Day of Defeat but that is extremely unlikely since they are both based on the Half-Life engine.

Mistrick 08-06-2019 01:11

Re: Client ID problem
 
Quote:

Originally Posted by fysiks (Post 2662123)
No, it is not normal behavior. The first column is indeed the entity number (sometimes referred to as "slot"; the same entity number used in plugins for most user-specific functions) and will not change for a player that hasn't left the server regardless of if people with a lower id leave.

Look at code. It is just counter.
https://github.com/dreamstalker/rehl...t_cmd.cpp#L624


All times are GMT -4. The time now is 17:28.

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