Jump to content

[Suggestion] GM-levels


Guest oc_redfox

Recommended Posts

This has been vaugly suggested before, but wasent given much attention so i tought about opening a topic for it...

The idea would be to change the way GM-levels work at the moment and make them more customizable...

Right now you cannot set so a command is usable by GM 1+3 without GM2 also having it (if you see the dilema), so why not change so the commands are set by flags? and/or make it possible to add infinite (or atleast alot more) Gm levels with the desired commands to each of them...

I am sorry if my description of the suggestion is off, will edit / change the post later to make more sense...

Link to comment
Share on other sites

Both yes and no, woulden't having 'bitmasks' limit the GM-levels to a static amount?

Lets say the standard is GM1 GM2 GM3.. If you use Bitmasks and only have those 3 it would be fine, but lets say you add up to GM8 or even higher... With diffrent "commands" assigned to them...

Link to comment
Share on other sites

it would be nice to set the security settings by flags.

so instead of saying gmlevel=3 for a command you say then securityflag=0111 to give it to the first 3 gmlevels and e.g. securityflag=0100 to give it ONLY to gmlevel3.

another thing related to gmlevel: it would be nice to remove all hardcoded gmlevel checks from the code and move them all to the commands-table, so it is easier to modify them.

next thing: it would be nice to be able to set the gmlevels for each realm. one default gmlevel on the realmd table and then on every mangosd you have the possibility to overwrite the gmlevel for an account, so e.g. the account 'dummy' has defaultly only gmlevel 0, but on the realm 'testrealm' he has then gmlevel2, so we don't need to modify the security-settings in the command table to give this user access. (i know that there is a patch for that, but this patch is bad, because it doesn't change all selects for the gmlevel).

oh, and again another thing (sry^^): multiple times in the code there are selects directly on the database to get the gmlevel instead of using the existing method in the Player class, that makes it hard to implement the idea i just mentioned before.

Link to comment
Share on other sites

it would be nice to set the security settings by flags.

so instead of saying gmlevel=3 for a command you say then securityflag=0111 to give it to the first 3 gmlevels and e.g. securityflag=0100 to give it ONLY to gmlevel3.

But let's say you have a gmlevel 4 or gmlevel 5 how would the securityflag look then?

The ability to create / manage as many diffrent gmlevels you like would be nice...

Maybe adding a line in the conf with the amount of gmlevels present so that mangos knows how to read securityflag from DB.. if you have 3 gmlevels (+standard 0 for non-gm) it would be securityflag=0111

but if you change in the config to allow up to 5gmlevels it would be securityflag=011111 (2 extra to read)

There probably is better solutions to create new gmlevels and customize commands on them, so any feedback / ideas is welcome :-)

Link to comment
Share on other sites

lvl5 isn't 11111, that would be lvl31

Back to why I said bitmask earlier.

One byte for GMLevel

00000001 = can use GMLevel 1 comamnds

00000010 = can use GMLevel 2 commands

00000100 = can use GMLevel 3 commands

00001000 = can use GMLevel 4 commands

00010000 = can use GMLevel 5 commands

00100000 = can use GMLevel 6 commands

01000000 = can use GMLevel 7 commands

10000000 = can use GMLevel 8 commands

these of course could be combined

11111111 = can use all GM commands

00110111 = can use GMLevel 6,5,3,2 and 1 commands

Now back to DasBlub- yes, 11111 in binary has a value of 31, however value is not the same as meaning.

To determine if a player can use a certain command, you logically AND his GMLevel with the required GMLevel of the command. If the result is zero, it cannot be done. If the result is anything but zero, the command can be executed. This is an extremely easy procedure for any CPU. (I can make you a relay-based computer that can do this if you really want)

00110111 <-- GMLevel of player

00001000 <-- GMLevel 4 command

------------- <-- logical AND

00000000 <-- result is zero, cannot be used

00110111 <-- GMLevel of player

00010000 <-- GMLevel 5 command

------------- <-- logical AND

00010000 <-- result not zero, command can be used

Link to comment
Share on other sites

×
×
  • 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