View Single Post
  #7  
Old 04-04-2008, 12:09 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

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 from this:
Code:
   58 RULE_CATEGORY( World )
   59 RULE_INT ( World, ZoneAutobootTimeoutMS, 60000 )
   60 RULE_INT ( World, ClientKeepaliveTimeoutMS, 65000 )
   61 RULE_CATEGORY_END()
to this:
Code:
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 from this:
Code:
  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:
Code:
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:
Code:
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.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote