Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-30-2003, 05:02 AM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default #<command> Security and Addon.ini

I don't know if anyone else has had a problem with this, but there is an idiosyncrasy in the code for the #&lt;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
Code:
				if (admin >= 250 || admin==cmdlevel)
					if (VHServerOP(&amp;sep))
						break;
				if (admin >= 200 || admin==cmdlevel)
					if (ServerOP(&amp;sep))
						break;
				if (admin >= 150 || admin==cmdlevel)
					if (LeadGM(&amp;sep))
						break;
				if (admin >= 100 || admin==cmdlevel)
					if (NormalGM(&amp;sep))
						break;
				if (admin >= 80 || admin==cmdlevel)
					if (QuestTroupe(&amp;sep))
						break;
				if (admin >= 20 || admin==cmdlevel)
					if (VeryPrivUser(&amp;sep))
						break;
				if (admin >= 10 || admin==cmdlevel)
					if (PrivUser(&amp;sep))
						break;
				NormalUser(&amp;sep);
and chamge it to
Code:
				if (NormalUser(&amp;sep)) break;
				if (PrivUser(&amp;sep)) break;
				if (VeryPrivUser(&amp;sep)) break;
				if (QuestTroupe(&amp;sep)) break;
				if (NormalGM(&amp;sep)) break;
				if (LeadGM(&amp;sep)) break;
				if (ServerOP(&amp;sep)) break;
				if (VHServerOP(&amp;sep)) break;
				else 
				{
					Message(0, "Command does not exist");
					break;
				}
At the bottom of Client::NormalUser find
Code:
	else {
		Message(0, "Command does not exist");
	}
	return found;
and change it to
Code:
//	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
Code:
	for(int i=0; i&lt;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...
Code:
	for(int i=0; i&lt;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.
__________________
Maybe I should try making one of these servers...
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:45 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3