mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-04-27 17:16:31 +00:00
make it compile and cleanup
This commit is contained in:
parent
7b1d6948c3
commit
b7c579fb84
@ -99,16 +99,7 @@ void MissionComponent::AcceptMission(const uint32_t missionId, const bool skipCh
|
|||||||
mission->Accept();
|
mission->Accept();
|
||||||
|
|
||||||
this->m_Missions.insert_or_assign(missionId, mission);
|
this->m_Missions.insert_or_assign(missionId, mission);
|
||||||
|
|
||||||
if (missionId == 1728) {
|
|
||||||
//Needs to send a mail
|
|
||||||
|
|
||||||
auto address = m_Parent->GetSystemAddress();
|
|
||||||
|
|
||||||
Mail::HandleNotificationRequest(address, m_Parent->GetObjectID());
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MissionComponent::CompleteMission(const uint32_t missionId, const bool skipChecks, const bool yieldRewards) {
|
void MissionComponent::CompleteMission(const uint32_t missionId, const bool skipChecks, const bool yieldRewards) {
|
||||||
// Get the mission first
|
// Get the mission first
|
||||||
|
@ -169,7 +169,7 @@ namespace Mail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DataRequest::Handle() {
|
void DataRequest::Handle() {
|
||||||
auto playerMail = Database::Get()->GetMailForPlayer(player->GetObjectID());
|
auto playerMail = Database::Get()->GetMailForPlayer(player->GetObjectID(), 20);
|
||||||
|
|
||||||
if (playerMail.size() > 0) {
|
if (playerMail.size() > 0) {
|
||||||
DataResponse response;
|
DataResponse response;
|
||||||
@ -284,14 +284,14 @@ void Mail::HandleMail(RakNet::BitStream& inStream, const SystemAddress& sysAddr,
|
|||||||
|
|
||||||
auto it = handlers.find(data.messageID);
|
auto it = handlers.find(data.messageID);
|
||||||
if (it != handlers.end()) {
|
if (it != handlers.end()) {
|
||||||
auto mail_data = it->second(sysAddr, player);
|
auto request = it->second(sysAddr, player);
|
||||||
if (!mail_data->Deserialize(inStream)) {
|
if (!request->Deserialize(inStream)) {
|
||||||
LOG_DEBUG("Error Reading Mail Data");
|
LOG_DEBUG("Error Reading Mail Request: %s", StringifiedEnum::ToString(data.messageID).data());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mail_data->Handle();
|
request->Handle();
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("Unhandled Mail Packet with ID: %i", data.messageID);
|
LOG_DEBUG("Unhandled Mail Request with ID: %i", data.messageID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "VanityUtilities.h"
|
#include "VanityUtilities.h"
|
||||||
#include "WorldPackets.h"
|
#include "WorldPackets.h"
|
||||||
#include "ZoneInstanceManager.h"
|
#include "ZoneInstanceManager.h"
|
||||||
|
#include "Database.h"
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
#include "BuffComponent.h"
|
#include "BuffComponent.h"
|
||||||
@ -216,7 +217,7 @@ namespace GMZeroCommands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RequestMailCount(Entity* entity, const SystemAddress& sysAddr, const std::string args) {
|
void RequestMailCount(Entity* entity, const SystemAddress& sysAddr, const std::string args) {
|
||||||
Mail::HandleNotificationRequest(entity->GetSystemAddress(), entity->GetObjectID());
|
Mail::NotificationResponse(Mail::eNotificationResponse::NewMail, Database::Get()->GetUnreadMailCount(entity->GetObjectID())).Send(sysAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstanceInfo(Entity* entity, const SystemAddress& sysAddr, const std::string args) {
|
void InstanceInfo(Entity* entity, const SystemAddress& sysAddr, const std::string args) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user