Fuzzie's Account System v3
Ever since 0.4 came out, I knew I had to update my account system that I made for the 0.3z R2 Squirrel server. I also knew that I had to do more than just edit a few lines of code. I had to create an entire new one to support server owners who wants to use the MySQL plugin. I tried to make the difference between both variants as small as possible although several external factors such as connection speed may cause varying experience.
SQLite VariantNothing much was changed from the previous version.
Required Plugins: Squirrel (https://bitbucket.org/stormeus/0.4-squirrel/downloads), SQLite (https://bitbucket.org/stormeus/0.4-sqlite/downloads) and Hashing (https://bitbucket.org/stormeus/0.4-hashing-algorithms/downloads)
This zip archive contains the SQLite variant
(fas_v3_sqlite.nut), a sample SQL query text file, and a sample script.
Download via MediaFire (http://www.mediafire.com/download/t2148bjzm6za56a/Fuzzie's_Account_System_v3_SQLite.zip)
MySQL VariantSpecifically made for server owners and coders who uses a MySQL database.
Required Plugins: Squirrel (https://bitbucket.org/stormeus/0.4-squirrel/downloads), MySQL (https://bitbucket.org/stormeus/0.4-mysql/downloads) and Hashing (https://bitbucket.org/stormeus/0.4-hashing-algorithms/downloads)
This zip archive contains the MySQL variant
(fas_v3_mysql.nut), a sample SQL query text file, and a sample script.
Download via MediaFire (http://www.mediafire.com/download/t72ka01d3nn1691/Fuzzie's_Account_System_v3_MySQL.zip)
Note: When connecting to a MySQL database that is not located locally (localhost), you may need to whitelist your server IP to allow it to remotely access your database. Click here (http://support.hostgator.com/articles/cpanel/how-to-connect-to-the-mysql-database-remotely) for more info.
Both of these variants have the same functions with the same parameters
PlayerClass(playerName, dbGlobal)
PlayerClass.Join(player)
PlayerClass.Update(player, dbGlobal)
PlayerClass.Register(player, password, dbGlobal)
PlayerClass.Login(player, password, dbGlobal)
*dbGlobal is an SQLite or MySQL database pointer. Refer to the sample script (main.nut) for further information.
If you found any bugs, feel free to post it and I will try to fix as soon as possible.
Happy coding!
:D
Sounds'n'looks good at a first view. Good job ;)
Thanks. I have definitely spotted a few places where I can improve it but that will come in the next version which will probably be a few months away depending on how well this one is.
Nice :)
GETTING ERROR Here
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi61.tinypic.com%2F723q5z.png&hash=c08772d94986bf65139aa93327ee86d68aef02e1)
My pic uploader software not working so i give here lines
this is of fas_v3_sqlite line 56
::QuerySQL( dbGlobal, "INSERT INTO Accounts VALUES('" + player.Name + "', '" + player.Name.tolower() + "', '" + ::SHA256( password ) + "', 0, 0, 0, 0, 1, '" + player.IP + "')" );
and error here
this is line of main.nut 156
pstats[ player.ID ].Register( player, text, sqliteDB );
As usual you forgot the required modules (https://bitbucket.org/stormeus/0.4-hashing-algorithms/downloads).
oh thank u so much slc
my problem solve
Quote from: Squirrel Master on Feb 28, 2015, 04:13 AM::QuerySQL( dbGlobal, "INSERT INTO Accounts VALUES('" + player.Name + "', '" + player.Name.tolower() + "', '" + ::SHA256( password ) + "', 0, 0, 0, 0, 1, '" + player.IP + "')" );
Considering high-end cryptographic security,
WHIRLPOOL is preferred over
SHA256 . If the scripts are being updated to the newer 0.4 version then people should utilize the more secure hashing algorithm available to them as well.
Quote from: Kratos_ on Feb 28, 2015, 05:54 AMConsidering high-end cryptographic security, WHIRLPOOL is preferred over SHA256 . If the scripts are being updated to the newer 0.4 version then people should utilize the more secure hashing algorithm available to them as well.
Also consider using a salt if we're on the subject of security :)
Quote from: S.L.C on Feb 28, 2015, 06:00 AMAlso consider using a salt if we're on the subject of security :)
Yes. A hashing algorithm
( WHIRLPOOL ) with a random salt combination will be secure enough, at least in VC:MP. :)
Sorry for bump
Thanks Fuzzie ,
When a registered player join , he is able to register again if he is not automatically logged in.
Fixed Code
if( cmd == "register" ){
if( !text ){
MessagePlayer( "Syntax Error!", player );
MessagePlayer( "Correct syntax: /register <password>", player );
}
else if( pstats[ player.ID ].Level != 0 )MessagePlayer( " This account is already Registered", player );
else if( pstats[ player.ID ].Logged == true ){
MessagePlayer( "You are already logged in.", player );
}
else{
pstats[ player.ID ].Register( player, text, sqliteDB );
}
}
Quote from: Ksna on Jul 11, 2015, 07:41 AMSorry for bump
Thanks Fuzzie ,
When a registered player join , he is able to register again if he is not automatically logged in.
if( cmd == "register" ){
if( !text ){
MessagePlayer( "Syntax Error!", player );
MessagePlayer( "Correct syntax: /register <password>", player );
}
else if( pstats[ player.ID ].Level != 0 )MessagePlayer( " This account is already Registered", player );
else if( pstats[ player.ID ].Logged == true ){
MessagePlayer( "You are already logged in.", player );
}
else{
pstats[ player.ID ].Register( player, text, sqliteDB );
}
}
Because table isnt created in database
Quote from: Beztone on Jul 11, 2015, 07:44 AMBecause table isnt created in database
I just showed a bug and how to fix... and i said if player is not automatically logged.
You Might Modify That System
Quote from: Ksna on Jul 11, 2015, 08:03 AMQuote from: Beztone on Jul 11, 2015, 07:44 AMBecause table isnt created in database
I just showed a bug and how to fix... and i said if player is not automatically logged.
i am using the same system and it happend to me also the i saw that i didnt create the table please ensure the table is created in db
You have not understood what i mean..
Tables are created but he is able to login and register again if he comes from another ip
Recheck:
1. Register your name using /register password then table will be created in database
2. remove this else if( LastUsedIP == player.IP ){
Logged = true;
player.Cash = stats[ player.ID ].Cash;
::MessagePlayer( "Welcome back!", player );
}
from function join(player) . so that next time you enter server you will not auto login.
3. now when you join server it will ask you to login but dont login this time do /register password again and this will make another table for same name.
Check in ADM too it happens same
and putting this else if( stats[ player.ID ].Level != 0 ) MessagePlayer( "You are already Registered.", player );
in register fix this.
I've been using this system and I never encountered such thing, its not bugged, you guys are doing something wrong.
https://www.youtube.com/watch?v=WgYkXPHQlbg&feature=youtu.be
Doom you have modified your script .. so you didn't got this ..
Quote from: Ksna on Jul 14, 2015, 04:52 AMhttps://www.youtube.com/watch?v=WgYkXPHQlbg&feature=youtu.be
Doom you have modified your script .. so you didn't got this ..
Ksna had you added classes?
Yes.....
The only New thing which was the best for us was the security you don't need to copy the full code ._.
Quote from: Ksna on Jul 11, 2015, 07:41 AMSorry for bump
Thanks Fuzzie ,
When a registered player join , he is able to register again if he is not automatically logged in.
Sorry for the late reply. Thanks for the fix but the
/register command and the files associated with it in the Sample Script folder are just a sample script and was not part of the main file in the first place. I wasn't expecting anyone to use the sample script as part of their script, hence the reason why I didn't bothered doing a full bug check.
Okay SO, now edit it, register bug and another bug, which would not let u create the account table on the database
P.S- I love your scripts
error
I Don't Understand Please Can You MAKE A Full Video/Picture Tutorial About This
Bro This Is Not Working On My Server I Downloaded The Modules I am using Windows 10 x64 Bit So I Downloaded It With hashing64, SQLite64, Squirel64
Please make a new topic in the appropriate board if you need specific help.
;D AWESOME ACCOUNT SYSYEM!!!
iam using it for my server.....
Quote from: Shovon^ on Sep 16, 2016, 10:55 AM;D AWESOME ACCOUNT SYSYEM!!!
iam using it for my server.....
There's a like button you know.
ohh thnx for telling ...