Scripts/Commands: Adjust .pinfo and .gm list to respect the realmid in account_access table.
closes #1306 Signed-off-by: Subv2112 <[email protected]>
This commit is contained in:
@@ -332,8 +332,8 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
|||||||
QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel, a.email, a.last_ip, a.last_login, a.mutetime "
|
QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel, a.email, a.last_ip, a.last_login, a.mutetime "
|
||||||
"FROM account a "
|
"FROM account a "
|
||||||
"LEFT JOIN account_access aa "
|
"LEFT JOIN account_access aa "
|
||||||
"ON (a.id = aa.id) "
|
"ON (a.id = aa.id AND (aa.RealmID = -1 OR aa.RealmID = %u)) "
|
||||||
"WHERE a.id = '%u'", accId);
|
"WHERE a.id = '%u'", realmID, accId);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
Field* fields = result->Fetch();
|
Field* fields = result->Fetch();
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ EndScriptData */
|
|||||||
#include "ObjectMgr.h"
|
#include "ObjectMgr.h"
|
||||||
#include "Chat.h"
|
#include "Chat.h"
|
||||||
#include "AccountMgr.h"
|
#include "AccountMgr.h"
|
||||||
|
#include "World.h"
|
||||||
|
|
||||||
class gm_commandscript : public CommandScript
|
class gm_commandscript : public CommandScript
|
||||||
{
|
{
|
||||||
@@ -155,7 +156,7 @@ public:
|
|||||||
static bool HandleGMListFullCommand(ChatHandler* handler, char const* /*args*/)
|
static bool HandleGMListFullCommand(ChatHandler* handler, char const* /*args*/)
|
||||||
{
|
{
|
||||||
///- Get the accounts with GM Level >0
|
///- Get the accounts with GM Level >0
|
||||||
QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= %u", SEC_MODERATOR);
|
QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= %u AND (aa.realmid = -1 OR aa.realmid = %u)", SEC_MODERATOR, realmID);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
handler->SendSysMessage(LANG_GMLIST);
|
handler->SendSysMessage(LANG_GMLIST);
|
||||||
|
|||||||
Reference in New Issue
Block a user