Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Support > Archive::Windows Servers

Archive::Windows Servers Archive area for Windows Servers's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 06-19-2003, 10:10 AM
Bigpull
Discordant
 
Join Date: Feb 2003
Posts: 305
Default

For the short attention span crowd, YES it is broken.

Wolfman, it's mostly hitting the same npc twice.

Current implementation in my local tree,
fixes a memleak, target errors, checks for dupes, and despawns the npc.
The big problem comes from us altering the spawn2 and not reloading it into the zones cache. Once all the npc's are gone or in thier correct position you need to #shutdown(static) or leave(dynamic) the zone, I'll look into spliting the cacheing out into a seperate function we can call from zone->Repop().
Code:
#if 0
// Corrupts zone data
// test with a #repop after a #spawnfix
	else if (strcasecmp(sep->arg[0], "#spawnfix") == 0) { 
		if (!target||!target->IsNPC()) { 
			Message(0, "Error: #spawnfix: No Target."); 
		} 
		else { 
			int32 tmp = 0; 
			char errbuf[MYSQL_ERRMSG_SIZE]; 
			char *query = 0; 
			MYSQL_RES *result; 
			MYSQL_ROW row; 
			if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT id from spawn2 where zone='%s' AND x='%f' AND y='%f' AND heading='%f'", zone->GetShortName(), target->GetX(), target->GetY(), target->GetHeading()), errbuf, &result)) { 
				if (mysql_num_rows(result) == 1) {
				    row = mysql_fetch_row(result);
				    delete[] query;
				    mysql_free_result(result);
				    tmp = atoi(row[0]);
				    if(database.RunQuery(query, MakeAnyLenString(&query, "UPDATE spawn2 SET x='%f', y='%f', z='%f', heading='%f' WHERE id='%i'",this->GetX(), this->GetY(), this->GetZ(), this->GetHeading(),tmp), errbuf, 0)){
				          Message(0, "Updating coordinates successful.");
                          delete[] query;
                          target->Depop(false);
                    }
                    else {
				          Message(0, "Update failed, UPDATE command error!");
                          delete[] query;
                          mysql_free_result(result);
                    }
				}
				else {
				    delete[] query; 
				    mysql_free_result(result);
				    Message(0, "Update failed, duplicate spawns detected!");
				}
			} 
			else { 
				delete[] query; 
				mysql_free_result(result); 
				Message(0, "Update failed, SELECT command error!"); 
			} 
		} 
	} 
#endif
Reply With Quote
 


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 04:29 AM.


 

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