61 lines
1.7 KiB
C++
61 lines
1.7 KiB
C++
#pragma once
|
|
|
|
namespace ss
|
|
{
|
|
class SS_IM_FriendAgreeRequest;
|
|
class SS_IM_FriendAgreeResponse;
|
|
class SS_IM_FriendDeleteRequest;
|
|
class SS_IM_FriendDeleteResponse;
|
|
}
|
|
|
|
class Player;
|
|
struct timer_list;
|
|
class SyncHelper : public a8::Singleton<SyncHelper>
|
|
{
|
|
public:
|
|
enum { HID = HID_SyncHelper };
|
|
|
|
private:
|
|
SyncHelper() {};
|
|
friend class a8::Singleton<SyncHelper>;
|
|
|
|
public:
|
|
void Init();
|
|
void UnInit();
|
|
|
|
void SyncNewFriend(Player* hum, const std::string& target_id);
|
|
void SyncDeleteFriend(Player* hum, const std::string& target_id, int reason);
|
|
void SyncUpdateFriend(Player* hum, const std::string& target_id);
|
|
void SyncApplyFriend(Player* hum, const std::string& target_id);
|
|
|
|
void _SS_IM_FriendAgreeResponse(f8::MsgHdr& hdr, const ss::SS_IM_FriendAgreeResponse& msg);
|
|
void _SS_IM_FriendDeleteResponse(f8::MsgHdr& hdr, const ss::SS_IM_FriendDeleteResponse& msg);
|
|
|
|
private:
|
|
|
|
void RemovePendingRequest(long long seqid);
|
|
void SS_IM_FriendAgreeRequest_TimeOut(ss::SS_IM_FriendAgreeRequest* msg);
|
|
void SS_IM_FriendDeleteRequest_TimeOut(ss::SS_IM_FriendDeleteRequest* msg);
|
|
|
|
public:
|
|
template <typename T>
|
|
void BroadcastIMConnMsg(T& msg)
|
|
{
|
|
static int msgid = f8::Net_GetMessageId(msg);
|
|
BroadcastIMConnMsg(msgid, msg);
|
|
}
|
|
|
|
void BroadcastIMConnMsg(int msgid, ::google::protobuf::Message& msg);
|
|
|
|
template <typename T>
|
|
void SendIMConnMsg(int intance_id, const T& msg)
|
|
{
|
|
static int msgid = f8::Net_GetMessageId(msg);
|
|
SendIMConnMsg(msgid, msg);
|
|
}
|
|
|
|
void SendIMConnMsg(int intance_id, int msgid, const ::google::protobuf::Message& msg);
|
|
|
|
std::map<long long, timer_list*> pending_request_hash_;
|
|
};
|