Browse Source

- SpawnScripts/Generic/SpiritShard.lua shard expiration updated to assure the values are integer based
- Disabled ClearDataMsg going to AoM+ clients, not a valid opcode (100)
- HO Spell logs moved to debug, previously was error
- Prevent zone shutting down state from causing a crash when running spell process -> procs (we no longer run any spell processing during zone shutdown)

Emagi 7 months ago
parent
commit
955f90a55d

+ 5 - 5
EQ2/source/WorldServer/HeroicOp/HeroicOp.cpp

@@ -58,7 +58,7 @@ bool HeroicOP::UpdateHeroicOP(int16 icon) {
 	vector<HeroicOPStarter*> temp;
 	HeroicOPStarter* starter = 0;
 
-	LogWrite(SPELL__ERROR, 0, "HO", "Current Stage %u, wheel exists: %u, looking for icon %u", m_currentStage, m_wheel ? 1 : 0, icon);
+	LogWrite(SPELL__DEBUG, 0, "HO", "Current Stage %u, wheel exists: %u, looking for icon %u", m_currentStage, m_wheel ? 1 : 0, icon);
 	// If no wheel is set we are dealing with a starter chain still.
 	if (!m_wheel) {
 		// Loop through the starter chains
@@ -91,7 +91,7 @@ bool HeroicOP::UpdateHeroicOP(int16 icon) {
 				starter = *itr;
 				// Found one that is 0xFFFF, means the starter chain is done, get a wheel and reset the stage to 0
 				if ((starter->abilities[m_currentStage] == 0xFFFF)) {
-					LogWrite(SPELL__ERROR, 0, "HO", "Current Stage %u, starter reset (new stage 0)", m_currentStage);
+					LogWrite(SPELL__DEBUG, 0, "HO", "Current Stage %u, starter reset (new stage 0)", m_currentStage);
 					// reset the stage
 					ResetStage();
 					// geth the wheel
@@ -109,7 +109,7 @@ bool HeroicOP::UpdateHeroicOP(int16 icon) {
 
 			// Check to see if the completed start chain pointer was set
 			if (complete_starter) {
-				LogWrite(SPELL__ERROR, 0, "HO", "Current Stage %u, complete_starter set", m_currentStage);
+				LogWrite(SPELL__DEBUG, 0, "HO", "Current Stage %u, complete_starter set", m_currentStage);
 				// clear the starter list
 				starters.clear();
 				// add the completed starter back in, we do this in case we need this starter again we can just do starters.at(0), for example shifting the wheel
@@ -118,7 +118,7 @@ bool HeroicOP::UpdateHeroicOP(int16 icon) {
 		}
 	}
 	else {
-		LogWrite(SPELL__ERROR, 0, "HO", "Current Stage %u, wheel order: %u", m_currentStage, m_wheel->order);
+		LogWrite(SPELL__DEBUG, 0, "HO", "Current Stage %u, wheel order: %u", m_currentStage, m_wheel->order);
 		// Wheel was set so we need to check the order it needs to be completed in.
 		if (m_wheel->order == 0) {
 			// No order
@@ -270,7 +270,7 @@ void MasterHeroicOPList::AddWheel(int32 starter_id, HeroicOPWheel* wheel) {
 
 	// No match found give an error.
 	if (!found)
-		LogWrite(SPELL__ERROR, 0, "HO", "Attempted to add a wheel to a starter (%u) that doesn't exsist", starter_id);
+		LogWrite(SPELL__DEBUG, 0, "HO", "Attempted to add a wheel to a starter (%u) that doesn't exsist", starter_id);
 }
 
 HeroicOP* MasterHeroicOPList::GetHeroicOP(int8 class_id) {

+ 3 - 3
EQ2/source/WorldServer/SpellProcess.cpp

@@ -1818,13 +1818,13 @@ bool SpellProcess::CastProcessedSpell(LuaSpell* spell, bool passive, bool in_her
 		if (soloItr != m_soloHO.end()) {
 			ho = soloItr->second;
 			bool match = false;
-			LogWrite(SPELL__ERROR, 0, "HO", "target = %u", ho->GetTarget());
+			LogWrite(SPELL__DEBUG, 0, "HO", "target = %u", ho->GetTarget());
 			spell->MSpellTargets.readlock(__FUNCTION__, __LINE__);
 			for (int8 i = 0; i < spell->targets.size(); i++) {
-				LogWrite(SPELL__ERROR, 0, "HO", "%u", spell->targets.at(i));
+				LogWrite(SPELL__DEBUG, 0, "HO", "Target ID: %u", spell->targets.at(i));
 				if (spell->targets.at(i) == ho->GetTarget() || spell->spell->GetSpellData()->friendly_spell) {
 					match = true;
-					LogWrite(SPELL__ERROR, 0, "HO", "match found");
+					LogWrite(SPELL__DEBUG, 0, "HO", "match found");
 					break;
 				}
 			}

+ 6 - 3
EQ2/source/WorldServer/client.cpp

@@ -1638,9 +1638,12 @@ bool Client::HandlePacket(EQApplicationPacket* app) {
 	}
 	case OP_SendLatestRequestMsg: {
 		LogWrite(OPCODE__DEBUG, 1, "Opcode", "Opcode 0x%X (%i): OP_SendLatestRequestMsg", opcode, opcode);
-		uchar blah25[] = { 0x01 };
-		EQ2Packet* app25 = new EQ2Packet(OP_ClearDataMsg, blah25, sizeof(blah25));
-		QueuePacket(app25);
+		if(GetVersion() < 60085) {
+			// this does not exist in newer clients like AoM, confirmed to exist in DoF, other clients will need review at a later time
+			uchar blah25[] = { 0x01 };
+			EQ2Packet* app25 = new EQ2Packet(OP_ClearDataMsg, blah25, sizeof(blah25));
+			QueuePacket(app25);
+		}
 		break;
 	}
 	case OP_RequestRecipeDetailsMsg: {

+ 7 - 5
EQ2/source/WorldServer/zoneserver.cpp

@@ -1506,6 +1506,11 @@ bool ZoneServer::Process()
 			spawn_check_add.Trigger();
 		}
 
+		if (reloading_spellprocess){
+			MMasterZoneLock->unlock();
+			return !zoneShuttingDown;
+		}
+		
 		if(shutdownTimer.Enabled() && shutdownTimer.Check() && connected_clients.size(true) == 0) {
 			//if(lifetime_client_count)
 				zoneShuttingDown = true;
@@ -1514,11 +1519,8 @@ bool ZoneServer::Process()
 				shutdownTimer.Start(120000, true);
 				lifetime_client_count = 1;
 			}*/
-		}
-
-		if (reloading_spellprocess){
 			MMasterZoneLock->unlock();
-			return !zoneShuttingDown;
+			return false;
 		}
 
 		// client loop
@@ -7364,7 +7366,7 @@ ThreadReturnType ZoneLoop(void* tmp) {
 		else
 			Sleep(10);
 	}
-	zs->Process(); //run loop once more to clean up some functions
+	// we failed, time to disappear, no more processing period
 	safe_delete(zs);
 	THREAD_RETURN(NULL);
 }

+ 7 - 7
server/SpawnScripts/Generic/SpiritShard.lua

@@ -43,12 +43,12 @@ end
 
 function CheckShardExpired(NPC)
 	local creationStamp = GetShardCreatedTimestamp(NPC)
-	local year_ = string.sub(creationStamp, 0, 4)
-	local month_ = string.sub(creationStamp, 5, 6)
-	local day_ = string.sub(creationStamp, 7, 8)
-	local hour_ = string.sub(creationStamp, 9, 10)
-	local min_ = string.sub(creationStamp, 11, 12)
-	local sec_ = string.sub(creationStamp, 13, 14)
+	local year_ = math.floor(string.sub(creationStamp, 0, 4))
+	local month_ = math.floor(string.sub(creationStamp, 5, 6))
+	local day_ = math.floor(string.sub(creationStamp, 7, 8))
+	local hour_ = math.floor(string.sub(creationStamp, 9, 10))
+	local min_ = math.floor(string.sub(creationStamp, 11, 12))
+	local sec_ = math.floor(string.sub(creationStamp, 13, 14))
 	local currentUTCTime = os.time(os.date('!*t'))
 	local creationTime = os.time{year=year_, month=month_, day=day_, hour=hour_, min=min_,sec=sec_}
 	
@@ -60,4 +60,4 @@ function CheckShardExpired(NPC)
 		DeleteDBShardID(shardid) -- you could alternatively choose to not delete from DB, but for now it only holds XP debt recovery not items
 		Despawn(NPC)
 	end
-end
+end