SuperiorServers / dash

Collection of libraries, utilities, and core Garry's Mod changes intended to improve development of addons and gamemodes
Other
70 stars 20 forks source link

Fix some Redis errors #5

Closed AMD-NICK closed 7 years ago

AMD-NICK commented 7 years ago

I would like to start using Redis, but I don't know where to start. May you please show me how to use it, as an alternative to this script (https://github.com/SuperiorServers/NoMultirun/blob/master/lua/autorun/server/no_multirun.lua) as an example?

aStonedPenguin commented 7 years ago

you'd do something like db:Set('session_' .. pl:SteamID64(), os.time()) ect ect instead of a query. It's pretty stupid simple. Read up on redis and you should get it pretty fast.

KingofBeast commented 7 years ago

Broadcasting may be better than variables for NoMR. Broadcast their SteamID on CheckPassword and all connected servers should attempt to kick that SteamID. It takes maintaining session time and keeping track of active players out of the equation.

aStonedPenguin commented 7 years ago

You can't do that @KingofBeast since they have no player object between CheckPassword and PlayerAuthed, and game.KickID() spews error when no steamid is found. You'd really be better off just setting an expiring key and using the existing implementations design.

KingofBeast commented 7 years ago

Hack the world #yolo @aStonedPenguin

AMD-NICK commented 7 years ago

@aStonedPenguin I am working with Redis for the first time, so I don't know how to create a DB, this is done via gmod or how?

UPD. Figured it out