80 lines
2.7 KiB
C++
80 lines
2.7 KiB
C++
#pragma once
|
|
|
|
namespace cs
|
|
{
|
|
class CMGuildCreate;
|
|
class CMGuildSearch;
|
|
class CMGuildRank;
|
|
}
|
|
|
|
namespace ss
|
|
{
|
|
class MFIMMsgConext;
|
|
class SS_IM_ForwardGuildCMMsg;
|
|
}
|
|
|
|
class Guild;
|
|
class AsyncGuildTask;
|
|
class GuildMgr : public a8::Singleton<GuildMgr>
|
|
{
|
|
public:
|
|
enum { HID = HID_GuildMgr };
|
|
|
|
private:
|
|
GuildMgr() {};
|
|
friend class a8::Singleton<GuildMgr>;
|
|
|
|
public:
|
|
void Init();
|
|
void UnInit();
|
|
|
|
template <typename T>
|
|
void ForwardGuildSMMsg(int socket_handle, const ss::MFIMMsgConext& context, T& smmsg)
|
|
{
|
|
static int msgid = f8::Net_GetMessageId(smmsg);
|
|
ForwardGuildSMMsg(socket_handle, context, msgid, smmsg);
|
|
}
|
|
void ForwardGuildSMMsg(int socket_handle,
|
|
const ss::MFIMMsgConext& context,
|
|
int msgid,
|
|
const ::google::protobuf::Message& smmsg);
|
|
void _SS_IM_ForwardGuildCMMsg(f8::MsgHdr& hdr, const ss::SS_IM_ForwardGuildCMMsg& msg);
|
|
unsigned int GetGuildCrc32(long long guild_id);
|
|
|
|
private:
|
|
void _CMGuildCreate(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildCreate& msg);
|
|
void _CMGuildSearch(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildSearch& msg);
|
|
void _CMGuildRank(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildRank& msg);
|
|
|
|
void CreateAsyncTask(int socket_handle, long long guild_id, AsyncGuildTask* task);
|
|
void LoadGuild(long long guild_id);
|
|
bool IsValidGuildId(long long guild_id);
|
|
Guild* GetGuild(long long guild_id);
|
|
void CreateGuild(int gameid,
|
|
long long guild_id,
|
|
const std::string& guild_name,
|
|
int guild_lv,
|
|
int guild_exp,
|
|
int guild_badge,
|
|
int guild_apply_num,
|
|
const std::string& guild_members,
|
|
const std::string& guild_notice,
|
|
const std::string& guild_declaration,
|
|
const std::string& guild_log,
|
|
const std::string& owner_id,
|
|
const std::string& owner_name,
|
|
const std::string& owner_avatar_url,
|
|
const std::string& creator_id,
|
|
const std::string& creator_name,
|
|
const std::string& creator_avatar_url,
|
|
const std::string& guild_data,
|
|
int guild_status,
|
|
int createtime
|
|
);
|
|
|
|
private:
|
|
std::map<long long, Guild*> id_hash_;
|
|
std::set<long long> pending_guild_hash_;
|
|
std::map<long long, std::list<AsyncGuildTask*>> task_hash_;
|
|
};
|