nVault to MySQL on map load/change
Greetings,
I have a question in regards to saving data methods. I'm running a mod that saves xp data via nvault. Previously, I used the mod's MySQL saving method but it seems to cause a lag / delay when a user's xp/lvl is saved so I'm sticking to nvault. However, I was wondering if there's a way to dump/convert/export an nvault into a specific database table, preferably on a map load/change. The reason why is because I want to be able to call PHP functions in order to retrieve data stored in that table/columns and format them accordingly to have a stats page on the web browser. Examples include retrieving the top 5 players and having a nicely formatted top 5 page that can be accessed via a web browser (ex - www.****.com/top5.php). I understand there's a client-side MOTD that can be called to display the same information that retrieves data stored in nvault and displays it via MOTD but I want to go beyond that using MySQL/PHP. TL;DR - How can you convert/export nvault file to a MySQL database table? |
Re: nVault to MySQL on map load/change
check this thread https://forums.alliedmods.net/showthread.php?t=207922
|
Re: nVault to MySQL on map load/change
Quote:
|
Re: nVault to MySQL on map load/change
Quote:
|
Re: nVault to MySQL on map load/change
Quote:
The MySQL table (Pokerank) - columns include "RankNumber" and "Info". http://puu.sh/tCXN2/d563c9e9b7.png Plugin code : PHP Code:
|
Re: nVault to MySQL on map load/change
Code:
// BlackListEdit: Will not export data with keys beginning with '[BOT]' (case sensitive) PHP Code:
https://dl.dropboxusercontent.com/u/...X/nVExport.PNG |
Re: nVault to MySQL on map load/change
1 Attachment(s)
Quote:
This is the structure of the table named 'Pokerank' with columns RankNumber and Info in database called 'database'. http://puu.sh/tDkn9/6b13cfed64.png PHP Code:
|
Re: nVault to MySQL on map load/change
Query string is too small, change static szQuery[ 256 ] to static szQuery[ 1024 ] in nVault_Export().
Your data looks like it's a mix of names/steam-id's/and other things as the key. How exactly are you organizing/saving data in your plugin/vault? |
Re: nVault to MySQL on map load/change
Quote:
|
Re: nVault to MySQL on map load/change
Quote:
I'm going to post below a snippet of the code for the saving method used from PokeMod (xp.inl). It saves all of the player's pokemon numbers followed by the XP for those pokemon. Afterwards, there is a colon as a separator added and then the current timestamp followed by another colon as a separator. It will then save their HUD position settings. Another colon and finally their pokerank number. Example vault entry (the key is the player's SteamID. If player is a bot, then [Bot]Name). Key : PHP Code:
PHP Code:
155 32 296 1 16 1 163 1 19 1 369 1 # XP # XP # XP # XP # XP # XP. The zero's are empty slots because a player can hold 100 pokemon. 1485534210 is the time stamp. 18 0 is the HUD X and Y position. 9 is their Pokerank number. xp.inl snippet : PHP Code:
https://github.com/Liquidbullets/AMX...pokemon/xp.inl Hope this clears up any questions. Thank you again Bugsy. Quote:
The vault appears to have 46 entries. Some player data, some bot data, and ranking data. http://puu.sh/tEAUH/d81120685f.png |
| All times are GMT -4. The time now is 21:04. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.