Raised This Month: $ Target: $400
 0% 

Loop through nvault data.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exceed
Member
Join Date: Oct 2004
Old 08-12-2009 , 06:13   Loop through nvault data.
Reply With Quote #1

Is it possible to loop through all the data in an nvault? I need to update some information on every user in the nvault(also for the ones not currently on the server) on map end.
__________________
Exceed^ - I JUST CAN'T STOP.
Exceed is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-12-2009 , 09:01   Re: Loop through nvault data.
Reply With Quote #2

Not possible. What you can do is use indexed keys which will allow you to access data while the player
is online and also iterate through all entries if needed. The downside is this will result in 2 nvault transactions
to lookup data on a per-player basis.

Checking for player data while player online:
1. Search vault using steam-id (or whatever unique identifier) to retrieve numeric key.
2. Use numeric key to retrieve player data

Iterate through all entries [for online\offline players]:
1. Create a key such as "NUMENTRIES" which will always hold the number
of player entries stored in the vault. You then can iterate 1 - [NUMENTRIES].
If you do not want to use a NUMENTRIES key you can keep attempting nvault_lookups
until no entry is found for the # key.

ie.
key=STEAM_0_0:12345 val=5
key=5 val=the data for this player

key=STEAM_0_0:54321 val=64
key=64 val=the data for this player

key=STEAM_0_0:11111 val=231
key=231 val=the data for this player

key=NUMENTRIES val=231
iterate nvault_lookup\nvault_get for keys "1" through "231"
__________________

Last edited by Bugsy; 08-12-2009 at 09:05.
Bugsy is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-12-2009 , 16:40   Re: Loop through nvault data.
Reply With Quote #3

FVault has this ability.

http://forums.alliedmods.net/showthread.php?t=76453
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
1101010
BANNED
Join Date: Aug 2009
Old 08-12-2009 , 17:01   Re: Loop through nvault data.
Reply With Quote #4

Go pro
Go MySQL
1101010 is offline
Exceed
Member
Join Date: Oct 2004
Old 08-13-2009 , 08:44   Re: Loop through nvault data.
Reply With Quote #5

I like the way you open/close and use nvault better, but it seems like fvault can do the job quite easy.
__________________
Exceed^ - I JUST CAN'T STOP.
Exceed is offline
Reply


Thread Tools
Display Modes

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 18:23.


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