PDA

View Full Version : Server Lock Question


cubber
04-03-2008, 03:25 PM
Is there a way to still have your server locked but allow users below 100 status entry? I would like to keep my server private but don't want everyone to have GM access. For example say I want to set it at 10 so I can limit the amount of GM commands being used.

If that is not possible is there a way to make a custom status level for all new accounts that is above 100, and only allows them a specific set of commands that are cherry picked from the whole set of commands?

Say for instance I want to keep my server locked but only want to allow players access to the following commands:

#zone
#heal
#itemsearch
#summonitem

I looked at the default status line in the config file but to me that looks like it sets an accounts default status to 0, not control who gets to log into a locked server.

Thanks

So_1337
04-03-2008, 03:34 PM
You can control the amount of status required to activate each #command in the commands table of the database.

cubber
04-03-2008, 03:42 PM
Yah I know I can do that but that would be a ton of commands to edit. If I was able to change the locked server status setting I could just set it to 10 to limit the commands then only have to change a couple of them.

I was told in IRC by mattmeck to "edit the code itself to lower the status that is allowed in when locked"

Anyone know how I could go about doing this? He didn't elaborate. I was probably idle to long when I got the message in IRC, and he was probably gone by the time I got back and asked for more info.

cubber
04-03-2008, 04:16 PM
looks like if I change the following lines in world/loginserver.cpp it might do the trick.

if(Config->Locked == true)
{
if((status == 0 || status < 100) && (status != -2 || status != -1))
utwrs->response = 0;
if(status >= 100)
utwrs->response = 1;
}
else {
utwrs->response = 1;
}


My guess is change the 100 to 10 in both lines then recompile world? Would that be it?

cubber
04-03-2008, 06:35 PM
I was able to test this and it worked perfectly. I ended up setting the status to 5. Then changed the few commands that I wanted "privileged users" to have to 6. This way I can flag legit players as 5, and people that need a few more commands but not the whole shabang as 6.

circuitdragon
04-04-2008, 12:07 AM
A bit off topic, but you could have ran a script to change all command status levels to say...200, then lowered the select few you want "certain few" to have access to. But that wouldn't help with the locked status. And the way you went about it is perhaps the nicer way to do this. You could have left it open and dropped some NPCs at all starting locations to attack anyone with a "0" status. :D That would keep people off the server, though they would not be happy about it. lol

AndMetal
04-04-2008, 12:09 AM
This would be something good to add as a rule. I'm not really a C++ coder, but the following should do the trick.

Change common/ruletypes.h (http://eqemulator.cvs.sourceforge.net/eqemulator/EQEmuCVS/Source/common/ruletypes.h?revision=1.22&view=markup#l_58) from this:

58 RULE_CATEGORY( World )
59 RULE_INT ( World, ZoneAutobootTimeoutMS, 60000 )
60 RULE_INT ( World, ClientKeepaliveTimeoutMS, 65000 )
61 RULE_CATEGORY_END()

to this:

RULE_CATEGORY( World )
RULE_INT ( World, ZoneAutobootTimeoutMS, 60000 )
RULE_INT ( World, ClientKeepaliveTimeoutMS, 65000 )
RULE_INT ( World, LockedOverrideMinStatus, 100 )
RULE_CATEGORY_END()


Change world/loginserver.cpp (http://eqemulator.cvs.sourceforge.net/eqemulator/EQEmuCVS/Source/world/LoginServer.cpp?revision=1.8&view=markup#l_123) from this:

123 if(Config->Locked == true)
124 {
125 if((status == 0 || status < 100) && (status != -2 || status != -1))
126 utwrs->response = 0;
127 if(status >= 100)
128 utwrs->response = 1;
129 }
130 else {
131 utwrs->response = 1;
132 }

to this:

if(Config->Locked == true)
{
if((status == 0 || status < RuleI(World, LockedOverrideMinStatus)) && (status != -2 || status != -1))
utwrs->response = 0;
if(status >= RuleI(World, LockedOverrideMinStatus))
utwrs->response = 1;
}
else {
utwrs->response = 1;
}

It might be worth declaring World:LockedOverrideMinStatus as a variable, but I'm not sure if it would make any performance increase (1 check into the rule system instead of 2).

Then, we just need to add the rule into the DB:
INSERT INTO rule_values (0, "World:LockedOverrideMinStatus", 100)

This way, you don't have to recompile the entire source, you can just change that rule and you're gtg.

cubber
04-04-2008, 08:44 AM
You could have left it open and dropped some NPCs at all starting locations to attack anyone with a "0" status. :D That would keep people off the server, though they would not be happy about it. lol

Thats good stuff :-D

I like the rule idea. Though it is not that hard to just go in and change those values before you compile the new source. Just have to remember to do it each time. I already go in and edit all my makefiles each time, whats one more change? But again a rule setting would make things much simpler.

By changing this setting I only had to change the status values for 5 commands, rather than change the 7 or 8 pages (phpmyadmin) of commands to 200, then drop all of the ones that I want the users to have to 100. This also allows me to keep the Guide/GM levels intact in case I wish to have some users fill those positions.

One thing I did notice though, how come a status level 0 user can manipulate guilds? In the commands table guilds is set to 0 by default, I changed this to 10 to prevent them from creating guilds and editing guilds without GM intervention.