[Tutorial] [UPDATED 19/05/2015]MySQL Registration System [Threaded Queries + Whirlpool]
#41

I compiled and everything was going alright then i tried to register i only can register one account with ID 0 then that "OnAccountRegister" isn't called again for any other accounts and doesn't create any accounts.
Reply
#42

Quote:
Originally Posted by Problems
View Post
I compiled and everything was going alright then i tried to register i only can register one account with ID 0 then that "OnAccountRegister" isn't called again for any other accounts and doesn't create any accounts.
Can you post your recent MySQL log?
Reply
#43

Nice tutorial friend. But for example I have a variable "gTeam" and it stores the player's team. So how should I save it to the MySQL database?
Reply
#44

I have A Problem..when failed login or exit the game in login. automatic save spawn in Blubberry farm / login camera ...when I do not succeed login Sorry, my English is bad
Reply
#45

It's normally?

Quote:

[13:08:36 12/01/16] [DEBUG] mysql_format - connection: 1, len: 128, format: "UPDATE `accounts` SET `Money` = %d, `PosX` = %f, `PosY` = %f, `PosZ` = %f, `PosA` = %f WHERE `ID` = %d"
[13:08:36 12/01/16] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `accounts` SET `Money` = 0, `PosX` = -46.933, `PosY` = -7", callback: "(null)", format: "(null)"
[13:08:36 12/01/16] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[13:08:36 12/01/16] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 42.511 milliseconds
[13:08:36 12/01/16] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving
[13:08:48 12/01/16] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "server", password: "****", port: 3306, autoreconnect: true, pool_size: 2
[13:08:48 12/01/16] [DEBUG] CMySQLHandle::Create - creating new connection..
[13:08:48 12/01/16] [WARNING] CMySQLHandle::Create - connection already exists
[13:08:48 12/01/16] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[13:08:48 12/01/16] [DEBUG] CMySQLConnection::Connect - connection was successful
[13:08:48 12/01/16] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[13:08:48 12/01/16] [DEBUG] mysql_errno - connection: 1
[13:08:48 12/01/16] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[13:08:48 12/01/16] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[13:08:48 12/01/16] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[13:08:48 12/01/16] [DEBUG] CMySQLConnection::Connect - connection was successful
[13:08:48 12/01/16] [DEBUG] CMySQLConnection::Connect - connection was successful
[13:08:48 12/01/16] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `Password`, `ID` FROM `accounts` WHERE `Name` = '%e' LIMIT 1"
[13:08:48 12/01/16] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[13:08:48 12/01/16] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
FROM `accounts` WHERE `Name` = 'Woody' L", callback: "OnAccountCheck", format: "i"
[13:08:48 12/01/16] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[13:08:48 12/01/16] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - starting query execution
[13:08:48 12/01/16] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - query was successfully executed within 0.280 milliseconds
[13:08:48 12/01/16] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[13:08:48 12/01/16] [DEBUG] Calling callback "OnAccountCheck"..
[13:08:48 12/01/16] [DEBUG] cache_get_data - connection: 1
[13:08:48 12/01/16] [DEBUG] cache_get_field_content - row: 0, field_name: "Password", connection: 1, max_len: 129
[13:08:48 12/01/16] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Password", data: "CCE08BBA3F2E3C029CD257104B06D4B075772D5F514CF1B77 89506F9A69D53C51464881D2C18445AB290553B302F67A24B1 C69E3E737A46215DEAF43517E4960"
[13:08:48 12/01/16] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1
[13:08:48 12/01/16] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "1"
[13:08:48 12/01/16] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[13:08:53 12/01/16] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `accounts` WHERE `Name` = '%e' LIMIT 1"
[13:08:53 12/01/16] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `accounts` WHERE `Name` = 'Woody' LIMIT 1", callback: "OnAccountLoad", format: "i"
[13:08:53 12/01/16] [DEBUG] CMySQLQuery::Execute[OnAccountLoad] - starting query execution
[13:08:53 12/01/16] [DEBUG] CMySQLQuery::Execute[OnAccountLoad] - query was successfully executed within 0.350 milliseconds
[13:08:53 12/01/16] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[13:08:53 12/01/16] [DEBUG] Calling callback "OnAccountLoad"..
[13:08:53 12/01/16] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Admin", connection: 1
[13:08:54 12/01/16] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Admin", data: "0"
[13:08:54 12/01/16] [DEBUG] cache_get_field_content_int - row: 0, field_name: "VIP", connection: 1
[13:08:54 12/01/16] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "VIP", data: "0"
[13:08:54 12/01/16] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Money", connection: 1
[13:08:54 12/01/16] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Money", data: "0"
[13:08:54 12/01/16] [DEBUG] cache_get_field_content_float - row: 0, field_name: "PosX", connection: 1
[13:08:54 12/01/16] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "PosX", data: "-46.933"
[13:08:54 12/01/16] [DEBUG] cache_get_field_content_float - row: 0, field_name: "PosY", connection: 1
[13:08:54 12/01/16] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "PosY", data: "-7.618"
[13:08:54 12/01/16] [DEBUG] cache_get_field_content_float - row: 0, field_name: "PosZ", connection: 1
[13:08:54 12/01/16] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "PosZ", data: "3.109"
[13:08:54 12/01/16] [DEBUG] cache_get_field_content_float - row: 0, field_name: "PosA", connection: 1
[13:08:54 12/01/16] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "PosA", data: "325.763"
[13:08:54 12/01/16] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called

Reply
#46

Yes, that's normal. This tutorial sets logging on LOG_ALL, which means that everything will be logged.

Check this out for the different log levels: https://sampwiki.blast.hk/wiki/MySQL/R33#mysql_log
Reply
#47

Would be great if you showed people how to salt their passwords for extra protection.
Reply
#48

enum
{
LoginDialog,
RegisterDialog
};
where to put this?
Reply
#49

UP the gamemode after includes and defines and before public functions
Reply
#50

Can someone update this tutorial upto R41-2? Thanks!
Reply
#51

Quote:
Originally Posted by eikzdej
View Post
Can someone update this tutorial upto R41-2? Thanks!
If you know how to use R33, conversion will be quite easy - https://sampforum.blast.hk/showthread.php?tid=616103

NOTE : Please check my post on 4th page of that topic. maddinat0r haven't yet fixed a mistake on using cache_get_value_index_int.
Reply
#52

Quote:
Originally Posted by Lordzy
View Post
If you know how to use R33, conversion will be quite easy - https://sampforum.blast.hk/showthread.php?tid=616103

NOTE : Please check my post on 4th page of that topic. maddinat0r haven't yet fixed a mistake on using cache_get_value_index_int.
I see, but it is still okay to use versions before r40?
Reply
#53

Quote:
Originally Posted by eikzdej
View Post
I see, but it is still okay to use versions before r40?
It is, unless there are any security related issues with the previous versions of MySQL plugin. But I wouldn't recommend using old versions.
Reply
#54

I wonder why almost every script/tutorial the databases are not normalized at all....
Reply
#55

money and score do not save help.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)