Jump to content

Where Is It Defined That Gmlevel>0 Is Gm Account?


Guest teacher4444
 Share

Recommended Posts

Rev 6525

I have found in common.h:

enum AccountTypes
{
       SEC_PLAYER                 = 0,
       SEC_MODERATOR            = 1,
       SEC_GAMEMASTER         = 2,
       SEC_ADMINISTRATOR    = 3
       };

Maybe something related to it in CliRunnable.cpp (but only as reference):

AccountTypes allowedAccountType = sWorld.GetPlayerSecurityLimit();
       char const* secName = "";
       switch(allowedAccountType)
       {
               case SEC_PLAYER:                secName = "Player";                break;
               case SEC_MODERATOR:         secName = "Moderator";         break;
               case SEC_GAMEMASTER:        secName = "Gamemaster";        break;
               case SEC_ADMINISTRATOR: secName = "Administrator"; break;
               default:                                secName = "<unknown>";         break;
       }

The point is: we know that if GMlevel=0 the account has no privileges, if GMlevel>0 the account has privileges, even if it has access to no commands. For example a GMlevel>0 account will always be able to receive whispers byany race and understand them (and be understandable -> universal language) even if mangosd.conf is set NOT to allow TwoSideInteraction.

I am trying to find in the core where it states that if GMlevel>0 it is considered a GM Account, instead of (for example) only if GMlevel>2 and so on.

If you can direct me it would be very helpful. Thank you. :)

Link to comment
Share on other sites

Ok, I think I got it, so please feel free to tell me I'm wrong or if I got it right.

By looking at the code, NOWHERE is it defined if an account is GM or non-GM. It does not state that GMlevel>0 is a GM account and GMlevel=0 is a Beta Tester account.

What the core does is specify for EVERY situation, where a privilege distinction is needed, a > or < or == ; it always states >SEC_PLAYER, or == SEC_PLAYER, or <SEC_GAMEMASTER and so on.

As I quoted from code before, Common.h is where you find the hierarchy or the AccountTypes. So the code knows that SEC_PLAYER is lower than SEC_MODERATOR, which il lower than SEC_GAMEMASTER and so on.

Just a hint for Devs: do you think this may cause problems in future when things get even more complicated, and maybe it is best to define 2 groups of AccountTypes, GM and non-GM, and then have sub-AccountTypes in these 2 groups? This way when implementing anything knew you don't care about the name or hierarchy of the AccountType, you just state if it matters whether it is GM or non-GM, and leave the hierarchy part for specific situations which require such precision.

I hope I was able to explain my proposition.

It is not a critic nor a complain, I wish I had the skills to explain it in proper technical terms or even better submit a patch myself as reference. :unsure:

Just a thought.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use