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:hPolaczenie, iError, szError[256];
if((hPolaczenie = SQL_Connect(g_PojemnikSQL, iError, szError, 255)))
{
new Handle:hQuery = SQL_PrepareQuery(hPolaczenie, "SELECT * FROM gracze WHERE `nick` = '%s'", g_NickGracza[id]);
new szHaslo[32];
if(SQL_Execute(hQuery))
{
SQL_ReadResult(hQuery, SQL_FieldNameToNum(hQuery, "haslo"), szHaslo, 31);
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
__________________