Skip to content

Instantly share code, notes, and snippets.

@Sar777
Created July 24, 2012 15:30
Show Gist options
  • Save Sar777/3170675 to your computer and use it in GitHub Desktop.
Save Sar777/3170675 to your computer and use it in GitHub Desktop.
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index 05932c5..c1e4680 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -6647,7 +6647,7 @@ bool ChatHandler::HandleInstanceSaveDataCommand(char* /*args*/)
bool ChatHandler::HandleGMListFullCommand(char* /*args*/)
{
///- Get the accounts with GM Level >0
- QueryResult *result = LoginDatabase.Query( "SELECT username,gmlevel FROM account WHERE gmlevel > 0" );
+ QueryResult *result = LoginDatabase.PQuery("SELECT ac.username, ac.gmlevel, af.Security FROM account ac LEFT JOIN account_forcepermission af ON ac.id = af.AccountID WHERE (af.Security > 0 AND realmID = '%u') OR ac.gmlevel > 0", sConfig.GetIntDefault("RealmID", 0));
if(result)
{
SendSysMessage(LANG_GMLIST);
@@ -6659,7 +6659,7 @@ bool ChatHandler::HandleGMListFullCommand(char* /*args*/)
do
{
Field *fields = result->Fetch();
- PSendSysMessage("|%15s|%6s|", fields[0].GetString(),fields[1].GetString());
+ PSendSysMessage("|%15s|%6u|", fields[0].GetString(), (fields[1].GetUInt8() > fields[2].GetUInt8()) ? fields[1].GetUInt8() : fields[2].GetUInt8());
}while( result->NextRow() );
PSendSysMessage("========================");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment