Scorpious2k
08-30-2003, 05:02 AM
I don't know if anyone else has had a problem with this, but there is an idiosyncrasy in the code for the #<command> which doesn't allow you to raise but not lower the security for the command.
For example, the #grid, #wp and #gassign are all defined as serverop commands and if you wanted to allow LeadGMs access to them, your only choice is to set their status to 200.
If you want to change this and make it entirely driven by the addon.ini file, here are the changes.
In Zone/Client.cpp Client::ChannelMessageReceived find
if (admin >= 250 || admin==cmdlevel)
if (VHServerOP(&sep))
break;
if (admin >= 200 || admin==cmdlevel)
if (ServerOP(&sep))
break;
if (admin >= 150 || admin==cmdlevel)
if (LeadGM(&sep))
break;
if (admin >= 100 || admin==cmdlevel)
if (NormalGM(&sep))
break;
if (admin >= 80 || admin==cmdlevel)
if (QuestTroupe(&sep))
break;
if (admin >= 20 || admin==cmdlevel)
if (VeryPrivUser(&sep))
break;
if (admin >= 10 || admin==cmdlevel)
if (PrivUser(&sep))
break;
NormalUser(&sep);
and chamge it to
if (NormalUser(&sep)) break;
if (PrivUser(&sep)) break;
if (VeryPrivUser(&sep)) break;
if (QuestTroupe(&sep)) break;
if (NormalGM(&sep)) break;
if (LeadGM(&sep)) break;
if (ServerOP(&sep)) break;
if (VHServerOP(&sep)) break;
else
{
Message(0, "Command does not exist");
break;
}
At the bottom of Client::NormalUser find
else {
Message(0, "Command does not exist");
}
return found;
and change it to
// else {
// Message(0, "Command does not exist");
// }
return found;
This will make #command security be driven by whatever you have set in your addon.ini files. However, any command not in addon.ini will be assumed to be set to 0 (any user can do it)
If you want to set a default security for any command that was omitted go to common/database.cpp Database::CommandRequirement and find
for(int i=0; i<maxcommandlevel; i++)
{
if((strcasecmp(commandname, commands[i]) == 0)) {
return commandslevels[i];
}
}
return 255;
change the return 255 to return whatever you want the default to be. So if you wanted the commands that you didn't list in addon.ini to be for serverops only...
for(int i=0; i<maxcommandlevel; i++)
{
if((strcasecmp(commandname, commands[i]) == 0)) {
return commandslevels[i];
}
}
return 200;
I hope this helps anyone else who has come up against this and found it a problem.
For example, the #grid, #wp and #gassign are all defined as serverop commands and if you wanted to allow LeadGMs access to them, your only choice is to set their status to 200.
If you want to change this and make it entirely driven by the addon.ini file, here are the changes.
In Zone/Client.cpp Client::ChannelMessageReceived find
if (admin >= 250 || admin==cmdlevel)
if (VHServerOP(&sep))
break;
if (admin >= 200 || admin==cmdlevel)
if (ServerOP(&sep))
break;
if (admin >= 150 || admin==cmdlevel)
if (LeadGM(&sep))
break;
if (admin >= 100 || admin==cmdlevel)
if (NormalGM(&sep))
break;
if (admin >= 80 || admin==cmdlevel)
if (QuestTroupe(&sep))
break;
if (admin >= 20 || admin==cmdlevel)
if (VeryPrivUser(&sep))
break;
if (admin >= 10 || admin==cmdlevel)
if (PrivUser(&sep))
break;
NormalUser(&sep);
and chamge it to
if (NormalUser(&sep)) break;
if (PrivUser(&sep)) break;
if (VeryPrivUser(&sep)) break;
if (QuestTroupe(&sep)) break;
if (NormalGM(&sep)) break;
if (LeadGM(&sep)) break;
if (ServerOP(&sep)) break;
if (VHServerOP(&sep)) break;
else
{
Message(0, "Command does not exist");
break;
}
At the bottom of Client::NormalUser find
else {
Message(0, "Command does not exist");
}
return found;
and change it to
// else {
// Message(0, "Command does not exist");
// }
return found;
This will make #command security be driven by whatever you have set in your addon.ini files. However, any command not in addon.ini will be assumed to be set to 0 (any user can do it)
If you want to set a default security for any command that was omitted go to common/database.cpp Database::CommandRequirement and find
for(int i=0; i<maxcommandlevel; i++)
{
if((strcasecmp(commandname, commands[i]) == 0)) {
return commandslevels[i];
}
}
return 255;
change the return 255 to return whatever you want the default to be. So if you wanted the commands that you didn't list in addon.ini to be for serverops only...
for(int i=0; i<maxcommandlevel; i++)
{
if((strcasecmp(commandname, commands[i]) == 0)) {
return commandslevels[i];
}
}
return 200;
I hope this helps anyone else who has come up against this and found it a problem.