* Add support for different gmlevel's for different realms.
* * Using the value -1 will add the same value for all realms. * Make sure to apply the updates. * Information regarding this patch will be posted on the database forums soon. * * Thanks to Sundark and the Ilixiuemu team(for original patch) --HG-- branch : trunk
This commit is contained in:
@@ -236,9 +236,12 @@ bool ChatHandler::HandleAccountOnlineListCommand(const char* /*args*/)
|
||||
|
||||
///- Get the username, last IP and GM level of each account
|
||||
// No SQL injection. account is uint32.
|
||||
// 0 1 2 3
|
||||
QueryResult *resultLogin = loginDatabase.PQuery("SELECT username, last_ip, gmlevel, expansion FROM account WHERE id = '%u'",account);
|
||||
|
||||
QueryResult *resultLogin =
|
||||
loginDatabase.PQuery("SELECT a.username, a.last_ip, aa.gmlevel, a.expansion "
|
||||
"FROM account a "
|
||||
"LEFT JOIN account_access aa "
|
||||
"ON (a.id = aa.id) "
|
||||
"WHERE a.id = '%u'", account);
|
||||
if(resultLogin)
|
||||
{
|
||||
Field *fieldsLogin = resultLogin->Fetch();
|
||||
|
||||
@@ -145,7 +145,7 @@ void RASocket::OnRead()
|
||||
{
|
||||
szLogin=&buff[5];
|
||||
|
||||
///- Get the gmlevel and password from the account table
|
||||
///- Get the password from the account table
|
||||
std::string login = szLogin;
|
||||
|
||||
///- Convert Account name to Upper Format
|
||||
@@ -154,7 +154,7 @@ void RASocket::OnRead()
|
||||
///- Escape the Login to allow quotes in names
|
||||
loginDatabase.escape_string(login);
|
||||
|
||||
QueryResult* result = loginDatabase.PQuery("SELECT gmlevel FROM account WHERE username = '%s'",login.c_str());
|
||||
QueryResult* result = loginDatabase.PQuery("SELECT aa.gmlevel FROM account_access aa, account a WHERE a.username = '%s' AND aa.id = a.id",login.c_str());
|
||||
|
||||
///- If the user is not found, deny access
|
||||
if(!result)
|
||||
|
||||
Reference in New Issue
Block a user