achievement.h
1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once
#include <common.h>
#include <gateway_msg.pb.h>
class user_t;
struct achievement_mgr_t
{
achievement_mgr_t();
user_t* user;
std::map<uint32_t, gateway_msg::achievement_t> achievement_map;
void load_from_db(gateway_msg::achievement_t& achievement);
gateway_msg::achievement_t* find(uint32_t type_id);
void get_reward(uint32_t type_id, struct achievement_cfg_t* ac, gateway_msg::achievement_t* a);
void update(uint32_t type_id, uint32_t data);
// »ñÈ¡Íê³ÉµÄÊýÁ¿ [2018/6/26 Administrator]
uint32_t get_finish_cnt();
};
//////////////////////////////////////////////////////////////////////////
//sign config
//////////////////////////////////////////////////////////////////////////
struct achievement_cfg_t
{
uint32_t id;
std::map<ITEM_ID, ITEM_CNT> item_map;
uint32_t data;
};
struct achievement_cfg_mgr_t
{
bool load_cfg();
void init();
std::map<uint32_t, std::map<uint32_t, achievement_cfg_t>> achievement_map;
achievement_cfg_t* find(uint32_t type_id, uint32_t reward_id);
std::map<uint32_t, std::map<ITEM_ID, ITEM_CNT>> cnt_items_map;
};
extern achievement_cfg_mgr_t* g_achievement_cfg_mgr;