Jump to content
RAGE Multiplayer Community

HankSteiner
 Share

Recommended Posts

If I ever go for such a system I wouldn't store names and passwords in files but match player IP and log them in if autologin option is enabled for the selected account. For players with dynamic IPs that would be a problem though.

The other solution is to generate a unique auth token and save it on the client. The token would link to player's account in the database and fetch the required data.

Client storage functions: https://wiki.rage.mp/index.php?title=Client-side_functions#Storage

 

Edited by Doom
  • Like 2
Link to comment
Share on other sites

On 6/10/2019 at 4:29 PM, Doom said:

If I ever go for such a system I wouldn't store names and passwords in files but match player IP and log them in if autologin option is enabled for the selected account. For players with dynamic IPs that would be a problem though.

The other solution is to generate a unique auth token and save it on the client. The token would link to player's account in the database and fetch the required data.

Client storage functions: https://wiki.rage.mp/index.php?title=Client-side_functions#Storage

 

I couldn't say it better.

 

The user is already bad at keeping his password secret and not using the same password he'll use on your server on more services (probably including mail and so on). Don't make it more bad for him by saving his password plain text on a file.

  • Like 1
Link to comment
Share on other sites

vor 20 Minuten schrieb robearded:

I couldn't say it better.

 

The user is already bad at keeping his password secret and not using the same password he'll use on your server on more services (probably including mail and so on). Don't make it more bad for him by saving his password plain text on a file.

Okey can some one give me a Hint on Client storage functions: https://wiki.rage.mp/index.php?title=Client-side_functions#Storage and some code? I am clueless and i think others would benefit from a example. i changed my login process by encrypting passwords using:

bcrypt.hash(pass, null, null, function(err, hash) {

and

bcrypt.compare(pass, sqlPassword, function(err, res2) {

at login. 

Thanks for the Response on this Thread!

Hank

  • Like 1
Link to comment
Share on other sites

7 hours ago, HankSteiner said:

Okey can some one give me a Hint on Client storage functions: https://wiki.rage.mp/index.php?title=Client-side_functions#Storage and some code? I am clueless and i think others would benefit from a example. i changed my login process by encrypting passwords using:

bcrypt.hash(pass, null, null, function(err, hash) {

and

bcrypt.compare(pass, sqlPassword, function(err, res2) {

at login. 

Thanks for the Response on this Thread!

Hank

https://wiki.rage.mp/index.php?title=Storage.flush()

You can find an example there, so basically you use "mp.storage.data.whateverYouWant = ..." to store the data and "mp.storage.flush()" to save the data from the RAM(temporary storage) to the actual disk (permanent storage), will be run automatically on disconnect, however it is recommended to call it yourself too either after adding some data to be saved either at a regular time because if the player game crashes I don't think it will be time for the automatically flush to run.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...