mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
Cleanup
This commit is contained in:
+1
-7
@@ -82,7 +82,7 @@
|
||||
#define ServerOP_DisbandGroup 0x003d //for disbanding a whole group cross zone
|
||||
#define ServerOP_GroupJoin 0x003e //for joining ooz folks
|
||||
#define ServerOP_UpdateSpawn 0x003f
|
||||
#define ServerOP_SpawnStatusChange 0x0040
|
||||
//#define ServerOP_SpawnStatusChange 0x0040
|
||||
#define ServerOP_DropClient 0x0041 // DropClient
|
||||
#define ServerOP_DepopAllPlayersCorpses 0x0060
|
||||
#define ServerOP_QGlobalUpdate 0x0061
|
||||
@@ -1142,12 +1142,6 @@ struct ServerInstanceUpdateTime_Struct
|
||||
uint32 new_duration;
|
||||
};
|
||||
|
||||
struct ServerSpawnStatusChange_Struct {
|
||||
uint32 id;
|
||||
bool new_status;
|
||||
uint32 instance_id;
|
||||
};
|
||||
|
||||
struct ServerQGlobalUpdate_Struct
|
||||
{
|
||||
uint32 id;
|
||||
|
||||
@@ -1404,7 +1404,6 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
case ServerOP_ReloadZonePoints:
|
||||
case ServerOP_ReloadZoneData:
|
||||
case ServerOP_RezzPlayerAccept:
|
||||
case ServerOP_SpawnStatusChange:
|
||||
case ServerOP_UpdateSpawn:
|
||||
case ServerOP_WWDialogueWindow:
|
||||
case ServerOP_WWLDoNUpdate:
|
||||
|
||||
+2
-15
@@ -360,26 +360,13 @@ Mob *QuestManager::spawn_from_spawn2(uint32 spawn2_id)
|
||||
void QuestManager::enable_spawn2(uint32 spawn2_id)
|
||||
{
|
||||
database.UpdateSpawn2Status(spawn2_id, 1, zone->GetInstanceID());
|
||||
auto pack = new ServerPacket(ServerOP_SpawnStatusChange, sizeof(ServerSpawnStatusChange_Struct));
|
||||
auto *ssc = (ServerSpawnStatusChange_Struct *) pack->pBuffer;
|
||||
ssc->id = spawn2_id;
|
||||
ssc->new_status = true;
|
||||
ssc->instance_id = zone->GetInstanceID();
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
zone->SetSpawn2Disabled(spawn2_id, false);
|
||||
}
|
||||
|
||||
void QuestManager::disable_spawn2(uint32 spawn2_id)
|
||||
{
|
||||
database.UpdateSpawn2Status(spawn2_id, 0, zone->GetInstanceID());
|
||||
auto pack = new ServerPacket(ServerOP_SpawnStatusChange, sizeof(ServerSpawnStatusChange_Struct));
|
||||
auto *ssc = (ServerSpawnStatusChange_Struct *) pack->pBuffer;
|
||||
ssc->id = spawn2_id;
|
||||
ssc->new_status = false;
|
||||
ssc->instance_id = zone->GetInstanceID();
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
zone->SetSpawn2Disabled(spawn2_id, true);
|
||||
}
|
||||
|
||||
void QuestManager::setstat(int stat, int value) {
|
||||
|
||||
@@ -1724,38 +1724,6 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
|
||||
}
|
||||
case ServerOP_SpawnStatusChange:
|
||||
{
|
||||
if (zone)
|
||||
{
|
||||
ServerSpawnStatusChange_Struct *ssc = (ServerSpawnStatusChange_Struct*)pack->pBuffer;
|
||||
if (ssc->instance_id != zone->GetInstanceID()) {
|
||||
break;
|
||||
}
|
||||
|
||||
LinkedListIterator<Spawn2 *> iterator(zone->spawn2_list);
|
||||
iterator.Reset();
|
||||
Spawn2 *found_spawn = nullptr;
|
||||
while (iterator.MoreElements()) {
|
||||
Spawn2 *cur = iterator.GetData();
|
||||
if (cur->GetID() == ssc->id) {
|
||||
found_spawn = cur;
|
||||
break;
|
||||
}
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
if (found_spawn) {
|
||||
if (ssc->new_status == 0) {
|
||||
found_spawn->Disable();
|
||||
}
|
||||
else {
|
||||
found_spawn->Enable();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_QGlobalUpdate:
|
||||
{
|
||||
if (pack->size != sizeof(ServerQGlobalUpdate_Struct))
|
||||
|
||||
@@ -3160,3 +3160,27 @@ void Zone::ReloadContentFlags()
|
||||
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
void Zone::SetSpawn2Disabled(uint32 spawn2_id, bool disabled)
|
||||
{
|
||||
LinkedListIterator<Spawn2 *> iterator(spawn2_list);
|
||||
iterator.Reset();
|
||||
Spawn2 *found_spawn = nullptr;
|
||||
while (iterator.MoreElements()) {
|
||||
Spawn2 *cur = iterator.GetData();
|
||||
if (cur->GetID() == spawn2_id) {
|
||||
found_spawn = cur;
|
||||
break;
|
||||
}
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
if (found_spawn) {
|
||||
if (disabled) {
|
||||
found_spawn->Disable();
|
||||
}
|
||||
else {
|
||||
found_spawn->Enable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,6 +398,7 @@ public:
|
||||
|
||||
void ReloadContentFlags();
|
||||
|
||||
void SetSpawn2Disabled(uint32 spawn2_id, bool disabled);
|
||||
private:
|
||||
bool allow_mercs;
|
||||
bool can_bind;
|
||||
|
||||
+2
-2
@@ -188,8 +188,8 @@ void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status, uint32 instan
|
||||
}
|
||||
|
||||
auto spawn = Spawn2DisabledRepository::NewEntity();
|
||||
spawn.spawn2_id = id;
|
||||
spawn.instance_id = instance_id;
|
||||
spawn.spawn2_id = (int32_t) id;
|
||||
spawn.instance_id = (int32_t) instance_id;
|
||||
spawn.disabled = new_status ? 0 : 1;
|
||||
Spawn2DisabledRepository::InsertOne(*this, spawn);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user