new g_iSaveType = 0;
...
json_object_get_string(config, "save_type", temp, charsmax(temp));
g_iSaveType = str_to_num(temp);
...
new buffer[128], szAuth[MAX_AUTHID_LENGTH];
new name[64], hash[64];
get_user_name(id,name,charsmax(name))
hash_string(name,Hash_Crc32,hash,charsmax(hash));
get_user_authid(id, szAuth, MAX_AUTHID_LENGTH - 1);
if (g_iSaveType == 1)
formatex(buffer, charsmax(buffer), "SELECT `auth`, `data` FROM `%s` WHERE `auth` = '%s'", dbdata[table], szAuth);
else if (g_iSaveType == 2)
formatex(buffer, charsmax(buffer), "SELECT `auth`, `data` FROM `%s` WHERE `auth` = '%s-%s'", dbdata[table], szAuth, hash);
else
formatex(buffer, charsmax(buffer), "SELECT `auth`, `data` FROM `%s` WHERE `auth` = '%s'", dbdata[table], szAuth);
...
new buffer[1024], serial[612];
new auth[MAX_AUTHID_LENGTH];
new name[64], hash[64];
get_user_name(id,name,charsmax(name))
hash_string(name,Hash_Crc32,hash,charsmax(hash));
get_user_authid(id, auth, charsmax(auth));
json_serial_to_string(g_jObject[id], serial, charsmax(serial));
if (g_iSaveType == 1)
formatex(buffer, charsmax(buffer), "INSERT INTO `%s` (`auth`, `data`) VALUES ('%s-%s', \
'%s') ON DUPLICATE KEY UPDATE `data` = '%s';", dbdata[table], auth, hash, serial, serial);
else if (g_iSaveType == 2)
formatex(buffer, charsmax(buffer), "INSERT INTO `%s` (`auth`, `data`) VALUES ('%s', \
'%s') ON DUPLICATE KEY UPDATE `data` = '%s';", dbdata[table], auth, serial, serial);
else
formatex(buffer, charsmax(buffer), "INSERT INTO `%s` (`auth`, `data`) VALUES ('%s', \
'%s') ON DUPLICATE KEY UPDATE `data` = '%s';", dbdata[table], auth, serial, serial);