mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Reimplement some functions
This commit is contained in:
+2
-16
@@ -19,14 +19,7 @@ struct EQ::Net::ConsoleLoginStatus CheckLogin(const std::string& username, const
|
||||
std::string prefix = "eqemu";
|
||||
std::string raw_user = "";
|
||||
|
||||
auto split = SplitString(username, '.');
|
||||
if (split.size() == 2) {
|
||||
prefix = split[0];
|
||||
raw_user = split[1];
|
||||
}
|
||||
else {
|
||||
raw_user = split[0];
|
||||
}
|
||||
ParseAccountString(username, raw_user, prefix);
|
||||
|
||||
ret.account_id = database.CheckLogin(raw_user.c_str(), password.c_str(), prefix.c_str());
|
||||
|
||||
@@ -399,14 +392,7 @@ void ConsoleSetPass(EQ::Net::ConsoleServerConnection* connection, const std::str
|
||||
std::string prefix = "eqemu";
|
||||
std::string raw_user = "";
|
||||
|
||||
auto split = SplitString(args[0], '.');
|
||||
if (split.size() == 2) {
|
||||
prefix = split[0];
|
||||
raw_user = split[1];
|
||||
}
|
||||
else {
|
||||
raw_user = split[0];
|
||||
}
|
||||
ParseAccountString(args[0], raw_user, prefix);
|
||||
|
||||
int16 tmpstatus = 0;
|
||||
uint32 tmpid = database.GetAccountIDByName(raw_user.c_str(), prefix.c_str(), &tmpstatus);
|
||||
|
||||
+22
-18
@@ -213,24 +213,28 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
}
|
||||
else if (strcasecmp(argv[1], "adduser") == 0) {
|
||||
//TODO: REIMPLEMENT
|
||||
//if (argc == 5) {
|
||||
// if (Seperator::IsNumber(argv[4])) {
|
||||
// if (atoi(argv[4]) >= 0 && atoi(argv[4]) <= 255) {
|
||||
// if (database.CreateAccount(argv[2], argv[3], atoi(argv[4])) == 0) {
|
||||
// std::cerr << "database.CreateAccount failed." << std::endl;
|
||||
// return 1;
|
||||
// }
|
||||
// else {
|
||||
// std::cout << "Account created: Username='" << argv[2] << "', Password='" << argv[3] << "', status=" << argv[4] << std::endl;
|
||||
// return 0;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//std::cout << "Usage: world adduser username password flag" << std::endl;
|
||||
//std::cout << "flag = 0, 1 or 2" << std::endl;
|
||||
//return 0;
|
||||
if (argc == 5) {
|
||||
if (Seperator::IsNumber(argv[4])) {
|
||||
if (atoi(argv[4]) >= 0 && atoi(argv[4]) <= 255) {
|
||||
std::string user;
|
||||
std::string loginserver;
|
||||
|
||||
ParseAccountString(argv[2], user, loginserver);
|
||||
|
||||
if (database.CreateAccount(argv[2], argv[3], atoi(argv[4]), loginserver.c_str(), 0) == 0) {
|
||||
std::cerr << "database.CreateAccount failed." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
std::cout << "Account created: Username='" << argv[2] << "', Password='" << argv[3] << "', status=" << argv[4] << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout << "Usage: world adduser username password flag" << std::endl;
|
||||
std::cout << "flag = 0, 1 or 2" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
else if (strcasecmp(argv[1], "flag") == 0) {
|
||||
if (argc == 4) {
|
||||
|
||||
Reference in New Issue
Block a user