Multiple login account support initial, needs a ton of work but can login and create account

This commit is contained in:
KimLS
2017-11-14 21:42:14 -08:00
parent da163be8db
commit 6b70faf141
18 changed files with 198 additions and 359 deletions
+28 -25
View File
@@ -15,17 +15,18 @@ extern ZSList zoneserver_list;
extern LoginServerList loginserverlist;
struct EQ::Net::ConsoleLoginStatus CheckLogin(const std::string& username, const std::string& password) {
//TODO REIMPLEMENT
struct EQ::Net::ConsoleLoginStatus ret;
ret.account_id = database.CheckLogin(username.c_str(), password.c_str());
if (ret.account_id == 0) {
return ret;
}
char account_name[64];
database.GetAccountName(ret.account_id, account_name);
ret.account_name = account_name;
ret.status = database.CheckStatus(ret.account_id);
//ret.account_id = database.CheckLogin(username.c_str(), password.c_str());
//if (ret.account_id == 0) {
// return ret;
//}
//
//char account_name[64];
//database.GetAccountName(ret.account_id, account_name);
//
//ret.account_name = account_name;
//ret.status = database.CheckStatus(ret.account_id);
return ret;
}
@@ -379,21 +380,23 @@ void ConsoleFlag(EQ::Net::ConsoleServerConnection* connection, const std::string
}
void ConsoleSetPass(EQ::Net::ConsoleServerConnection* connection, const std::string& command, const std::vector<std::string>& args) {
if (args.size() != 2) {
connection->SendLine("Format: setpass accountname password");
}
else {
int16 tmpstatus = 0;
uint32 tmpid = database.GetAccountIDByName(args[0].c_str(), &tmpstatus);
if (!tmpid)
connection->SendLine("Error: Account not found");
else if (tmpstatus > connection->Admin())
connection->SendLine("Cannot change password: Account's status is higher than yours");
else if (database.SetLocalPassword(tmpid, args[1].c_str()))
connection->SendLine("Password changed.");
else
connection->SendLine("Error changing password.");
}
//TODO: REIMPLEMENT
//if (args.size() != 2) {
// connection->SendLine("Format: setpass accountname password");
//}
//else {
// int16 tmpstatus = 0;
// uint32 tmpid = database.GetAccountIDByName(args[0].c_str(), &tmpstatus);
// if (!tmpid)
// connection->SendLine("Error: Account not found");
// else if (tmpstatus > connection->Admin())
// connection->SendLine("Cannot change password: Account's status is higher than yours");
// else if (database.SetLocalPassword(tmpid, args[1].c_str()))
// connection->SendLine("Password changed.");
// else
// connection->SendLine("Error changing password.");
//}
}
void ConsoleVersion(EQ::Net::ConsoleServerConnection* connection, const std::string& command, const std::vector<std::string>& args) {