mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-01-23 07:00:05 +00:00
[WIP] Incremental mission save 2
This commit (and the previous one) exist to document the first approach I took to storing mission data. It's only here for posterity. This comment was added while rebasing.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "CNShardServer.hpp"
|
||||
#include "Player.hpp"
|
||||
|
||||
#include "contrib/JSON.hpp"
|
||||
|
||||
@@ -42,14 +43,29 @@ struct QuestDropSet {
|
||||
}
|
||||
};
|
||||
|
||||
struct ItemCleanup {
|
||||
int32_t itemIds[4];
|
||||
|
||||
ItemCleanup(nlohmann::json ids) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
itemIds[i] = ids[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
namespace MissionManager {
|
||||
extern std::map<int32_t, Reward*> Rewards;
|
||||
extern std::map<int32_t, SUItem*> SUItems;
|
||||
extern std::map<int32_t, QuestDropSet*> QuestDropSets;
|
||||
extern std::map<int32_t, ItemCleanup*> ItemCleanups;
|
||||
void init();
|
||||
|
||||
void acceptMission(CNSocket* sock, CNPacketData* data);
|
||||
void completeTask(CNSocket* sock, CNPacketData* data);
|
||||
void setMission(CNSocket* sock, CNPacketData* data);
|
||||
void quitMission(CNSocket* sock, CNPacketData* data);
|
||||
|
||||
int findFreeQSlot(Player *plr);
|
||||
void dropQuestItem(CNSocket *sock, int task, int count, int id, int mobid);
|
||||
void giveMissionReward(CNSocket *sock, int task);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user