PDA

View Full Version : Error with Rule_Values Table??


warlorn81
07-02-2009, 02:52 PM
I just bought and installed SOF runs perfectly for the most part.. but in the table startsofcharsdifzone -1 is for disabled or w/e i have it set to -1 and SoF chars still goto crescent reach instead of where i have races start.. any idea's on how to fix this?

Shendare
07-02-2009, 03:00 PM
During character creation, the client gives users a drop-down list of which city they would like to start out in.

I believe SoF defaults to Crescent Reach for all new characters, so the player must specifically choose an older zone to start out in to end up there.

warlorn81
07-02-2009, 03:07 PM
ok so the starting_zones table is useless for SoF Clients then correct?

Shendare
07-02-2009, 05:20 PM
Okay, according to my investigating, you are correct. The 'starting_zones' table is not used by SoF clients. The SoF client doesn't tell the server what race, class, or deity choices the player chose for the character on character creation anymore, it tells the server the exact ZoneID the player selected from the drop-down list.

http://eqemulator.net/forums/showpost.php?p=164504&postcount=174

The character creation in SoF is different in that it doesn't send the player_choice field anymore, rather it sends the actual ZoneID of the requested start zone...

So there are really only two options for SoF client users:

- Allow them to explicitly choose their own starting zone from the drop-down list on the client (which seems to default to Crescent Reach)

- Set the rule value for 'World:SoFStartZoneID' to a specific ZoneID for SoF users to start all of their characters in.

It's possible I'm off in my educated guessing here, and the Emu devs have implemented a different way of handling the new SoF ZoneID way of choosing start cities.

Shendare
07-02-2009, 10:38 PM
[insert tire screech sound effect]

UPDATE: SoF clients DO use the start_zones table.

What the server does is take the new character's race, class, and deity, as well as the ZoneID of their choice in the start zone drop-down list, and looks for a match in start_zones.

If it finds a record with the specified race, class, deity, and zone, it starts the character in the specified zone at the coords in the record.

If it doesn't find a match, it simply starts them in a default spot in Crescent Reach as a fallback.

So, you can add a record to start_zones for each race/class/deity and zoneid 394 to have different race/class/deity combinations start in different areas of Crescent Reach if the player leaves the zone selection drop-down at the default of Crescent Reach.

File: worlddb.cpp (Line 429), Rev 742

bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struc t* in_pp, CharCreate_Struct* in_cc)
{

// SoF doesn't send the player_choice field in character creation, it now sends the real zoneID instead.
//
// For SoF, search for an entry in start_zones with a matching zone_id, class, race and deity.
//
// For now, if no row matching row is found, send them to Crescent Reach, as that is probably the most likely
// reason for no match being found.
//
char errbuf[MYSQL_ERRMSG_SIZE];
char *query = 0;
MYSQL_RES *result;
MYSQL_ROW row = 0;
int rows;

if(!in_pp || !in_cc)
return false;

in_pp->x = in_pp->y = in_pp->z = in_pp->zone_id = 0;
in_pp->binds[0].x = in_pp->binds[0].y = in_pp->binds[0].z = in_pp->binds[0].zoneId = 0;

RunQuery
(
query,
MakeAnyLenString
(
&query,
"SELECT x,y,z,bind_id FROM start_zones "
"WHERE zone_id=%i AND player_class=%i "
"AND player_deity=%i AND player_race=%i",
in_cc->start_zone,
in_cc->class_,
in_cc->deity,
in_cc->race
),
errbuf,
&result
);
LogFile->write(EQEMuLog::Status, "SoF Start zone query: %s\n", query);
_log(WORLD__CLIENT_TRACE, "SoF Start zone query: %s\n", query);
safe_delete_array(query);

if((rows = mysql_num_rows(result)) > 0)
row = mysql_fetch_row(result);

if(row)
{
LogFile->write(EQEMuLog::Status, "Found starting location in start_zones");
in_pp->x = atof(row[0]);
in_pp->y = atof(row[1]);
in_pp->z = atof(row[2]);
in_pp->zone_id = in_cc->start_zone;
in_pp->binds[0].zoneId = atoi(row[4]);
}
else
{
printf("No start_zones entry in database, using defaults\n");

if(in_cc->start_zone == RuleI(World, TutorialZoneID))
in_pp->zone_id = in_cc->start_zone;
else {
in_pp->x = in_pp->binds[0].x = -51;
in_pp->y = in_pp->binds[0].y = -20;
in_pp->z = in_pp->binds[0].z = 0.79;
in_pp->zone_id = in_pp->binds[0].zoneId = 394; // Crescent Reach.
}

}

if(in_pp->x == 0 && in_pp->y == 0 && in_pp->z == 0)
database.GetSafePoints(in_pp->zone_id, &in_pp->x, &in_pp->y, &in_pp->z);

if(in_pp->binds[0].x == 0 && in_pp->binds[0].y == 0 && in_pp->binds[0].z == 0)
database.GetSafePoints(in_pp->binds[0].zoneId, &in_pp->binds[0].x, &in_pp->binds[0].y, &in_pp->binds[0].z);
if(result)
mysql_free_result(result);
return true;
}

Capheus
07-04-2009, 02:34 AM
Might want to look at this post also.....


http://www.eqemulator.net/forums/showthread.php?t=28582