mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-28 12:22:25 +00:00
Work on spawn filtering
This commit is contained in:
parent
034c076882
commit
f97693f8e1
@ -299,6 +299,7 @@ public:
|
|||||||
const char* GetBuyerWelcomeMessage() { return BuyerWelcomeMessage.c_str(); }
|
const char* GetBuyerWelcomeMessage() { return BuyerWelcomeMessage.c_str(); }
|
||||||
|
|
||||||
void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho);
|
void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho);
|
||||||
|
bool ShouldISpawnFor(Client *c) { return !GMHideMe(c) && !IsHoveringForRespawn(); }
|
||||||
virtual bool Process();
|
virtual bool Process();
|
||||||
void LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32 price, const EQEmu::ItemData* item, bool buying);
|
void LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32 price, const EQEmu::ItemData* item, bool buying);
|
||||||
void SendPacketQueue(bool Block = true);
|
void SendPacketQueue(bool Block = true);
|
||||||
|
|||||||
@ -1246,12 +1246,9 @@ void EntityList::SendZoneSpawns(Client *client)
|
|||||||
auto it = mob_list.begin();
|
auto it = mob_list.begin();
|
||||||
while (it != mob_list.end()) {
|
while (it != mob_list.end()) {
|
||||||
Mob *ent = it->second;
|
Mob *ent = it->second;
|
||||||
if (!(ent->InZone()) || (ent->IsClient())) {
|
if (!ent->InZone() || !ent->ShouldISpawnFor(client)) {
|
||||||
if (ent->CastToClient()->GMHideMe(client) ||
|
++it;
|
||||||
ent->CastToClient()->IsHoveringForRespawn()) {
|
continue;
|
||||||
++it;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
app = new EQApplicationPacket;
|
app = new EQApplicationPacket;
|
||||||
@ -1279,17 +1276,16 @@ void EntityList::SendZoneSpawnsBulk(Client *client)
|
|||||||
for (auto it = mob_list.begin(); it != mob_list.end(); ++it) {
|
for (auto it = mob_list.begin(); it != mob_list.end(); ++it) {
|
||||||
spawn = it->second;
|
spawn = it->second;
|
||||||
if (spawn && spawn->GetID() > 0 && spawn->Spawned()) {
|
if (spawn && spawn->GetID() > 0 && spawn->Spawned()) {
|
||||||
if (spawn->IsClient() && (spawn->CastToClient()->GMHideMe(client) ||
|
if (!spawn->ShouldISpawnFor(client))
|
||||||
spawn->CastToClient()->IsHoveringForRespawn()))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
const glm::vec4& spos = spawn->GetPosition();
|
const glm::vec4& spos = spawn->GetPosition();
|
||||||
|
|
||||||
delaypkt = false;
|
delaypkt = false;
|
||||||
if (DistanceSquared(cpos, spos) > dmax || (spawn->IsClient() && (spawn->GetRace() == MINOR_ILL_OBJ || spawn->GetRace() == TREE)))
|
if (DistanceSquared(cpos, spos) > dmax || (spawn->IsClient() && (spawn->GetRace() == MINOR_ILL_OBJ || spawn->GetRace() == TREE)))
|
||||||
delaypkt = true;
|
delaypkt = true;
|
||||||
|
|
||||||
if (delaypkt) {
|
if (delaypkt) {
|
||||||
app = new EQApplicationPacket;
|
app = new EQApplicationPacket;
|
||||||
spawn->CreateSpawnPacket(app);
|
spawn->CreateSpawnPacket(app);
|
||||||
@ -2659,7 +2655,7 @@ void EntityList::SendPositionUpdates(Client *client, uint32 cLastUpdate, float u
|
|||||||
mob && !mob->IsCorpse()
|
mob && !mob->IsCorpse()
|
||||||
&& (it->second != client)
|
&& (it->second != client)
|
||||||
&& (mob->IsClient() || iSendEvenIfNotChanged || (mob->LastChange() >= cLastUpdate))
|
&& (mob->IsClient() || iSendEvenIfNotChanged || (mob->LastChange() >= cLastUpdate))
|
||||||
&& (!it->second->IsClient() || !it->second->CastToClient()->GMHideMe(client))
|
&& (it->second->ShouldISpawnFor(client))
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
update_range == 0
|
update_range == 0
|
||||||
|
|||||||
@ -549,6 +549,7 @@ public:
|
|||||||
void SendPosition();
|
void SendPosition();
|
||||||
void SetSpawned() { spawned = true; };
|
void SetSpawned() { spawned = true; };
|
||||||
bool Spawned() { return spawned; };
|
bool Spawned() { return spawned; };
|
||||||
|
virtual bool ShouldISpawnFor(Client *c) { return true; }
|
||||||
void SetFlyMode(uint8 flymode);
|
void SetFlyMode(uint8 flymode);
|
||||||
inline void Teleport(glm::vec3 NewPosition) { m_Position.x = NewPosition.x; m_Position.y = NewPosition.y;
|
inline void Teleport(glm::vec3 NewPosition) { m_Position.x = NewPosition.x; m_Position.y = NewPosition.y;
|
||||||
m_Position.z = NewPosition.z; };
|
m_Position.z = NewPosition.z; };
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user