Raised This Month: $ Target: $400
 0% 

Better save system than nvault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-03-2013 , 12:00   Re: Better save system than nvault
Reply With Quote #1

nVault is good because it's the easiest. Depending on the amount of data and the types of queries you need to make, SQL could be a better option. If you want to continue with nVault, is it possible to change how your data is being saved to less the number of entries per-player? Give an example of each players entries.
__________________
Bugsy is offline
bcKq
Member
Join Date: Dec 2012
Location: Tczew, Poland
Old 11-05-2013 , 15:36   Re: Better save system than nvault
Reply With Quote #2

PHP Code:
Buli&Soldat \y(SuperVIP)&cod#9834110#300#0#0#248#0 
First is nick, second is class. There are X number of player data entries where X stands for number of class (about 30). The remaining data are stats, split by # (I use replace_all in loaddata)

I already use SQL and nVault together, SQL is for storing player's clans (1st table, uses IDs of players from the second one) and orders (money) + passwords (second table).
Should I make another table for Player Class Data? It would make another 30 entries per each player. Would it be better optimized than nVault?

The queries I make with nvault are:
LoadData, SaveData and that's pretty much it.

For SQL it's a lot more queries (1000+ per second?) because I use it in a function that is called each 0.1 second for EACH player (so if there are 32 players it is 32 queries per 0.1 second). I know it's not optimized and I'm working on a rewrite of this part. There are also queries made when someone says in chat like /clan, /account, /login, player connect, disconnect, synchronize data with SQL etc.

I really don't know what save system would be best for that type of databases (I really work on them a lot).
I think now I will work on pure SQL, but I have a question:
Should I use SQL queries like I do now:
PHP Code:
new Handle:hPolaczenieiErrorszError[256];
    if((
hPolaczenie SQL_Connect(g_PojemnikSQLiErrorszError255)))
    {
        new 
Handle:hQuery SQL_PrepareQuery(hPolaczenie"SELECT * FROM gracze WHERE `nick` = '%s'"g_NickGracza[id]);
        new 
szHaslo[32];
        
        if(
SQL_Execute(hQuery))
        {
            
SQL_ReadResult(hQuerySQL_FieldNameToNum(hQuery"haslo"), szHaslo31);
            if( !
equali(szHaslo"") )
            {
                
g_bZarejestrowany[id] = true;
            }
            else
            {
                
g_bZarejestrowany[id] = false;
            }
        } 
SQL_FreeHandle(hQuery);
    } 
SQL_FreeHandle(hPolaczenie); 
Or would it be better to use that module:
http://forums.alliedmods.net/showthread.php?t=227170

If you have any suggestions please post below
__________________
This is my signature.
bcKq is offline
Reply



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


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