mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-04-26 16:46:31 +00:00
make it compile and cleanup
This commit is contained in:
parent
7b1d6948c3
commit
b7c579fb84
@ -99,17 +99,8 @@ void MissionComponent::AcceptMission(const uint32_t missionId, const bool skipCh
|
||||
mission->Accept();
|
||||
|
||||
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) {
|
||||
// Get the mission first
|
||||
auto* mission = this->GetMission(missionId);
|
||||
|
@ -169,7 +169,7 @@ namespace Mail {
|
||||
}
|
||||
|
||||
void DataRequest::Handle() {
|
||||
auto playerMail = Database::Get()->GetMailForPlayer(player->GetObjectID());
|
||||
auto playerMail = Database::Get()->GetMailForPlayer(player->GetObjectID(), 20);
|
||||
|
||||
if (playerMail.size() > 0) {
|
||||
DataResponse response;
|
||||
@ -284,14 +284,14 @@ void Mail::HandleMail(RakNet::BitStream& inStream, const SystemAddress& sysAddr,
|
||||
|
||||
auto it = handlers.find(data.messageID);
|
||||
if (it != handlers.end()) {
|
||||
auto mail_data = it->second(sysAddr, player);
|
||||
if (!mail_data->Deserialize(inStream)) {
|
||||
LOG_DEBUG("Error Reading Mail Data");
|
||||
auto request = it->second(sysAddr, player);
|
||||
if (!request->Deserialize(inStream)) {
|
||||
LOG_DEBUG("Error Reading Mail Request: %s", StringifiedEnum::ToString(data.messageID).data());
|
||||
return;
|
||||
}
|
||||
mail_data->Handle();
|
||||
request->Handle();
|
||||
} 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 "WorldPackets.h"
|
||||
#include "ZoneInstanceManager.h"
|
||||
#include "Database.h"
|
||||
|
||||
// Components
|
||||
#include "BuffComponent.h"
|
||||
@ -216,7 +217,7 @@ namespace GMZeroCommands {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user