71 lines
2.3 KiB
C++
71 lines
2.3 KiB
C++
#pragma once
|
|
|
|
namespace cs
|
|
{
|
|
class MFUserInfo;
|
|
}
|
|
|
|
class Player;
|
|
class Guild;
|
|
class DBHelper : public a8::Singleton<DBHelper>
|
|
{
|
|
private:
|
|
DBHelper() {};
|
|
friend class a8::Singleton<DBHelper>;
|
|
|
|
public:
|
|
void Init();
|
|
void UnInit();
|
|
|
|
void SetFriendApplyStatus(
|
|
unsigned int crc32_code,
|
|
const std::string& sender_id,
|
|
const std::string& target_id,
|
|
int status);
|
|
void SetFriendApplyStatus(
|
|
unsigned int crc32_code,
|
|
long long idx,
|
|
const std::string& sender_id,
|
|
const std::string& target_id,
|
|
int status);
|
|
void SetGuildApplyStatus(
|
|
const std::string& sender_id,
|
|
long long guild_id,
|
|
int status);
|
|
void SetGuildApplyStatus(
|
|
long long idx,
|
|
const std::string& sender_id,
|
|
long long guild_id,
|
|
int status);
|
|
void AddFriendApply(Player* hum, const std::string& target_id);
|
|
void AddGuildApply(Guild* guild, const cs::MFUserInfo& user_info);
|
|
void AddEvent(const std::string& sender_id,
|
|
const std::string& target_id,
|
|
const std::string& event_name,
|
|
const std::string& event_data);
|
|
void SetEventStatus(long long idx,
|
|
const std::string& target_id,
|
|
int status);
|
|
void ShuaOfflineUsers(Player* hum);
|
|
|
|
public:
|
|
std::map<std::string, cs::MFUserInfo*> cache_users_hash;
|
|
std::vector<cs::MFUserInfo*> cache_users_list;
|
|
long long shua_users_offline_times = 0;
|
|
|
|
private:
|
|
|
|
void AddCache(
|
|
const std::string& account_id,
|
|
const std::string& nickname,
|
|
const std::string& avatar_url,
|
|
int sex,
|
|
long long data_version1,
|
|
long long user_value1,
|
|
long long user_value2,
|
|
long long user_value3,
|
|
int last_logintime
|
|
);
|
|
void RemoveCache(const std::string& account_id);
|
|
};
|