mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-07 15:32:25 +00:00
Added opcode support for aaaction, aaexpupdate, zonecompleted.
This commit is contained in:
parent
483ca9996b
commit
c09ab507dd
@ -386,6 +386,26 @@ message SpawnEvent {
|
||||
bool show_name= 100;
|
||||
}
|
||||
|
||||
message AlternateAdvancementStatsEvent {
|
||||
uint32 experience = 1;
|
||||
uint32 unspent = 2;
|
||||
uint32 unknown006 = 3;
|
||||
uint32 percentage = 4;
|
||||
uint32 unknown009 = 5;
|
||||
}
|
||||
|
||||
message ZoneCompleteEvent {
|
||||
|
||||
}
|
||||
|
||||
message UseAAEvent {
|
||||
uint32 begin = 1;
|
||||
uint32 ability = 2;
|
||||
uint32 end = 3;
|
||||
uint32 action = 4;
|
||||
uint32 target_id = 5;
|
||||
uint32 exp_value = 6;
|
||||
}
|
||||
|
||||
//EntityType will attempt to identify an entity to it's upper-most type by default
|
||||
enum EntityType {
|
||||
@ -606,11 +626,11 @@ enum GenderType {
|
||||
enum OpCode {
|
||||
//option allow_alias = true;
|
||||
OP_Unknown = 0;
|
||||
OP_ExploreUnknown = 1;
|
||||
OP_0x0193 = 2;
|
||||
OP_0x0347 = 3;
|
||||
OP_AAAction = 4;
|
||||
OP_AAExpUpdate = 5;
|
||||
OP_ExploreUnknown = 1; //Not used
|
||||
OP_0x0193 = 2; //Not used
|
||||
OP_ZoneCompleted = 3; //supported, internally OP_0x0347
|
||||
OP_AAAction = 4; //supported
|
||||
OP_AAExpUpdate = 5; //supported
|
||||
OP_AcceptNewTask = 6;
|
||||
OP_AckPacket = 7;
|
||||
OP_Action = 8;
|
||||
|
||||
@ -27,6 +27,7 @@ Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
#include "client.h"
|
||||
#include "corpse.h"
|
||||
#include "groups.h"
|
||||
#include "nats_manager.h"
|
||||
#include "mob.h"
|
||||
#include "queryserv.h"
|
||||
#include "raids.h"
|
||||
@ -35,6 +36,7 @@ Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
#include "zonedb.h"
|
||||
|
||||
extern QueryServ* QServ;
|
||||
extern NatsManager nats;
|
||||
|
||||
void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, uint32 duration_override, bool followme, bool sticktarg) {
|
||||
|
||||
@ -922,6 +924,7 @@ void Client::SendAlternateAdvancementStats() {
|
||||
aps->percentage = m_epp.perAA;
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
nats.OnAlternateAdvancementStats(GetID(), aps);
|
||||
}
|
||||
|
||||
void Client::SendAlternateAdvancementPoints() {
|
||||
@ -957,6 +960,7 @@ void Client::SendAlternateAdvancementTimer(int ability, int begin, int end) {
|
||||
uaaout->end = end;
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
nats.OnAlternateAdvancementAction(GetID(), uaaout);
|
||||
}
|
||||
|
||||
//sends all AA timers.
|
||||
@ -976,6 +980,7 @@ void Client::SendAlternateAdvancementTimers() {
|
||||
uaaout->begin = cur->GetStartTime();
|
||||
uaaout->end = static_cast<uint32>(time(nullptr));
|
||||
uaaout->ability = cur->GetType() - pTimerAAStart; // uuaaout->ability is really a shared timer number
|
||||
nats.OnAlternateAdvancementAction(GetID(), uaaout);
|
||||
QueuePacket(outapp);
|
||||
}
|
||||
|
||||
@ -1008,6 +1013,8 @@ void Client::ResetAlternateAdvancementTimers() {
|
||||
uaaout->ability = cur->GetType() - pTimerAAStart;
|
||||
r_timers.push_back(cur->GetType());
|
||||
QueuePacket(outapp);
|
||||
|
||||
nats.OnAlternateAdvancementAction(GetID(), uaaout);
|
||||
}
|
||||
|
||||
for(auto &i : r_timers) {
|
||||
|
||||
@ -1226,6 +1226,7 @@ void Client::Handle_Connect_OP_ZoneComplete(const EQApplicationPacket *app)
|
||||
auto outapp = new EQApplicationPacket(OP_0x0347, 0);
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
nats.OnZoneComplete(GetID());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1799,6 +1800,8 @@ void Client::Handle_OP_AAAction(const EQApplicationPacket *app)
|
||||
}
|
||||
AA_Action* action = (AA_Action*)app->pBuffer;
|
||||
|
||||
nats.OnAlternateAdvancementActionRequest(GetID(), action);
|
||||
|
||||
if (action->action == aaActionActivate) {//AA Hotkey
|
||||
Log(Logs::Detail, Logs::AA, "Activating AA %d", action->ability);
|
||||
ActivateAlternateAdvancementAbility(action->ability, action->target_id);
|
||||
|
||||
@ -1275,4 +1275,99 @@ void NatsManager::OnAnimationEvent(uint32 entity_id, Animation_Struct *anim) {
|
||||
return;
|
||||
}
|
||||
SendEvent(op, entity_id, event_buffer, event_size);
|
||||
}
|
||||
|
||||
|
||||
void NatsManager::OnAlternateAdvancementStats(uint32 entity_id, AltAdvStats_Struct * aas) {
|
||||
if (!connect())
|
||||
return;
|
||||
if (entity_id == 0)
|
||||
return;
|
||||
if (!isEntityEventAllEnabled && !isEntitySubscribed(entity_id))
|
||||
return;
|
||||
|
||||
auto op = eqproto::OP_AAExpUpdate;
|
||||
|
||||
eqproto::AlternateAdvancementStatsEvent* event = google::protobuf::Arena::CreateMessage<eqproto::AlternateAdvancementStatsEvent>(&the_arena);
|
||||
event->set_experience(aas->experience);
|
||||
event->set_unspent(aas->unspent);
|
||||
event->set_unknown006(aas->unknown006);
|
||||
//event->set_unknown009(aas->unknown009);
|
||||
|
||||
size_t event_size = event->ByteSizeLong();
|
||||
void *event_buffer = malloc(event_size);
|
||||
if (!event->SerializeToArray(event_buffer, event_size)) {
|
||||
Log(Logs::General, Logs::NATS, "zone.%s.%d.entity.%d.event.out: (OP: %d) failed to serialize message", subscribedZoneName.c_str(), subscribedZoneInstance, entity_id, op);
|
||||
return;
|
||||
}
|
||||
SendEvent(op, entity_id, event_buffer, event_size);
|
||||
}
|
||||
|
||||
|
||||
void NatsManager::OnZoneComplete(uint32 entity_id) {
|
||||
if (!connect())
|
||||
return;
|
||||
if (entity_id == 0)
|
||||
return;
|
||||
if (!isEntityEventAllEnabled && !isEntitySubscribed(entity_id))
|
||||
return;
|
||||
|
||||
auto op = eqproto::OP_ZoneCompleted;
|
||||
|
||||
eqproto::ZoneCompleteEvent* event = google::protobuf::Arena::CreateMessage<eqproto::ZoneCompleteEvent>(&the_arena);
|
||||
|
||||
size_t event_size = event->ByteSizeLong();
|
||||
void *event_buffer = malloc(event_size);
|
||||
if (!event->SerializeToArray(event_buffer, event_size)) {
|
||||
Log(Logs::General, Logs::NATS, "zone.%s.%d.entity.%d.event.out: (OP: %d) failed to serialize message", subscribedZoneName.c_str(), subscribedZoneInstance, entity_id, op);
|
||||
return;
|
||||
}
|
||||
SendEvent(op, entity_id, event_buffer, event_size);
|
||||
}
|
||||
|
||||
void NatsManager::OnAlternateAdvancementAction(uint32 entity_id, UseAA_Struct * uaas) {
|
||||
if (!connect())
|
||||
return;
|
||||
if (entity_id == 0)
|
||||
return;
|
||||
if (!isEntityEventAllEnabled && !isEntitySubscribed(entity_id))
|
||||
return;
|
||||
|
||||
auto op = eqproto::OP_AAAction;
|
||||
|
||||
eqproto::UseAAEvent* event = google::protobuf::Arena::CreateMessage<eqproto::UseAAEvent>(&the_arena);
|
||||
event->set_begin(uaas->begin);
|
||||
event->set_ability(uaas->ability);
|
||||
event->set_end(uaas->end);
|
||||
size_t event_size = event->ByteSizeLong();
|
||||
void *event_buffer = malloc(event_size);
|
||||
if (!event->SerializeToArray(event_buffer, event_size)) {
|
||||
Log(Logs::General, Logs::NATS, "zone.%s.%d.entity.%d.event.out: (OP: %d) failed to serialize message", subscribedZoneName.c_str(), subscribedZoneInstance, entity_id, op);
|
||||
return;
|
||||
}
|
||||
SendEvent(op, entity_id, event_buffer, event_size);
|
||||
}
|
||||
|
||||
void NatsManager::OnAlternateAdvancementActionRequest(uint32 entity_id, AA_Action* action) {
|
||||
if (!connect())
|
||||
return;
|
||||
if (entity_id == 0)
|
||||
return;
|
||||
if (!isEntityEventAllEnabled && !isEntitySubscribed(entity_id))
|
||||
return;
|
||||
|
||||
auto op = eqproto::OP_AAAction;
|
||||
|
||||
eqproto::UseAAEvent* event = google::protobuf::Arena::CreateMessage<eqproto::UseAAEvent>(&the_arena);
|
||||
event->set_ability(action->ability);
|
||||
event->set_target_id(action->target_id);
|
||||
event->set_exp_value(action->exp_value);
|
||||
event->set_action(action->action);
|
||||
size_t event_size = event->ByteSizeLong();
|
||||
void *event_buffer = malloc(event_size);
|
||||
if (!event->SerializeToArray(event_buffer, event_size)) {
|
||||
Log(Logs::General, Logs::NATS, "zone.%s.%d.entity.%d.event.out: (OP: %d) failed to serialize message", subscribedZoneName.c_str(), subscribedZoneInstance, entity_id, op);
|
||||
return;
|
||||
}
|
||||
SendEvent(op, entity_id, event_buffer, event_size);
|
||||
}
|
||||
@ -31,18 +31,21 @@ public:
|
||||
void SendAdminMessage(std::string adminMessage);
|
||||
void SendEvent(eqproto::OpCode op, uint32 entity_id, void * buffer, size_t size);
|
||||
|
||||
void OnChannelMessageEvent(uint32 entity_id, ChannelMessage_Struct * cm);
|
||||
void OnSpecialMessageEvent(uint32 entity_id, SpecialMesg_Struct *sm);
|
||||
void OnEntityEvent(const EmuOpcode op, uint32 entity_id, uint32 target_id);
|
||||
void OnSpawnEvent(const EmuOpcode op, uint32 entity_id, Spawn_Struct * spawn);
|
||||
void OnWearChangeEvent(uint32 entity_id, WearChange_Struct * wc);
|
||||
void OnDeleteSpawnEvent(uint32 entity_id, DeleteSpawn_Struct * ds);
|
||||
void OnHPEvent(const EmuOpcode op, uint32 entity_id, uint32 cur_hp, uint32 max_hp);
|
||||
void OnDamageEvent(uint32 entity_id, CombatDamage_Struct * cd);
|
||||
void OnClientUpdateEvent(uint32 entity_id, PlayerPositionUpdateServer_Struct * spu);
|
||||
void OnAlternateAdvancementStats(uint32 entity_id, AltAdvStats_Struct * aas);
|
||||
void OnAlternateAdvancementAction(uint32 entity_id, UseAA_Struct * uaas);
|
||||
void OnAlternateAdvancementActionRequest(uint32 entity_id, AA_Action* action);
|
||||
void OnAnimationEvent(uint32 entity_id, Animation_Struct * anim);
|
||||
void OnChannelMessageEvent(uint32 entity_id, ChannelMessage_Struct * cm);
|
||||
void OnClientUpdateEvent(uint32 entity_id, PlayerPositionUpdateServer_Struct * spu);
|
||||
void OnDamageEvent(uint32 entity_id, CombatDamage_Struct * cd);
|
||||
void OnDeathEvent(Death_Struct * d);
|
||||
|
||||
void OnDeleteSpawnEvent(uint32 entity_id, DeleteSpawn_Struct * ds);
|
||||
void OnEntityEvent(const EmuOpcode op, uint32 entity_id, uint32 target_id);
|
||||
void OnHPEvent(const EmuOpcode op, uint32 entity_id, uint32 cur_hp, uint32 max_hp);
|
||||
void OnSpawnEvent(const EmuOpcode op, uint32 entity_id, Spawn_Struct * spawn);
|
||||
void OnSpecialMessageEvent(uint32 entity_id, SpecialMesg_Struct *sm);
|
||||
void OnWearChangeEvent(uint32 entity_id, WearChange_Struct * wc);
|
||||
void OnZoneComplete(uint32 entity_id);
|
||||
|
||||
protected:
|
||||
bool connect();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user