General > Developers Corner

Will player variables stick on map change/server shutdown/restart?

<< < (2/2)

Megiddo:
The PData implementation is very light -- https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/includes/extensions/util.lua#L333 . You should only have issues if you were calling it multiple times per second.

I do have to say that I've seen odd behavior from player tables in the past, and try to avoid them now. Not sure if it's other addons mucking the tables up or what, but I've seen data randomly disappear from the player table.

Bytewave:

--- Quote from: Megiddo on May 01, 2017, 01:31:30 PM ---I do have to say that I've seen odd behavior from player tables in the past, and try to avoid them now. Not sure if it's other addons mucking the tables up or what, but I've seen data randomly disappear from the player table.

--- End quote ---
To add on to the odd behavior, there is one annoying quirk of PData: it doesn't store by SteamID64, it stores by UniqueID, which is just a CRC32 hash of gm_STEAMID_gm. Sure, that works, but there's bound to be collisions in there somewhere.

iViscosity:
The addon I'm creating also uses MySQL which I have setup to store SteamID64s, but in-case whoever is using the addon doesn't have a database to store the information, I'm using PData.

Navigation

[0] Message Index

[*] Previous page

Go to full version