Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 09-29-2008, 04:26 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

I didn't actually test the instances (though they worked for me earlier) However, I can confirm all the types flag me properly and don't cause a crash anymore. Nice work!
  #2  
Old 09-30-2008, 08:26 PM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default

Yep more changes.

This is a fix for setinstflagmanually to allow manual flagging of raids, groups, and individuals. This also offers a way to delete instance flags by sending a orgZoneID of -1 and a instFlag of -1 to the function.

Please note if you have already setup quests to use the setinstflagmanually you will need to add a fourth parameter to it.

Format for quests - setinstflagmanually(charID, orginalZoneID, instFlag, type)

types
0 = individual
1 = group
2 = raid
3 = individual, group, and raid

Zone\perlparser.cpp
Find XS(XS__setinstflagmanually) replace with below code
(line is 1774 on mine but..)
Code:
XS(XS__setinstflagmanually);
XS(XS__setinstflagmanually)
{
	dXSARGS;
	if (items != 4)
		Perl_croak(aTHX_ "Usage: setinstflagmanually(charID, orginalZoneID, instFlag, type)");

	int		charID = (int)SvIV(ST(0));
	int		orgZoneID = (int)SvIV(ST(1));
	int		instFlag = (int)SvIV(ST(2));
	int		type = (int)SvIV(ST(3));

	quest_manager.setinstflagmanually(charID, orgZoneID, instFlag, type);

	XSRETURN_EMPTY;
}
zone\questmgr.cpp
Find void QuestManager::setinstflagmanually and replace with below code
(line 1420 on mine)
Code:
void QuestManager::setinstflagmanually(int charID, int orgZoneID, int instFlag, int type)
{
	if (type == 0)
	{
		database.setCharInstFlag(charID, orgZoneID, instFlag);
	}
	else if(type == 1)
	{
		database.setGroupInstFlagNum(charID, orgZoneID, instFlag);
	}
	else if(type == 2)
	{
		database.setRaidInstFlagNum(charID, orgZoneID, instFlag);
	}
	else if(type == 3)
	{
		database.setCharInstFlag(charID, orgZoneID, instFlag);
		database.setGroupInstFlagNum(charID, orgZoneID, instFlag);
		database.setRaidInstFlagNum(charID, orgZoneID, instFlag);
	}
}
zone\questmgr.h
Find void setinstflagmanually and replace with below code
(line 151 on mine)
Code:
void setinstflagmanually(int charID, int orgZoneID, int instFlag, int type);
  #3  
Old 10-16-2008, 02:47 PM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default

Some thoughts…
Code:
//Copies original zones information into a new zone entry replacing the old zoneidnumber with the instflagnum
void ZoneDatabase::LoadInstZone(int32 target_zone_ID, int32 instFlagNum){
	char errbuf[MYSQL_ERRMSG_SIZE];
    char *query = 0;
    MYSQL_RES *result;
    MYSQL_ROW row;
	int32 affected_rows = 0;
	string tmpzonename = database.GetZoneName(target_zone_ID);
	string temp;
	const char* temp2;
	stringstream tmpFlag; // used for converting int32 instFlagNum to a string

	tmpFlag << instFlagNum;
	temp = tmpFlag.str();
	temp.append(tmpzonename);
	temp2 = temp.c_str();

	if (RunQuery(query, MakeAnyLenString(&query, "INSERT INTO zone (short_name, file_name, long_name, safe_x, safe_y, safe_z, graveyard_id, min_level, min_status, zoneidnumber, timezone, maxclients, weather, note, underworld, minclip, maxclip, fog_minclip, fog_maxclip, fog_blue, fog_red, fog_green, sky, ztype, zone_exp_multiplier, walkspeed, time_type, fog_red1, fog_green1, fog_blue1, fog_minclip1, fog_maxclip1, fog_red2, fog_green2, fog_blue2, fog_minclip2, fog_maxclip2, fog_red3, fog_green3, fog_blue3, fog_minclip3, fog_maxclip3, fog_red4, fog_green4, fog_blue4, fog_minclip4, fog_maxclip4, flag_needed, canbind, cancombat, canlevitate, castoutdoor, insttype, insttimer) SELECT '%s', file_name, long_name, safe_x, safe_y, safe_z, graveyard_id, min_level, min_status, %i, timezone, maxclients, weather, note, underworld, minclip, maxclip, fog_minclip, fog_maxclip, fog_blue, fog_red, fog_green, sky, ztype, zone_exp_multiplier, walkspeed, time_type, fog_red1, fog_green1, fog_blue1, fog_minclip1, fog_maxclip1, fog_red2, fog_green2, fog_blue2, fog_minclip2, fog_maxclip2, fog_red3, fog_green3, fog_blue3, fog_minclip3, fog_maxclip3, fog_red4, fog_green4, fog_blue4, fog_minclip4, fog_maxclip4, flag_needed, canbind, cancombat, canlevitate, castoutdoor, insttype, insttimer FROM zone WHERE zoneidnumber =%i", temp2,instFlagNum,target_zone_ID), errbuf, 0, &affected_rows)){
		safe_delete_array(query);}
	else {
		cerr << "Error in LoadInstZone query '" << query << "' " << errbuf << endl;
		safe_delete_array(query);
	}
The section of code in red bothers me because every time the zone table's columns change it will need updated. Anyone have a better method for copying one zones info and inserting it back into the database changing only the zonename and zoneidnumber? We may be able to simply eliminate this copy/paste as long as the code always queries the database based on the original zone id not the instance zone id.

(The shutdowndelay column needs added, I will add it tonight or tomorrow)

Also, I am reluctant to enable inheriting of instance flags in groups and raids because it may allow players to circumvent zone limitations. For example,

Group zones into an LDoN
1 member drops out of the group but stays in the LDoN
The group then invites another character.
He/she zones into the LDoN (because he/she now has the flag)
Now 7 characters are in the zone when the content was built for 6.

To keep players from doing this we would either have to boot them from the instance when they disband or have a hidden NPC check the zone every few minutes for players without the correct instance flag.
Any thoughts?

Another side note, I may have a fix for the goto command but I need to test it.
  #4  
Old 10-16-2008, 03:07 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

tecnicly speaking on LIVE after you zoned into LDON and someone Lds, camps, crashes etc- you CANNOT invite someone else from outside- the zone should remain LOCKED until adventure expires or forfeit, even if group inside got smaller
  #5  
Old 10-17-2008, 02:10 PM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default

Fix to include shutdowndelay column in zone copy

zone\zonedb.cpp
Find ZoneDatabase::LoadInstZone(int32 target_zone_ID, int32 instFlagNum)

Replace Line 17 inside the function (line 1542 for whole file (Rev98 ))

Code:
if (RunQuery(query, MakeAnyLenString(&query, "INSERT INTO zone (short_name, file_name, long_name, safe_x, safe_y, safe_z, graveyard_id, min_level, min_status, zoneidnumber, timezone, maxclients, weather, note, underworld, minclip, maxclip, fog_minclip, fog_maxclip, fog_blue, fog_red, fog_green, sky, ztype, zone_exp_multiplier, walkspeed, time_type, fog_red1, fog_green1, fog_blue1, fog_minclip1, fog_maxclip1, fog_red2, fog_green2, fog_blue2, fog_minclip2, fog_maxclip2, fog_red3, fog_green3, fog_blue3, fog_minclip3, fog_maxclip3, fog_red4, fog_green4, fog_blue4, fog_minclip4, fog_maxclip4, flag_needed, canbind, cancombat, canlevitate, castoutdoor, insttype, insttimer) SELECT '%s', file_name, long_name, safe_x, safe_y, safe_z, graveyard_id, min_level, min_status, %i, timezone, maxclients, weather, note, underworld, minclip, maxclip, fog_minclip, fog_maxclip, fog_blue, fog_red, fog_green, sky, ztype, zone_exp_multiplier, walkspeed, time_type, fog_red1, fog_green1, fog_blue1, fog_minclip1, fog_maxclip1, fog_red2, fog_green2, fog_blue2, fog_minclip2, fog_maxclip2, fog_red3, fog_green3, fog_blue3, fog_minclip3, fog_maxclip3, fog_red4, fog_green4, fog_blue4, fog_minclip4, fog_maxclip4, flag_needed, canbind, cancombat, canlevitate, castoutdoor, insttype, insttimer FROM zone WHERE zoneidnumber =%i", temp2,instFlagNum,target_zone_ID), errbuf, 0, &affected_rows)){
With
Code:
if (RunQuery(query, MakeAnyLenString(&query, "INSERT INTO zone (short_name, file_name, long_name, safe_x, safe_y, safe_z, graveyard_id, min_level, min_status, zoneidnumber, timezone, maxclients, weather, note, underworld, minclip, maxclip, fog_minclip, fog_maxclip, fog_blue, fog_red, fog_green, sky, ztype, zone_exp_multiplier, walkspeed, time_type, fog_red1, fog_green1, fog_blue1, fog_minclip1, fog_maxclip1, fog_red2, fog_green2, fog_blue2, fog_minclip2, fog_maxclip2, fog_red3, fog_green3, fog_blue3, fog_minclip3, fog_maxclip3, fog_red4, fog_green4, fog_blue4, fog_minclip4, fog_maxclip4, flag_needed, canbind, cancombat, canlevitate, castoutdoor, insttype, insttimer, shutdowndelay) SELECT '%s', file_name, long_name, safe_x, safe_y, safe_z, graveyard_id, min_level, min_status, %i, timezone, maxclients, weather, note, underworld, minclip, maxclip, fog_minclip, fog_maxclip, fog_blue, fog_red, fog_green, sky, ztype, zone_exp_multiplier, walkspeed, time_type, fog_red1, fog_green1, fog_blue1, fog_minclip1, fog_maxclip1, fog_red2, fog_green2, fog_blue2, fog_minclip2, fog_maxclip2, fog_red3, fog_green3, fog_blue3, fog_minclip3, fog_maxclip3, fog_red4, fog_green4, fog_blue4, fog_minclip4, fog_maxclip4, flag_needed, canbind, cancombat, canlevitate, castoutdoor, insttype, insttimer, shutdowndelay FROM zone WHERE zoneidnumber =%i", temp2,instFlagNum,target_zone_ID), errbuf, 0, &affected_rows)){
Hopefully we can find a way to copy the zone info without needing to update this query everytime the zone table changes.

ChaosSlayer, I think you are right about the LDoNs. Everyone had to be in the group before the LDoN task was accepted or they could not get into the zone. Though, I think GoD and OoW instances flags could be shared via the share task button.
Closed Thread

Thread Tools
Display Modes

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 08:49 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