mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-18 17:55:27 +00:00
feat(missions): keep the viewed flag of missions in progress, as the client
The client keeps a viewed flag on each mission in progress, sets it with SetMissionViewed (LWOMissionComponent::msgSetMissionViewed 0x00bec7a0, only for missions in progress) and reads it as v on the mission's <cur> entry (LWOMissionComponent::LoadFromSaveData 0x00d171c0, a number or "true", false when missing). The server now handles SetMissionViewed, saves v="1" for a viewed mission in progress and loads it back; saves without v load as not viewed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -618,6 +618,11 @@ void MissionComponent::SetMissionTypeState(const std::string& type, const std::s
|
||||
m_MissionTypeStates[type][subtype] = static_cast<eMissionLockState>(static_cast<int8_t>(state));
|
||||
}
|
||||
|
||||
void MissionComponent::SetMissionViewed(const uint32_t missionId, const bool viewed) {
|
||||
auto* const mission = GetMission(missionId);
|
||||
if (mission && !mission->IsComplete()) mission->SetViewed(viewed);
|
||||
}
|
||||
|
||||
void MissionComponent::AddCollectible(int32_t collectibleID) {
|
||||
// Check if this collectible is already in the list
|
||||
if (HasCollectible(collectibleID)) {
|
||||
|
||||
@@ -195,6 +195,10 @@ public:
|
||||
using MissionTypeStates = std::map<std::string, std::map<std::string, eMissionLockState>>;
|
||||
void SetMissionTypeState(const std::string& type, const std::string& subtype, eMissionLockState state);
|
||||
const MissionTypeStates& GetMissionTypeStates() const { return m_MissionTypeStates; }
|
||||
|
||||
// Marks a mission in progress as viewed or not (LWOMissionComponent::msgSetMissionViewed 0x00bec7a0); missions not
|
||||
// in progress are left alone, as the client
|
||||
void SetMissionViewed(uint32_t missionId, bool viewed);
|
||||
private:
|
||||
bool OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo);
|
||||
bool OnGetMissionState(GameMessages::GetMissionState& getMissionState);
|
||||
|
||||
Reference in New Issue
Block a user