Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[C++ Feed] fix give WP issue, for player loading map while war end

Newbie Spellweaver
Joined
Feb 2, 2015
Messages
77
Reaction score
53
Description
this is rework Give wp function, it will give WarPoint to every player that in SP Area even player still loading map


How to use
on server side find AddWarPointInMap then try disable old function, and use new one


Paremeter
AddWarPointInMapWarEx
- MapIndex
- Winner War Point
- Loser War Point
- Bonus War Point
- Winner Nation
- Give Type


PHP:
void CFieldIOCPSocket::AddWarPointInMapWarEx(MapIndex_t nMapIndex, INT i_nWinnerWarPoint, INT i_nLoserWarPoint, BOOL i_bEventBonus, BYTE i_bInfWinnerMask, BYTE i_byWPUpdateTy/*=WPUT_GENERAL*/)
{
 
                const MAP_INFO* pMapInfo = CAtumSJ::GetMapInfo(nMapIndex);
                if (pMapInfo == NULL || nMapIndex == 0 || i_bInfWinnerMask == 0)
                                return;
 
                MapIndex_t nMapIndexBefore = pMapInfo->BeforeMapIndex == pMapInfo->MapIndex ? 0 : pMapInfo->BeforeMapIndex; // Clear Den Map
                BYTE nInfLoserMask = i_bInfWinnerMask == INFLUENCE_TYPE_ANI ? INFLUENCE_TYPE_VCN : INFLUENCE_TYPE_ANI;
 
                for (int i = (CLIENT_INDEX_START_NUM); i < ms_pFieldIOCP->m_dwArrayClientSize; i++)
                {
                                CFieldIOCPSocket* pSock = (CFieldIOCPSocket*)ms_pFieldIOCP->GetIOCPSocket(i);
                                if (NULL == pSock || FALSE == pSock->IsValidCharacter(FALSE))
                                                continue;
 
                                if(pSock->m_character.MapChannelIndex.ChannelIndex != 0 || 
pSock->m_character.MapChannelIndex.MapIndex == 0 )
                                                continue;
 
 
                                if (nMapIndex == pSock->m_character.MapChannelIndex.MapIndex || 
nMapIndexBefore == pSock->m_character.MapChannelIndex.MapIndex || 
pMapInfo->BeforeMapIndex2 == pSock->m_character.MapChannelIndex.MapIndex)
                                {
                                                int nWarPoint = 0;
 
                                                if (COMPARE_INFLUENCE(pSock->m_character.InfluenceType, i_bInfWinnerMask)) {
                                                                nWarPoint = i_nWinnerWarPoint;
                                                }
                                                else if (COMPARE_INFLUENCE(pSock->m_character.InfluenceType, nInfLoserMask)) {
                                                                nWarPoint = i_nLoserWarPoint;
                                                }
 
                                                if (nWarPoint == 0)
                                                                continue;
 
                                                pSock->WPAddWarPoint(nWarPoint, i_bEventBonus, i_byWPUpdateTy);
 
 
                                }
                }
}
 
Last edited:
Back
Top