#include "StdAfx.h" #include ".\friendinvitationlevelchangedproc.h" #include "../UserManager.h" #include "../User.h" #include "WFriendInvitationController.h" #include "PacketStruct_DW.h" FriendInvitationLevelChangedProc::FriendInvitationLevelChangedProc(void) { } FriendInvitationLevelChangedProc::~FriendInvitationLevelChangedProc(void) { } VOID FriendInvitationLevelChangedProc::ChangedEventLevel(User* pUser, LEVELTYPE level) { STRUCT_FRIEND_INFO* pFriendInfo = pUser->GetFriendMap(User::FRIEND_BEINVIATED)->GetFirstFriend(); if(NULL == pFriendInfo) return; do { SendReWardInfo(pFriendInfo->dwFriendGuid, pFriendInfo->sPacketInfo.ptszFriendName, pUser, level, WFriendInvitationController::Instance()->GetEventMaxLevel() == level ? SYSMEMO_FRIENDINVITATION_INVATE_END : SYSMEMO_FRIENDINVITATION_INVATE_PRESENT); } while( pFriendInfo = pUser->GetFriendMap(User::FRIEND_BEINVIATED)->GetNextFriend() ); SendReWardInfo(pUser->GetCharGuid(), pUser->GetCharName().c_str(), pUser, level, WFriendInvitationController::Instance()->GetEventMaxLevel() == level ? SYSMEMO_FRIENDINVITATION_BEINVATED_END : SYSMEMO_FRIENDINVITATION_BEINVATED_PRESENT); if(level == WFriendInvitationController::Instance()->GetEventMaxLevel()) //À̺¥Æ® Á¾·á·¹º§ÀÌ µÇ¾ú´Ù. { //¹ö±×¼öÁ¤:5864 Ä£±¸ÃÊ´ë ¸ñÇ¥·¹º§¿¡ µµ´ÞÇߴµ¥µµ À̺¥Æ®°¡ Á¾·áµÇÁö ¾Ê´Â¹ö±× ¼öÁ¤ EventEnd(pUser); } } //¹ö±×¼öÁ¤:5854 (¸ðµç±¹°¡°øÅë)ÃÊ´ëÇÑ Ä³¸¯ÅͰ¡ Á¢¼ÓÇÏÁö ¾ÊÀº »óÅ¿¡¼­´Â À̹øÆ® ¼±¹° ¸ø¹Þ´Â ¹ö±×¼öÁ¤ VOID FriendInvitationLevelChangedProc::SendReWardInfo(CHARGUID Charguid, const char* Charname, User* pSendUser, LEVELTYPE level, eSYSTEM_MEMO_TYPE Memotype) { MSG_DW_FRIEND_INVITATIONRELATION_REWARDINSERT_CMD msg; msg.m_dwKey = 0; // ½Ã½ºÅÛÀ¸·ÎºÎÅÍÀÇ ÂÊÁö msg.m_SendGuid = Charguid; msg.m_RevGuid = pSendUser->GetCharGuid(); msg.m_Level = level; _tcsncpy( msg.m_ptszRecvName, Charname, MAX_CHARNAME_LENGTH ); msg.m_ptszRecvName[MAX_CHARNAME_LENGTH] = '\0'; _sntprintf(msg.m_ptszMemo, MAX_MEMO_LENGTH, "%d|%s|%d|", Memotype, pSendUser->GetCharName().c_str(), level); msg.m_ptszMemo[MAX_MEMO_LENGTH] = '\0'; ServerSession *pDBProxy = ServerSessionManager::Instance()->GetGameDBProxy(); if(pDBProxy) { pDBProxy->Send((BYTE*)&msg, sizeof(msg)); } else { SUNLOG(eCRITICAL_LOG, "SendReWardInfo Error - No GameDBProxy"); } } VOID FriendInvitationLevelChangedProc::EventEnd(User* pUser) { //µµ´Þ ÇßÀ¸¸é Ä£±¸ Ãßõ °ü°è Äڵ带 ÀϹÝÄ£±¸·Î ÃʱâÈ­ ½ÃÄÑ ¹ö¸°´ç. if(ListPorc.IsSetFriendsNormalSts(pUser)) //pUser ÀÌ Ä£±¸Ãßõ ¹ÞÀº ij¸¯ÀÌ¾ß ? { //¿øÄ¢ ÀûÀ¸·Î´Â µðºñ ÀÛ¾÷ÀÌ ¼º°øÀ» ÇØ¾ß ¼­¹ö µ¥ÀÌŸ¸¦ º¯°æÇØ¾ß Çϴµ¥ //ÀÌ °æ¿ì´Â ¼­¹ö°¡ ½ÇÆÐÇÏ´ø ¼º°øÇÏ´ø ÀÏ´Ü ¹«Á¶°Ç ¹Ù²ã¾ß ÇÏ´Â »óÅÂÀÌ´Ù~ ServerSession *pDBProxy = ServerSessionManager::Instance()->GetGameDBProxy(); if(pDBProxy) { MSG_DW_FRIEND_INVITATIONRELATION_FREE_CMD FriendInvitationMsg; //DBProxy ¿¡ Àü¼Û FriendInvitationMsg.m_CharGuid = pUser->GetCharGuid(); pDBProxy->Send((BYTE*)&FriendInvitationMsg, sizeof(FriendInvitationMsg)); } else { SUNLOG(eCRITICAL_LOG, "EventEnd Error - No GameDBProxy"); } } }