mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-19 02:05:28 +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:
@@ -273,6 +273,22 @@ namespace GameMessages {
|
||||
if (missionComponent) missionComponent->SetMissionTypeState(type, subtype, state);
|
||||
}
|
||||
|
||||
void SetMissionViewed::Serialize(RakNet::BitStream& bitStream) const {
|
||||
bitStream.Write(missionID);
|
||||
bitStream.Write(viewed);
|
||||
}
|
||||
|
||||
bool SetMissionViewed::Deserialize(RakNet::BitStream& bitStream) {
|
||||
VALIDATE_READ(bitStream.Read(missionID));
|
||||
VALIDATE_READ(bitStream.Read(viewed));
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetMissionViewed::Handle(Entity& entity, const SystemAddress& sysAddr) {
|
||||
auto* const missionComponent = entity.GetComponent<MissionComponent>();
|
||||
if (missionComponent) missionComponent->SetMissionViewed(missionID, viewed);
|
||||
}
|
||||
|
||||
void NotifyLevelRewards::Serialize(RakNet::BitStream& bitStream) const {
|
||||
bitStream.Write(level);
|
||||
bitStream.Write(sendingRewards);
|
||||
|
||||
Reference in New Issue
Block a user