#ifndef __INC_CLIENTMANAGER_H__ #define __INC_CLIENTMANAGER_H__ #include #include #include #include #include #include #include #include "Peer.h" #include "DBManager.h" #include "LoginData.h" class CPlayerTableCache; class CItemCache; class CItemPriceListTableCache; class CPacketInfo { public: void Add(int header); void Reset(); std::map m_map_info; }; size_t CreatePlayerSaveQuery(char * pszQuery, size_t querySize, TPlayerTable * pkTab); static void AcceptConnection(evconnlistener *listener, evutil_socket_t fd, sockaddr *address, int socklen, void *ctx); static void AcceptError(evconnlistener *listener, void *ctx); static void ReadHandler(bufferevent *bev, void *ctx); static void WriteHandler(bufferevent *bev, void *ctx); static void EventHandler(bufferevent *bev, short events, void *ctx); class CClientManager : public singleton { public: typedef std::list TPeerList; typedef std::unordered_map TPlayerTableCacheMap; typedef std::unordered_map TItemCacheMap; typedef std::unordered_set > TItemCacheSet; typedef std::unordered_map TItemCacheSetPtrMap; typedef std::unordered_map TItemPriceListCacheMap; typedef std::unordered_map TChannelStatusMap; // MYSHOP_PRICE_LIST /// ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ ¸®½ºÆ® ¿äû Á¤º¸ /** * first: Peer handle * second: ¿äûÇÑ Ç÷¹À̾îÀÇ ID */ typedef std::pair< DWORD, DWORD > TItemPricelistReqInfo; // END_OF_MYSHOP_PRICE_LIST class ClientHandleInfo { public: DWORD dwHandle; DWORD account_id; DWORD player_id; BYTE account_index; char login[LOGIN_MAX_LEN + 1]; char safebox_password[SAFEBOX_PASSWORD_MAX_LEN + 1]; char ip[MAX_HOST_LENGTH + 1]; TAccountTable * pAccountTable; TSafeboxTable * pSafebox; ClientHandleInfo(DWORD argHandle, DWORD dwPID = 0) { dwHandle = argHandle; pSafebox = NULL; pAccountTable = NULL; player_id = dwPID; }; //µ¶Àϼ±¹°±â´É¿ë »ý¼ºÀÚ ClientHandleInfo(DWORD argHandle, DWORD dwPID, DWORD accountId) { dwHandle = argHandle; pSafebox = NULL; pAccountTable = NULL; player_id = dwPID; account_id = accountId; }; ~ClientHandleInfo() { if (pSafebox) { delete pSafebox; pSafebox = NULL; } } }; public: CClientManager(); ~CClientManager(); bool Initialize(); time_t GetCurrentTime(); void MainLoop(); void Quit(); void SetTablePostfix(const char* c_pszTablePostfix); void SetPlayerIDStart(int iIDStart); int GetPlayerIDStart() { return m_iPlayerIDStart; } int GetPlayerDeleteLevelLimit() { return m_iPlayerDeleteLevelLimit; } void SetChinaEventServer(bool flag) { m_bChinaEventServer = flag; } bool IsChinaEventServer() { return m_bChinaEventServer; } DWORD GetUserCount(); // Á¢¼ÓµÈ »ç¿ëÀÚ ¼ö¸¦ ¸®ÅÏ ÇÑ´Ù. void SendAllGuildSkillRechargePacket(); void SendTime(); CPlayerTableCache * GetPlayerCache(DWORD id); void PutPlayerCache(TPlayerTable * pNew); void CreateItemCacheSet(DWORD dwID); TItemCacheSet * GetItemCacheSet(DWORD dwID); void FlushItemCacheSet(DWORD dwID); CItemCache * GetItemCache(DWORD id); void PutItemCache(TPlayerItem * pNew, bool bSkipQuery = false); bool DeleteItemCache(DWORD id); void UpdatePlayerCache(); void UpdateItemCache(); // MYSHOP_PRICE_LIST /// °¡°ÝÁ¤º¸ ¸®½ºÆ® ij½Ã¸¦ °¡Á®¿Â´Ù. /** * @param [in] dwID °¡°ÝÁ¤º¸ ¸®½ºÆ®ÀÇ ¼ÒÀ¯ÀÚ.(Ç÷¹À̾î ID) * @return °¡°ÝÁ¤º¸ ¸®½ºÆ® ij½ÃÀÇ Æ÷ÀÎÅÍ */ CItemPriceListTableCache* GetItemPriceListCache(DWORD dwID); /// °¡°ÝÁ¤º¸ ¸®½ºÆ® ij½Ã¸¦ ³Ö´Â´Ù. /** * @param [in] pItemPriceList ij½Ã¿¡ ³ÖÀ» ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ ¸®½ºÆ® * * ij½Ã°¡ ÀÌ¹Ì ÀÖÀ¸¸é Update °¡ ¾Æ´Ñ replace ÇÑ´Ù. */ void PutItemPriceListCache(const TItemPriceListTable* pItemPriceList); /// Flush ½Ã°£ÀÌ ¸¸·áµÈ ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ ¸®½ºÆ® ij½Ã¸¦ Flush ÇØÁÖ°í ij½Ã¿¡¼­ »èÁ¦ÇÑ´Ù. void UpdateItemPriceListCache(void); // END_OF_MYSHOP_PRICE_LIST void SendGuildSkillUsable(DWORD guild_id, DWORD dwSkillVnum, bool bUsable); void SetCacheFlushCountLimit(int iLimit); template Func for_each_peer(Func f); CPeer * GetAnyPeer(); void ForwardPacket(BYTE header, const void* data, int size, BYTE bChannel = 0, CPeer * except = NULL); void SendNotice(const char * c_pszFormat, ...); char* GetCommand(char* str); //µ¶Àϼ±¹°±â´É¿¡¼­ ¸í·É¾î ¾ò´Â ÇÔ¼ö void ItemAward(CPeer * peer, char* login); //µ¶ÀÏ ¼±¹° ±â´É CPeer * AddPeer(bufferevent* bufev, sockaddr* addr); void RemovePeer(CPeer * pPeer); CPeer * GetPeer(IDENT ident); CPeer * GetAuthPeer(); void ProcessPackets(CPeer * peer); protected: void Destroy(); private: bool InitializeTables(); bool InitializeShopTable(); bool InitializeMobTable(); bool InitializeItemTable(); bool InitializeQuestItemTable(); bool InitializeSkillTable(); bool InitializeRefineTable(); bool InitializeBanwordTable(); bool InitializeItemAttrTable(); bool InitializeItemRareTable(); bool InitializeLandTable(); bool InitializeObjectProto(); bool InitializeObjectTable(); bool InitializeMonarch(); // mob_proto.txt, item_proto.txt¿¡¼­ ÀÐÀº mob_proto, item_proto¸¦ real db¿¡ ¹Ý¿µ. // item_proto, mob_proto¸¦ db¿¡ ¹Ý¿µÇÏÁö ¾Ê¾Æµµ, °ÔÀÓ µ¹¾Æ°¡´Âµ¥´Â ¹®Á¦°¡ ¾øÁö¸¸, // ¿î¿µÅø µî¿¡¼­ dbÀÇ item_proto, mob_proto¸¦ ÀÐ¾î ¾²±â ¶§¹®¿¡ ¹®Á¦°¡ ¹ß»ýÇÑ´Ù. bool MirrorMobTableIntoDB(); bool MirrorItemTableIntoDB(); int AnalyzeQueryResult(SQLMsg * msg); int AnalyzeErrorMsg(CPeer * peer, SQLMsg * msg); int Process(); CLoginData * GetLoginData(DWORD dwKey); CLoginData * GetLoginDataByLogin(const char * c_pszLogin); CLoginData * GetLoginDataByAID(DWORD dwAID); void InsertLoginData(CLoginData * pkLD); void DeleteLoginData(CLoginData * pkLD); bool InsertLogonAccount(const char * c_pszLogin, DWORD dwHandle, const char * c_pszIP); bool DeleteLogonAccount(const char * c_pszLogin, DWORD dwHandle); bool FindLogonAccount(const char * c_pszLogin); void GuildCreate(CPeer * peer, DWORD dwGuildID); void GuildSkillUpdate(CPeer * peer, TPacketGuildSkillUpdate* p); void GuildExpUpdate(CPeer * peer, TPacketGuildExpUpdate* p); void GuildAddMember(CPeer * peer, TPacketGDGuildAddMember* p); void GuildChangeGrade(CPeer * peer, TPacketGuild* p); void GuildRemoveMember(CPeer * peer, TPacketGuild* p); void GuildChangeMemberData(CPeer * peer, TPacketGuildChangeMemberData* p); void GuildDisband(CPeer * peer, TPacketGuild * p); void GuildWar(CPeer * peer, TPacketGuildWar * p); void GuildWarScore(CPeer * peer, TPacketGuildWarScore * p); void GuildChangeLadderPoint(TPacketGuildLadderPoint* p); void GuildUseSkill(TPacketGuildUseSkill* p); void GuildDepositMoney(TPacketGDGuildMoney* p); void GuildWithdrawMoney(CPeer* peer, TPacketGDGuildMoney* p); void GuildWithdrawMoneyGiveReply(TPacketGDGuildMoneyWithdrawGiveReply* p); void GuildWarBet(TPacketGDGuildWarBet * p); void GuildChangeMaster(TPacketChangeGuildMaster* p); void SetGuildWarEndTime(DWORD guild_id1, DWORD guild_id2, time_t tEndTime); void QUERY_BOOT(CPeer * peer, TPacketGDBoot * p); void QUERY_LOGIN(CPeer * peer, DWORD dwHandle, SLoginPacket* data); void QUERY_LOGOUT(CPeer * peer, DWORD dwHandle, const char *); void RESULT_LOGIN(CPeer * peer, SQLMsg *msg); void QUERY_PLAYER_LOAD(CPeer * peer, DWORD dwHandle, TPlayerLoadPacket*); void RESULT_COMPOSITE_PLAYER(CPeer * peer, SQLMsg * pMsg, DWORD dwQID); void RESULT_PLAYER_LOAD(CPeer * peer, MYSQL_RES * pRes, ClientHandleInfo * pkInfo); void RESULT_ITEM_LOAD(CPeer * peer, MYSQL_RES * pRes, DWORD dwHandle, DWORD dwPID); void RESULT_QUEST_LOAD(CPeer * pkPeer, MYSQL_RES * pRes, DWORD dwHandle, DWORD dwPID); void RESULT_AFFECT_LOAD(CPeer * pkPeer, MYSQL_RES * pRes, DWORD dwHandle); // PLAYER_INDEX_CREATE_BUG_FIX void RESULT_PLAYER_INDEX_CREATE(CPeer *pkPeer, SQLMsg *msg); // END_PLAYER_INDEX_CREATE_BUG_FIX // MYSHOP_PRICE_LIST /// °¡°ÝÁ¤º¸ ·Îµå Äõ¸®¿¡ ´ëÇÑ Result ó¸® /** * @param peer °¡°ÝÁ¤º¸¸¦ ¿äûÇÑ Game server ÀÇ peer °´Ã¼ Æ÷ÀÎÅÍ * @param pMsg Äõ¸®ÀÇ Result ·Î ¹ÞÀº °´Ã¼ÀÇ Æ÷ÀÎÅÍ * * ·ÎµåµÈ °¡°ÝÁ¤º¸ ¸®½ºÆ®¸¦ ij½Ã¿¡ ÀúÀåÇÏ°í peer ¿¡°Ô ¸®½ºÆ®¸¦ º¸³»ÁØ´Ù. */ void RESULT_PRICELIST_LOAD(CPeer* peer, SQLMsg* pMsg); /// °¡°ÝÁ¤º¸ ¾÷µ¥ÀÌÆ®¸¦ À§ÇÑ ·Îµå Äõ¸®¿¡ ´ëÇÑ Result ó¸® /** * @param pMsg Äõ¸®ÀÇ Result ·Î ¹ÞÀº °´Ã¼ÀÇ Æ÷ÀÎÅÍ * * ·ÎµåµÈ Á¤º¸·Î °¡°ÝÁ¤º¸ ¸®½ºÆ® ij½Ã¸¦ ¸¸µé°í ¾÷µ¥ÀÌÆ® ¹ÞÀº °¡°ÝÁ¤º¸·Î ¾÷µ¥ÀÌÆ® ÇÑ´Ù. */ void RESULT_PRICELIST_LOAD_FOR_UPDATE(SQLMsg* pMsg); // END_OF_MYSHOP_PRICE_LIST void QUERY_PLAYER_SAVE(CPeer * peer, DWORD dwHandle, TPlayerTable*); void __QUERY_PLAYER_CREATE(CPeer * peer, DWORD dwHandle, TPlayerCreatePacket *); void __QUERY_PLAYER_DELETE(CPeer * peer, DWORD dwHandle, TPlayerDeletePacket *); void __RESULT_PLAYER_DELETE(CPeer * peer, SQLMsg* msg); void QUERY_PLAYER_COUNT(CPeer * pkPeer, TPlayerCountPacket *); void QUERY_ITEM_SAVE(CPeer * pkPeer, const char * c_pData); void QUERY_ITEM_DESTROY(CPeer * pkPeer, const char * c_pData); void QUERY_ITEM_FLUSH(CPeer * pkPeer, const char * c_pData); void QUERY_QUEST_SAVE(CPeer * pkPeer, TQuestTable *, DWORD dwLen); void QUERY_ADD_AFFECT(CPeer * pkPeer, TPacketGDAddAffect * p); void QUERY_REMOVE_AFFECT(CPeer * pkPeer, TPacketGDRemoveAffect * p); void QUERY_SAFEBOX_LOAD(CPeer * pkPeer, DWORD dwHandle, TSafeboxLoadPacket *, bool bMall); void QUERY_SAFEBOX_SAVE(CPeer * pkPeer, TSafeboxTable * pTable); void QUERY_SAFEBOX_CHANGE_SIZE(CPeer * pkPeer, DWORD dwHandle, TSafeboxChangeSizePacket * p); void QUERY_SAFEBOX_CHANGE_PASSWORD(CPeer * pkPeer, DWORD dwHandle, TSafeboxChangePasswordPacket * p); void RESULT_SAFEBOX_LOAD(CPeer * pkPeer, SQLMsg * msg); void RESULT_SAFEBOX_CHANGE_SIZE(CPeer * pkPeer, SQLMsg * msg); void RESULT_SAFEBOX_CHANGE_PASSWORD(CPeer * pkPeer, SQLMsg * msg); void RESULT_SAFEBOX_CHANGE_PASSWORD_SECOND(CPeer * pkPeer, SQLMsg * msg); void QUERY_EMPIRE_SELECT(CPeer * pkPeer, DWORD dwHandle, TEmpireSelectPacket * p); void QUERY_SETUP(CPeer * pkPeer, DWORD dwHandle, const char * c_pData); void SendPartyOnSetup(CPeer * peer); void QUERY_HIGHSCORE_REGISTER(CPeer * peer, TPacketGDHighscore* data); void RESULT_HIGHSCORE_REGISTER(CPeer * pkPeer, SQLMsg * msg); void QUERY_FLUSH_CACHE(CPeer * pkPeer, const char * c_pData); void QUERY_PARTY_CREATE(CPeer * peer, TPacketPartyCreate* p); void QUERY_PARTY_DELETE(CPeer * peer, TPacketPartyDelete* p); void QUERY_PARTY_ADD(CPeer * peer, TPacketPartyAdd* p); void QUERY_PARTY_REMOVE(CPeer * peer, TPacketPartyRemove* p); void QUERY_PARTY_STATE_CHANGE(CPeer * peer, TPacketPartyStateChange* p); void QUERY_PARTY_SET_MEMBER_LEVEL(CPeer * peer, TPacketPartySetMemberLevel* p); void QUERY_RELOAD_PROTO(); void QUERY_CHANGE_NAME(CPeer * peer, DWORD dwHandle, TPacketGDChangeName * p); void GetPlayerFromRes(TPlayerTable * player_table, MYSQL_RES* res); void QUERY_SMS(CPeer * pkPeer, TPacketGDSMS * p); void QUERY_LOGIN_KEY(CPeer * pkPeer, TPacketGDLoginKey * p); void AddGuildPriv(TPacketGiveGuildPriv* p); void AddEmpirePriv(TPacketGiveEmpirePriv* p); void AddCharacterPriv(TPacketGiveCharacterPriv* p); void MoneyLog(TPacketMoneyLog* p); void QUERY_AUTH_LOGIN(CPeer * pkPeer, DWORD dwHandle, TPacketGDAuthLogin * p); void QUERY_LOGIN_BY_KEY(CPeer * pkPeer, DWORD dwHandle, TPacketGDLoginByKey * p); void RESULT_LOGIN_BY_KEY(CPeer * peer, SQLMsg * msg); void ChargeCash(const TRequestChargeCash * p); void LoadEventFlag(); void SetEventFlag(TPacketSetEventFlag* p); void SendEventFlagsOnSetup(CPeer* peer); void BillingExpire(TPacketBillingExpire * p); void BillingCheck(const char * data); void SendAllLoginToBilling(); void SendLoginToBilling(CLoginData * pkLD, bool bLogin); // °áÈ¥ void MarriageAdd(TPacketMarriageAdd * p); void MarriageUpdate(TPacketMarriageUpdate * p); void MarriageRemove(TPacketMarriageRemove * p); void WeddingRequest(TPacketWeddingRequest * p); void WeddingReady(TPacketWeddingReady * p); void WeddingEnd(TPacketWeddingEnd * p); // MYSHOP_PRICE_LIST // °³ÀλóÁ¡ °¡°ÝÁ¤º¸ /// ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ ¸®½ºÆ® ¾÷µ¥ÀÌÆ® ÆÐŶ(HEADER_GD_MYSHOP_PRICELIST_UPDATE) ó¸®ÇÔ¼ö /** * @param [in] pPacket ÆÐŶ µ¥ÀÌÅÍÀÇ Æ÷ÀÎÅÍ */ void MyshopPricelistUpdate(const TPacketMyshopPricelistHeader* pPacket); /// ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ ¸®½ºÆ® ¿äû ÆÐŶ(HEADER_GD_MYSHOP_PRICELIST_REQ) ó¸®ÇÔ¼ö /** * @param peer ÆÐŶÀ» º¸³½ Game server ÀÇ peer °´Ã¼ÀÇ Æ÷ÀÎÅÍ * @param [in] dwHandle °¡°ÝÁ¤º¸¸¦ ¿äûÇÑ peer ÀÇ ÇÚµé * @param [in] dwPlayerID °¡°ÝÁ¤º¸ ¸®½ºÆ®¸¦ ¿äûÇÑ Ç÷¹À̾îÀÇ ID */ void MyshopPricelistRequest(CPeer* peer, DWORD dwHandle, DWORD dwPlayerID); // END_OF_MYSHOP_PRICE_LIST // Building void CreateObject(TPacketGDCreateObject * p); void DeleteObject(DWORD dwID); void UpdateLand(DWORD * pdw); // VCard void VCard(TPacketGDVCard * p); void VCardProcess(); // BLOCK_CHAT void BlockChat(TPacketBlockChat * p); // END_OF_BLOCK_CHAT private: int m_looping; event_base * m_base; evconnlistener * m_listener; TPeerList m_peerList; CPeer * m_pkAuthPeer; // LoginKey, LoginData pair typedef std::unordered_map TLoginDataByLoginKey; TLoginDataByLoginKey m_map_pkLoginData; // Login LoginData pair typedef std::unordered_map TLoginDataByLogin; TLoginDataByLogin m_map_pkLoginDataByLogin; // AccountID LoginData pair typedef std::unordered_map TLoginDataByAID; TLoginDataByAID m_map_pkLoginDataByAID; // Login LoginData pair (½ÇÁ¦ ·Î±×ÀÎ µÇ¾îÀÖ´Â °èÁ¤) typedef std::unordered_map TLogonAccountMap; TLogonAccountMap m_map_kLogonAccount; int m_iPlayerIDStart; int m_iPlayerDeleteLevelLimit; int m_iPlayerDeleteLevelLimitLower; bool m_bChinaEventServer; std::vector m_vec_mobTable; std::vector m_vec_itemTable; std::map m_map_itemTableByVnum; int m_iShopTableSize; TShopTable * m_pShopTable; int m_iRefineTableSize; TRefineTable* m_pRefineTable; std::vector m_vec_skillTable; std::vector m_vec_banwordTable; std::vector m_vec_itemAttrTable; std::vector m_vec_itemRareTable; std::vector m_vec_kLandTable; std::vector m_vec_kObjectProto; std::map m_map_pkObjectTable; std::queue m_queue_vcard; bool m_bShutdowned; TPlayerTableCacheMap m_map_playerCache; // Ç÷¹À̾î id°¡ key TItemCacheMap m_map_itemCache; // ¾ÆÀÌÅÛ id°¡ key TItemCacheSetPtrMap m_map_pkItemCacheSetPtr; // Ç÷¹À̾î id°¡ key, ÀÌ Ç÷¹À̾ ¾î¶² ¾ÆÀÌÅÛ Ä³½¬¸¦ °¡Áö°í ÀÖ³ª? // MYSHOP_PRICE_LIST /// Ç÷¹À̾ ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ ¸®½ºÆ® map. key: Ç÷¹À̾î ID, value: °¡°ÝÁ¤º¸ ¸®½ºÆ® ij½Ã TItemPriceListCacheMap m_mapItemPriceListCache; ///< Ç÷¹À̾ ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ ¸®½ºÆ® // END_OF_MYSHOP_PRICE_LIST TChannelStatusMap m_mChannelStatus; struct TPartyInfo { BYTE bRole; BYTE bLevel; TPartyInfo() :bRole(0), bLevel(0) { } }; typedef std::map TPartyMember; typedef std::map TPartyMap; typedef std::map TPartyChannelMap; TPartyChannelMap m_map_pkChannelParty; typedef std::map TEventFlagMap; TEventFlagMap m_map_lEventFlag; BYTE m_bLastHeader; int m_iCacheFlushCount; int m_iCacheFlushCountLimit; private : TItemIDRangeTable m_itemRange; public : bool InitializeNowItemID(); DWORD GetItemID(); DWORD GainItemID(); TItemIDRangeTable GetItemRange() { return m_itemRange; } //BOOT_LOCALIZATION public: /* ·ÎÄà Á¤º¸ ÃʱâÈ­ **/ bool InitializeLocalization(); private: std::vector m_vec_Locale; //END_BOOT_LOCALIZATION //ADMIN_MANAGER bool __GetAdminInfo(const char *szIP, std::vector & rAdminVec); bool __GetHostInfo(std::vector & rIPVec); //END_ADMIN_MANAGER //RELOAD_ADMIN void ReloadAdmin(CPeer * peer, TPacketReloadAdmin * p); //END_RELOAD_ADMIN void BreakMarriage(CPeer * peer, const char * data); struct TLogoutPlayer { DWORD pid; time_t time; bool operator < (const TLogoutPlayer & r) { return (pid < r.pid); } }; typedef std::unordered_map TLogoutPlayerMap; TLogoutPlayerMap m_map_logout; void InsertLogoutPlayer(DWORD pid); void DeleteLogoutPlayer(DWORD pid); void UpdateLogoutPlayer(); void UpdateItemCacheSet(DWORD pid); void FlushPlayerCacheSet(DWORD pid); //MONARCH void Election(CPeer * peer, DWORD dwHandle, const char * p); void Candidacy(CPeer * peer, DWORD dwHandle, const char * p); void AddMonarchMoney(CPeer * peer, DWORD dwHandle, const char * p); void TakeMonarchMoney(CPeer * peer, DWORD dwHandle, const char * p); void ComeToVote(CPeer * peer, DWORD dwHandle, const char * p); void RMCandidacy(CPeer * peer, DWORD dwHandle, const char * p); void SetMonarch(CPeer * peer, DWORD dwHandle, const char * p); void RMMonarch(CPeer * peer, DWORD dwHandle, const char * p); void DecMonarchMoney(CPeer * peer, DWORD dwHandle, const char * p); //END_MONARCH void ChangeMonarchLord(CPeer* peer, DWORD dwHandle, TPacketChangeMonarchLord* info); void BlockException(TPacketBlockException *data); void SendSpareItemIDRange(CPeer* peer); void UpdateHorseName(TPacketUpdateHorseName* data, CPeer* peer); void AckHorseName(DWORD dwPID, CPeer* peer); void DeleteLoginKey(TPacketDC *data); void ResetLastPlayerID(const TPacketNeedLoginLogInfo* data); //delete gift notify icon void DeleteAwardId(TPacketDeleteAwardID* data); void UpdateChannelStatus(TChannelStatus* pData); void RequestChannelStatus(CPeer* peer, DWORD dwHandle); #ifdef __AUCTION__ void EnrollInAuction (CPeer * peer, DWORD owner_id, AuctionEnrollProductInfo* data); void EnrollInSale (CPeer * peer, DWORD owner_id, AuctionEnrollSaleInfo* data); void EnrollInWish (CPeer * peer, DWORD wisher_id, AuctionEnrollWishInfo* data); void AuctionBid (CPeer * peer, DWORD bidder_id, AuctionBidInfo* data); void AuctionImpur (CPeer * peer, DWORD purchaser_id, AuctionImpurInfo* data); void AuctionGetAuctionedItem (CPeer * peer, DWORD actor_id, DWORD item_id); void AuctionBuySoldItem (CPeer * peer, DWORD actor_id, DWORD item_id); void AuctionCancelAuction (CPeer * peer, DWORD actor_id, DWORD item_id); void AuctionCancelWish (CPeer * peer, DWORD actor_id, DWORD item_num); void AuctionCancelSale (CPeer * peer, DWORD actor_id, DWORD item_id); void AuctionDeleteAuctionItem (CPeer * peer, DWORD actor_id, DWORD item_id); void AuctionDeleteSaleItem (CPeer * peer, DWORD actor_id, DWORD item_id); void AuctionReBid (CPeer * peer, DWORD bidder_id, AuctionBidInfo* data); void AuctionBidCancel (CPeer * peer, DWORD bidder_id, DWORD item_id); #endif }; template Func CClientManager::for_each_peer(Func f) { TPeerList::iterator it; for (it = m_peerList.begin(); it!=m_peerList.end();++it) { f(*it); } return f; } #endif