mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-04 22:40:05 +00:00
updated readme & small refactor
This commit is contained in:
parent
458843958b
commit
c8c4ec7d01
@ -115,3 +115,7 @@ To make your landwalking experience more pleasant, you can make use of a few adm
|
||||
* `/nano_equip [id] (1-36) [slot] (0-2)`
|
||||
* `/nano_unequip [slot] (0-2)`
|
||||
* `/nano_active [slot] (0-2)`
|
||||
|
||||
## Accounts
|
||||
|
||||
A basic account system has been added, when logging in if the username doesn't exist in the database, a new account with the provided password will be made and you'll be automatically logged in. Otherwise a login attempt will be made. A username must be between 4 and 32 characters, and a password must be between 8 and 32 characters otherwise the account will be rejected. Characters currently save only upon creation, any items add/traded will not be saved.
|
@ -340,13 +340,16 @@ void CNLoginServer::handlePacket(CNSocket* sock, CNPacketData* data) {
|
||||
case P_CL2LS_REQ_PC_EXIT_DUPLICATE:{
|
||||
if (data->size != sizeof(sP_CL2LS_REQ_PC_EXIT_DUPLICATE))
|
||||
return;
|
||||
|
||||
sP_CL2LS_REQ_PC_EXIT_DUPLICATE* exit = (sP_CL2LS_REQ_PC_EXIT_DUPLICATE*)data->buf;
|
||||
auto account = Database::findAccount(U16toU8(exit->szID));
|
||||
if (account == nullptr)
|
||||
break;
|
||||
|
||||
int accountId = account->AccountID;
|
||||
if (!exitDuplicate(accountId))
|
||||
PlayerManager::exitDuplicate(accountId);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -73,7 +73,7 @@ void Database::open()
|
||||
int Database::addAccount(std::string login, std::string password)
|
||||
{
|
||||
password = BCrypt::generateHash(password);
|
||||
Account x;
|
||||
Account x = {};
|
||||
x.Login = login;
|
||||
x.Password = password;
|
||||
x.Selected = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user