* Add more checks for the gmlevel patch in RAsocket.cpp

* Allow only GM's with the gmlevel across all realms access to RA.
* Thanks to Sundark.

--HG--
branch : trunk
This commit is contained in:
p0wer
2009-12-22 21:09:04 -06:00
parent f305c4639e
commit 6cd46ebd4a

View File

@@ -154,7 +154,7 @@ void RASocket::OnRead()
///- Escape the Login to allow quotes in names
loginDatabase.escape_string(login);
QueryResult* result = loginDatabase.PQuery("SELECT aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = '%s'",login.c_str ());
QueryResult* result = loginDatabase.PQuery("SELECT a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = '%s' AND aa.RealmID = '-1'",login.c_str ());
///- If the user is not found, deny access
if(!result)
@@ -170,7 +170,7 @@ void RASocket::OnRead()
//szPass=fields[0].GetString();
///- if gmlevel is too low, deny access
if(fields[0].GetUInt32()<iMinLevel)
if(fields[1].GetUInt32()<iMinLevel && fields[1].GetUInt32() != NULL))
{
Sendf("-Not enough privileges.\r\n");
sLog.outRemote("User %s has no privilege.\n",szLogin.c_str());