Discussion:
[hlcoders] storing information about players in a plugin
Tom Schumann
2016-09-06 11:47:40 UTC
Permalink
What's the best way of storing information against each player from in a
plugin? I'd like to store a ready state for each player but I'm not sure
how to uniquely index each player - Steam ID would probably be ideal but I
don't think this would work in LAN or for bots.
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
Ben Lubar
2016-09-06 18:22:53 UTC
Permalink
1..32 is players because 0 is the static part of the map.
Does it need to survive map changes and server restarts?
If not, why go with the global ID instead of the userid?
If you can only use arrays, you could use the player index (That's
0..32, 1..32 or something like that).
But that thing gets re-used, so you can have a bit of a cleanup problem
if you don't clean it up on all kinds of (dis)connects.
Post by Tom Schumann
What's the best way of storing information against each player from in a
plugin? I'd like to store a ready state for each player but I'm not sure
how to uniquely index each player - Steam ID would probably be ideal but
I
Post by Tom Schumann
don't think this would work in LAN or for bots.
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
https://list.valvesoftware.co
Tom Schumann
2016-09-08 08:50:58 UTC
Permalink
It doesn't need to survive map changes or server restarts, just for the
duration of the round.
I considered the player index but thought that disconnects would be an
issue.

Where can I get the global ID?
Post by Ben Lubar
1..32 is players because 0 is the static part of the map.
Does it need to survive map changes and server restarts?
If not, why go with the global ID instead of the userid?
If you can only use arrays, you could use the player index (That's
0..32, 1..32 or something like that).
But that thing gets re-used, so you can have a bit of a cleanup problem
if you don't clean it up on all kinds of (dis)connects.
Post by Tom Schumann
What's the best way of storing information against each player from in
a
Post by Tom Schumann
plugin? I'd like to store a ready state for each player but I'm not
sure
Post by Tom Schumann
how to uniquely index each player - Steam ID would probably be ideal
but
I
Post by Tom Schumann
don't think this would work in LAN or for bots.
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
https://list.valvesoftware.com/cgi-bin/mailma
Björn Stabel
2016-09-12 18:15:06 UTC
Permalink
global id? you mean user id, right?

That would be CBasePlayer::GetUserId():
https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/game/server/player.h#L374

The others are somewhere nearby, too
Post by Tom Schumann
It doesn't need to survive map changes or server restarts, just for the
duration of the round.
I considered the player index but thought that disconnects would be an
issue.
Where can I get the global ID?
Post by Ben Lubar
1..32 is players because 0 is the static part of the map.
Does it need to survive map changes and server restarts?
If not, why go with the global ID instead of the userid?
If you can only use arrays, you could use the player index (That's
0..32, 1..32 or something like that).
But that thing gets re-used, so you can have a bit of a cleanup problem
if you don't clean it up on all kinds of (dis)connects.
Post by Tom Schumann
What's the best way of storing information against each player from in
a
Post by Tom Schumann
plugin? I'd like to store a ready state for each player but I'm not
sure
Post by Tom Schumann
how to uniquely index each player - Steam ID would probably be ideal
but
I
Post by Tom Schumann
don't think this would work in LAN or for bots.
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
https://list.valvesoft
Tom Schumann
2016-09-13 09:13:07 UTC
Permalink
Something like that yeah - thanks, I'll see how I go with that.
Post by Björn Stabel
global id? you mean user id, right?
https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/game/
server/player.h#L374
The others are somewhere nearby, too
Post by Tom Schumann
It doesn't need to survive map changes or server restarts, just for the
duration of the round.
I considered the player index but thought that disconnects would be an
issue.
Where can I get the global ID?
Post by Ben Lubar
1..32 is players because 0 is the static part of the map.
Does it need to survive map changes and server restarts?
If not, why go with the global ID instead of the userid?
If you can only use arrays, you could use the player index (That's
0..32, 1..32 or something like that).
But that thing gets re-used, so you can have a bit of a cleanup problem
if you don't clean it up on all kinds of (dis)connects.
Post by Tom Schumann
What's the best way of storing information against each player from in
a
Post by Tom Schumann
plugin? I'd like to store a ready state for each player but I'm not
sure
Post by Tom Schumann
how to uniquely index each player - Steam ID would probably be ideal
but
I
Post by Tom Schumann
don't think this would work in LAN or for bots.
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcod

Loading...