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

Reply
 
Thread Tools Display Modes
  #1  
Old 02-09-2013, 10:02 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,165
Default Filters

I decided to figure out why Auction also filtered out OOC, it was a copy and paste error, I also decided to change the FILTER_* defines and delete them to not cause confusion

Code:
Index: EQEmuServer/common/eq_constants.h
===================================================================
--- EQEmuServer/common/eq_constants.h	(revision 2492)
+++ EQEmuServer/common/eq_constants.h	(working copy)
@@ -425,30 +425,6 @@
 	FilterShowSelfOnly
 } eqFilterMode;
 
-//im lazy today, dont wanna find/replace these
-#define FILTER_DAMAGESHIELD FilterDamageShields
-#define FILTER_NPCSPELLS	FilterNPCSpells
-#define FILTER_PCSPELLS		FilterPCSpells
-#define FILTER_BARDSONGS	FilterBardSongs
-#define FILTER_GUILDSAY		FilterGuildChat
-#define FILTER_SOCIALS		FilterSocials
-#define FILTER_GROUP		FilterGroupChat
-#define FILTER_SHOUT		FilterShouts
-#define FILTER_AUCTION		FilterAuctions
-#define FILTER_OOC			FilterAuctions
-#define FILTER_MYMISSES		FilterMyMisses
-#define FILTER_OTHERMISSES	FilterOthersMiss
-#define FILTER_OTHERHITS	FilterOthersHit
-#define FILTER_ATKMISSESME	FilterMissedMe
-#define FILTER_CRITSPELLS	FilterSpellCrits
-#define FILTER_CRITMELEE	FilterMeleeCrits
-#define FILTER_SPELLDAMAGE	FilterSpellDamage
-#define FILTER_DOTDAMAGE	FilterDOT
-#define FILTER_MYPETHITS	FilterPetHits
-#define FILTER_MYPETMISSES	FilterPetMisses
-
-
-
 #define	STAT_STR		0
 #define	STAT_STA		1
 #define	STAT_AGI		2
Index: EQEmuServer/zone/attack.cpp
===================================================================
--- EQEmuServer/zone/attack.cpp	(revision 2492)
+++ EQEmuServer/zone/attack.cpp	(working copy)
@@ -3318,7 +3318,7 @@
 			int32 origdmg = damage;
 			damage = AffectMagicalDamage(damage, spell_id, iBuffTic, attacker);
 			if (origdmg != damage && attacker && attacker->IsClient()) {
-				if(attacker->CastToClient()->GetFilter(FILTER_DAMAGESHIELD) != FilterHide)
+				if(attacker->CastToClient()->GetFilter(FilterDamageShields) != FilterHide)
 					attacker->Message(15, "The Spellshield absorbed %d of %d points of damage", origdmg - damage, origdmg);
 			}
 			if (damage == 0  && attacker && origdmg != damage && IsClient()) {
@@ -3505,11 +3505,11 @@
 						if(spell_id != SPELL_UNKNOWN)
 							filter = iBuffTic ? FilterDOT : FilterSpellDamage;
 						else
-							filter = FILTER_MYPETHITS;
+							filter = FilterPetHits;
 					} else if(damage == -5)
 						filter = FilterNone;	//cant filter invulnerable
 					else
-						filter = FILTER_MYPETMISSES;
+						filter = FilterPetMisses;
 
 					if(!FromDamageShield)
 						owner->CastToClient()->QueuePacket(outapp,true,CLIENT_CONNECTED,filter);
@@ -3542,7 +3542,7 @@
 					} else if(damage == -5)
 						filter = FilterNone;	//cant filter invulnerable
 					else
-						filter = FILTER_MYMISSES;
+						filter = FilterMyMisses;
 
 					attacker->CastToClient()->QueuePacket(outapp, true, CLIENT_CONNECTED, filter);
 				}
@@ -3555,11 +3555,11 @@
 			if(spell_id != SPELL_UNKNOWN)
 				filter = iBuffTic ? FilterDOT : FilterSpellDamage;
 			else
-				filter = FILTER_OTHERHITS;
+				filter = FilterOthersHit;
 		} else if(damage == -5)
 			filter = FilterNone;	//cant filter invulnerable
 		else
-			filter = FILTER_OTHERMISSES;
+			filter = FilterOthersMiss;
 		//make attacker (the attacker) send the packet so we can skip them and the owner
 		//this call will send the packet to `this` as well (using the wrong filter) (will not happen until PC charm works)
 //LogFile->write(EQEMuLog::Debug, "Queue damage to all except %s with filter %d (%d), type %d", skip->GetName(), filter, IsClient()?CastToClient()->GetFilter(filter):-1, a->type);
Index: EQEmuServer/zone/client.cpp
===================================================================
--- EQEmuServer/zone/client.cpp	(revision 2492)
+++ EQEmuServer/zone/client.cpp	(working copy)
@@ -1100,7 +1100,7 @@
 		char *Buffer = (char *)es;
 		Buffer += 4;
 		snprintf(Buffer, sizeof(Emote_Struct) - 4, "%s %s", GetName(), message);
-		entity_list.QueueCloseClients(this, outapp, true, 100,0,true,FILTER_SOCIALS);
+		entity_list.QueueCloseClients(this, outapp, true, 100,0,true,FilterSocials);
 		safe_delete(outapp);
 
 		break;
Index: EQEmuServer/zone/client_packet.cpp
===================================================================
--- EQEmuServer/zone/client_packet.cpp	(revision 2492)
+++ EQEmuServer/zone/client_packet.cpp	(working copy)
@@ -7442,7 +7442,7 @@
 	}
 	else
 	*/
-	entity_list.QueueCloseClients(this, outapp, true, 100,0,true,FILTER_SOCIALS);
+	entity_list.QueueCloseClients(this, outapp, true, 100,0,true,FilterSocials);
 
 	safe_delete(outapp);
 	return;
Index: EQEmuServer/zone/entity.cpp
===================================================================
--- EQEmuServer/zone/entity.cpp	(revision 2492)
+++ EQEmuServer/zone/entity.cpp	(working copy)
@@ -1303,9 +1303,9 @@
 		Client* client = iterator.GetData();
 		eqFilterType filter = FilterNone;
 		if(chan_num==3)//shout
-			filter=FILTER_SHOUT;
+			filter=FilterShouts;
 		else if(chan_num==4) //auction
-			filter=FILTER_AUCTION;
+			filter=FilterAuctions;
 		
 		if (chan_num != 8 || client->Dist(*from) < 200) // Only say is limited in range
 		{
@@ -2258,10 +2258,10 @@
 				continue;
 			if(!guild_mgr.CheckPermission(guild_id, client->GuildRank(), GUILD_HEAR))
 				continue;
-			if(client->GetFilter(FILTER_GUILDSAY) == FilterHide)
+			if(client->GetFilter(FilterGuildChat) == FilterHide)
 				continue;
 		} else if(chan_num == 5) {
-			if(client->GetFilter(FILTER_OOC) == FilterHide)
+			if(client->GetFilter(FilterOOC) == FilterHide)
 				continue;
 		}
 		client->ChannelMessageSend(from, to, chan_num, language, message);
Index: EQEmuServer/zone/groups.cpp
===================================================================
--- EQEmuServer/zone/groups.cpp	(revision 2492)
+++ EQEmuServer/zone/groups.cpp	(working copy)
@@ -752,7 +752,7 @@
 		if(!members[i])
 			continue;
 
-		if (members[i]->IsClient() && members[i]->CastToClient()->GetFilter(FILTER_GROUP)!=0)
+		if (members[i]->IsClient() && members[i]->CastToClient()->GetFilter(FilterGroupChat)!=0)
 			members[i]->CastToClient()->ChannelMessageSend(sender->GetName(),members[i]->GetName(),2,language,lang_skill,message);
 	}
 
Index: EQEmuServer/zone/spells.cpp
===================================================================
--- EQEmuServer/zone/spells.cpp	(revision 2492)
+++ EQEmuServer/zone/spells.cpp	(working copy)
@@ -776,7 +776,7 @@
 	ic->messageid = message_other;
 	ic->spawnid = GetID();
 	strcpy(ic->message, GetCleanName());
-	entity_list.QueueCloseClients(this, outapp, true, 200, 0, true, IsClient() ? FILTER_PCSPELLS : FILTER_NPCSPELLS);
+	entity_list.QueueCloseClients(this, outapp, true, 200, 0, true, IsClient() ? FilterPCSpells : FilterNPCSpells);
 	safe_delete(outapp);
 
 }
@@ -1952,7 +1952,7 @@
 		}
 	}
 
-	DoAnim(spells[spell_id].CastingAnim, 0, true, IsClient() ? FILTER_PCSPELLS : FILTER_NPCSPELLS);
+	DoAnim(spells[spell_id].CastingAnim, 0, true, IsClient() ? FilterPCSpells : FilterNPCSpells);
 	
 	// Set and send the nimbus effect if this spell has one
 	int NimbusEffect = GetNimbusEffect(spell_id);
@@ -2171,7 +2171,7 @@
 	}
 	
 	//do we need to do this???
-	DoAnim(spells[spell_id].CastingAnim, 0, true, IsClient() ? FILTER_PCSPELLS : FILTER_NPCSPELLS);
+	DoAnim(spells[spell_id].CastingAnim, 0, true, IsClient() ? FilterPCSpells : FilterNPCSpells);
 	if(IsClient())
 		CastToClient()->CheckSongSkillIncrease(spell_id);
 
@@ -2209,7 +2209,7 @@
 			action->buff_unknown = 0;
 			action->level = buffs[buffs_i].casterlevel;
 			action->type = SpellDamageType;
-			entity_list.QueueCloseClients(this, packet, false, 200, 0, true, IsClient() ? FILTER_PCSPELLS : FILTER_NPCSPELLS);
+			entity_list.QueueCloseClients(this, packet, false, 200, 0, true, IsClient() ? FilterPCSpells : FilterNPCSpells);
 			
 			action->buff_unknown = 4;
 
@@ -2280,7 +2280,7 @@
 			cd->damage = 0;
 			if(!IsEffectInSpell(spell_id, SE_BindAffinity))
 			{
-				entity_list.QueueCloseClients(this, message_packet, false, 200, 0, true, IsClient() ? FILTER_PCSPELLS : FILTER_NPCSPELLS);
+				entity_list.QueueCloseClients(this, message_packet, false, 200, 0, true, IsClient() ? FilterPCSpells : FilterNPCSpells);
 			}
 			safe_delete(message_packet);
 			safe_delete(packet);
@@ -3010,7 +3010,7 @@
 	if(IsClient())	// send to caster
 		CastToClient()->QueuePacket(action_packet);
 	// send to people in the area, ignoring caster and target
-	entity_list.QueueCloseClients(spelltar, action_packet, true, 200, this, true, spelltar->IsClient() ? FILTER_PCSPELLS : FILTER_NPCSPELLS);
+	entity_list.QueueCloseClients(spelltar, action_packet, true, 200, this, true, spelltar->IsClient() ? FilterPCSpells : FilterNPCSpells);
 
 
        /* Send the EVENT_CAST_ON event */
@@ -3521,7 +3521,7 @@
 	cd->damage = 0;
 	if(!IsEffectInSpell(spell_id, SE_BindAffinity))
 	{
-		entity_list.QueueCloseClients(spelltar, message_packet, false, 200, 0, true, spelltar->IsClient() ? FILTER_PCSPELLS : FILTER_NPCSPELLS);
+		entity_list.QueueCloseClients(spelltar, message_packet, false, 200, 0, true, spelltar->IsClient() ? FilterPCSpells : FilterNPCSpells);
 	}
 	safe_delete(action_packet);
 	safe_delete(message_packet);
Index: EQEmuServer/zone/worldserver.cpp
===================================================================
--- EQEmuServer/zone/worldserver.cpp	(revision 2492)
+++ EQEmuServer/zone/worldserver.cpp	(working copy)
@@ -1344,7 +1344,7 @@
 							if(strcmp(rmsg->from, r->members[x].member->GetName()) != 0)
 							{
 								if(r->members[x].GroupNumber == rmsg->gid){
-									if(r->members[x].member->GetFilter(FILTER_GROUP)!=0)
+									if(r->members[x].member->GetFilter(FilterGroupChat)!=0)
 									{
 										r->members[x].member->ChannelMessageSend(rmsg->from, r->members[x].member->GetName(), 2, 0, rmsg->message);
 									}
@@ -1369,7 +1369,7 @@
 						if(r->members[x].member){
 							if(strcmp(rmsg->from, r->members[x].member->GetName()) != 0)
 							{
-								if(r->members[x].member->GetFilter(FILTER_GROUP)!=0)
+								if(r->members[x].member->GetFilter(FilterGroupChat)!=0)
 								{
 									r->members[x].member->ChannelMessageSend(rmsg->from, r->members[x].member->GetName(), 15, 0, rmsg->message);
 								}
Reply With Quote
Reply


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 02:35 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3