10.07.2016, 11:35
Hi!
I'm just curious if there's a good way to store a password till the end of the registration. So what I'd like to do is basically store everything the person registeres throughout the registration process to the end of the registration, and then send a query to the database with all that information.
I bet there's plenty of better ways to deal with this, but I don't want to store any accounts that haven't been registered correctly. Meaning it would be perfect for me to store everything when the person is done with the registration. I'm new to both MySQL and pawn so don't kill me for asking these stupid questions. I do have plenty of mistakes in my code that I am unaware of (assuming), and therefore I'd love to get feedback and comments on how to do it correctly and more efficient - wether it's the way I save/load data or the pawn code in general.
This is how my registration should work as of right now (obviously doesn't due to problems with storing data):
- You enter a password, it gets hashed and that password should be stored to the end of the registration.
- After entering your password, you'll choose a gender (male or female) using msgbox, response or no response.
- Then you will have to write in the year your character was born (between year 1916 & 2006)
- After that you'll have to write in the origin of your character (text)
Then all the data should be stored into the database, as that is when you'll spawn in-game. Is this possible or is it a bad idea afterall? I decided to uplodate it to pastebin (easier to read the code): http://pastebin.com/FCWJt9pX
I also have some questions regarding how I should store the data in-game when e.g I change the skin of a player, should I store it automatically to the database (if yes, what's the best way to do it) or wait till the player disconnects? And how to avoid rollbacks when the server unexpectedly shuts down? Please come with suggestions!
And yes I am new to pawn and the way I find the way I dealt with dialogs quite confusing, so it's probably messed up and it doesn't work out properly. Also taking a MySQL course as we speak. Only the name, year and gender gets saved right now. The problem is most likely the way I try to store the password to the end of the registration.
Again, the code can be found here: http://pastebin.com/FCWJt9pX (if you need any more info etc let me know)
I'm just curious if there's a good way to store a password till the end of the registration. So what I'd like to do is basically store everything the person registeres throughout the registration process to the end of the registration, and then send a query to the database with all that information.
I bet there's plenty of better ways to deal with this, but I don't want to store any accounts that haven't been registered correctly. Meaning it would be perfect for me to store everything when the person is done with the registration. I'm new to both MySQL and pawn so don't kill me for asking these stupid questions. I do have plenty of mistakes in my code that I am unaware of (assuming), and therefore I'd love to get feedback and comments on how to do it correctly and more efficient - wether it's the way I save/load data or the pawn code in general.
This is how my registration should work as of right now (obviously doesn't due to problems with storing data):
- You enter a password, it gets hashed and that password should be stored to the end of the registration.
- After entering your password, you'll choose a gender (male or female) using msgbox, response or no response.
- Then you will have to write in the year your character was born (between year 1916 & 2006)
- After that you'll have to write in the origin of your character (text)
Then all the data should be stored into the database, as that is when you'll spawn in-game. Is this possible or is it a bad idea afterall? I decided to uplodate it to pastebin (easier to read the code): http://pastebin.com/FCWJt9pX
I also have some questions regarding how I should store the data in-game when e.g I change the skin of a player, should I store it automatically to the database (if yes, what's the best way to do it) or wait till the player disconnects? And how to avoid rollbacks when the server unexpectedly shuts down? Please come with suggestions!
And yes I am new to pawn and the way I find the way I dealt with dialogs quite confusing, so it's probably messed up and it doesn't work out properly. Also taking a MySQL course as we speak. Only the name, year and gender gets saved right now. The problem is most likely the way I try to store the password to the end of the registration.
Again, the code can be found here: http://pastebin.com/FCWJt9pX (if you need any more info etc let me know)