Quote:
it will either load the zone custom ruleset or the default,
|
I'm only trying to load a custom ruleset, but whenever I zone into the zone, the default ruleset is loaded. When I look at the zone.cpp code block, I see that it will do exactly that, if I have have a custom ruleset specified.
Code:
if(rules->GetActiveRulesetID() != default_ruleset)
This if block executes, because my custom ruleset id is 2(and the default is apparently 1). And inside the if block, it just loads the default, and I'm not sure why, unless it is only supposed to execute when 'LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion(), true)' returns an error, like so:
Code:
//load the zone config file.
if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion(), true)) { // try loading the zone name...
LoadZoneCFG(zone->GetFileName(), zone->GetInstanceVersion()); // if that fails, try the file name, then load defaults
if(rules->GetActiveRulesetID() != default_ruleset)
{
string r_name = rules->GetRulesetName(&database, default_ruleset);
if(r_name.size() > 0)
{
rules->LoadRules(&database, r_name.c_str());
}
}
}
To see illustrate this behavior I added a line in GetRuleSetID in common/rulesys.cpp (@line ~353) as follows:
Code:
if (db->RunQuery(query, MakeAnyLenString(&query,
"SELECT ruleset_id"
" FROM rule_sets"
" WHERE name='%s'", rst), errbuf, &result))
{
if((row = mysql_fetch_row(result))) {
res = atoi(row[0]);
LogFile->write(EQEMuLog::Error, "Fred: %s: %s",query,row[0]);
}
mysql_free_result(result);
} else {
Which leads to zone output as below. You can see where it tells me it's loading my custom ruleset, then below that it 'quietly' loads the default.
Code:
[Debug] [ZONE__INIT] Loading rule set 'FreEQEMU'
[Error] Starting Log: logs/eqemu_error_zone.log
[Error] Fred: SELECT ruleset_id FROM rule_sets WHERE name='FreEQEMU': 2
[Debug] [ZONE__INIT] Loading Tasks
[Debug] [ZONE__INIT] Loading embedded perl XS
[Debug] [ZONE__INIT] Loading quests
[Quest] Starting Log: logs/eqemu_quest_zone.log
[Quest] Tying perl output to eqemu logs
[Quest] Creating EQEmuIO=HASH(0xc507c8)
[Quest] Creating EQEmuIO=HASH(0xc50c28)
[Quest] Loading perlemb plugins.
[Quest] Loading perl commands...
[Status] Booting povalor (208:0)
[Debug] [COMMON__THREADS] Starting TCPConnectionLoop with thread ID 27303552
[Debug] Graveyard ID is 5.
[Debug] Loaded a graveyard for zone povalor: graveyard zoneid is 208 x is 207.399994 y is -1615.099976 z is 77.900002 heading is 0.000000.
[Debug] The next weather check for zone: povalor will be in 14368 seconds.
[Status] Loading spawn conditions...
[Status] Loading static zone points...
[Status] Loading spawn groups...
[Status] Loading spawn2 points...
[Status] Loading player corpses...
[Status] Loading traps...
[Status] Loading adventure flavor text...
[Status] Loading ground spawns...
[Status] Loading Ground Spawns from DB...
[Status] Loading World Objects from DB...
[Status] Loading Objects from DB...
[Status] Loading doors for povalor ...
[Status] Loading Doors from database...
[Status] Loading Blocked Spells from database...
[Status] Loading AA information...
[Status] Loading AA Effects...
[Status] Loaded 284 AA Effects.
[Status] Loading Merchant Lists...
[Status] Loading Temporary Merchant Lists...
[Status] Successfully loaded Zone Config.
[Error] Fred: SELECT ruleset_id FROM rule_sets WHERE name='default': 1
[Status] Loading timezone data...