mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-20 02:35: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:
@@ -130,6 +130,7 @@ json ToJson(const GameMessages::SetFlag& m);
|
||||
json ToJson(const GameMessages::NotifyClientFlagChange& m);
|
||||
json ToJson(const GameMessages::HasBeenCollected& m);
|
||||
json ToJson(const GameMessages::SetMissionTypeState& m);
|
||||
json ToJson(const GameMessages::SetMissionViewed& m);
|
||||
json ToJson(const GameMessages::NotifyLevelRewards& m);
|
||||
json ToJson(const GameMessages::Teleport& m);
|
||||
json ToJson(const GameMessages::StartPathing& m);
|
||||
@@ -1319,6 +1320,12 @@ json ToJson(const GameMessages::SetMissionTypeState& m) {
|
||||
j["type"] = ToJson(m.type);
|
||||
return j;
|
||||
}
|
||||
json ToJson(const GameMessages::SetMissionViewed& m) {
|
||||
json j = json::object();
|
||||
j["missionID"] = ToJson(m.missionID);
|
||||
j["viewed"] = ToJson(m.viewed);
|
||||
return j;
|
||||
}
|
||||
json ToJson(const GameMessages::NotifyLevelRewards& m) {
|
||||
json j = json::object();
|
||||
j["level"] = ToJson(m.level);
|
||||
@@ -2643,6 +2650,7 @@ const std::vector<Entry>& Entries() {
|
||||
{ MessageType::Game::NOTIFY_CLIENT_FLAG_CHANGE, eDirection::TO_CLIENT, "NotifyClientFlagChange", &ReadWith<GameMessages::NotifyClientFlagChange> },
|
||||
{ MessageType::Game::HAS_BEEN_COLLECTED, eDirection::TO_SERVER, "HasBeenCollected", &ReadWith<GameMessages::HasBeenCollected> },
|
||||
{ MessageType::Game::SET_MISSION_TYPE_STATE, eDirection::TO_SERVER, "SetMissionTypeState", &ReadWith<GameMessages::SetMissionTypeState> },
|
||||
{ MessageType::Game::SET_MISSION_VIEWED, eDirection::TO_SERVER, "SetMissionViewed", &ReadWith<GameMessages::SetMissionViewed> },
|
||||
{ MessageType::Game::NOTIFY_LEVEL_REWARDS, eDirection::TO_CLIENT, "NotifyLevelRewards", &ReadWith<GameMessages::NotifyLevelRewards> },
|
||||
{ MessageType::Game::TELEPORT, eDirection::TO_CLIENT, "Teleport", &ReadWith<GameMessages::Teleport> },
|
||||
{ MessageType::Game::START_PATHING, eDirection::TO_CLIENT, "StartPathing", &ReadWith<GameMessages::StartPathing> },
|
||||
|
||||
Reference in New Issue
Block a user