Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
693 lines
19 KiB
C++
693 lines
19 KiB
C++
#include "stdafx.h"
|
||
#include "SearchClass.h"
|
||
#include <BaseLibrary/Utility/Math/Math.h>
|
||
#include <RylGameLibrary/Log/LogCommands.h>
|
||
|
||
// ------------------------------------------------------------------------------------------
|
||
|
||
DWORD StringToDWORD(const CString& SearchValue_In)
|
||
{
|
||
DWORD dwResult = 0;
|
||
|
||
if(0 != SearchValue_In.GetLength())
|
||
{
|
||
if(-1 == SearchValue_In.Find("0x") && -1 == SearchValue_In.Find("0X"))
|
||
{
|
||
// Á¤¼ö
|
||
dwResult = atoi(SearchValue_In);
|
||
}
|
||
else
|
||
{
|
||
dwResult += Math::Convert::StrToHex32(SearchValue_In);
|
||
}
|
||
}
|
||
|
||
return dwResult;
|
||
}
|
||
|
||
DWORD64 StringToDWORD64(const CString& SearchValue_In)
|
||
{
|
||
DWORD64 dwResult = 0;
|
||
|
||
if(0 != SearchValue_In.GetLength())
|
||
{
|
||
if(-1 == SearchValue_In.Find("0x") && -1 == SearchValue_In.Find("0X"))
|
||
{
|
||
// Á¤¼ö
|
||
dwResult = _atoi64(SearchValue_In);
|
||
}
|
||
else
|
||
{
|
||
dwResult += Math::Convert::StrToHex64(SearchValue_In);
|
||
|
||
}
|
||
}
|
||
|
||
return dwResult;
|
||
}
|
||
|
||
// ------------------------------------------------------------------------------------------
|
||
|
||
|
||
CRegion::CRegion(const DWORD dwRadius, const DWORD dwXPos,
|
||
const DWORD dwYPos, const DWORD dwZPos)
|
||
: m_dwRadiusSquare(dwRadius*dwRadius), m_dwXPos(dwXPos),
|
||
m_dwYPos(dwYPos), m_dwZPos(dwZPos)
|
||
{
|
||
|
||
}
|
||
|
||
CRegion::CRegion(const CString& Radius, const CString& XPos,
|
||
const CString& YPos, const CString& ZPos)
|
||
{
|
||
m_dwRadiusSquare = (0 != Radius.GetLength()) ? atoi(Radius)*atoi(Radius) : 0;
|
||
m_dwXPos = (0 != XPos.GetLength()) ? atoi(XPos) : 0;
|
||
m_dwYPos = (0 != YPos.GetLength()) ? atoi(YPos) : 0;
|
||
m_dwZPos = (0 != ZPos.GetLength()) ? atoi(ZPos) : 0;
|
||
}
|
||
|
||
|
||
// ------------------------------------------------------------------------------------------
|
||
|
||
CCIDSearch::CCIDSearch(const CString& SearchValue_In)
|
||
: m_dwCID((0 == SearchValue_In.GetLength()) ? 0 : StringToDWORD(SearchValue_In))
|
||
{
|
||
|
||
}
|
||
|
||
bool CCIDSearch::operator () (const GAMELOG::sLogBase* lpLogBase)
|
||
{
|
||
using namespace GAMELOG;
|
||
|
||
if(0 == m_dwCID)
|
||
{
|
||
return true;
|
||
}
|
||
|
||
switch(lpLogBase->m_cCmd)
|
||
{
|
||
case CMD::GUILD_CREATE:
|
||
case CMD::GUILD_JOIN:
|
||
case CMD::GUILD_MEMBER_LEVEL:
|
||
case CMD::GUILD_LEAVE:
|
||
|
||
case CMD::GUILD_RIGHTS_CHANGE:
|
||
case CMD::GUILD_LEVEL_ADJUST:
|
||
case CMD::GUILD_MARK_ADJUST:
|
||
case CMD::GUILD_GOLD_CHANGE:
|
||
|
||
case CMD::GUILD_DISSOLVE:
|
||
{
|
||
const sGuildLog* lpGuildLog = static_cast<const sGuildLog*>(lpLogBase);
|
||
if((m_dwCID == lpGuildLog->m_dwSrcCID) || (m_dwCID == lpGuildLog->m_dwDstCID))
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
|
||
return (m_dwCID == lpLogBase->m_dwCID);
|
||
}
|
||
|
||
// ------------------------------------------------------------------------------------------
|
||
|
||
CUIDSearch::CUIDSearch(const CString& SearchValue_In)
|
||
: m_dwUID((0 == SearchValue_In.GetLength()) ? 0 : StringToDWORD(SearchValue_In))
|
||
{
|
||
|
||
}
|
||
|
||
bool CUIDSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
|
||
{
|
||
if(0 == m_dwUID) { return true; }
|
||
return (m_dwUID == lpLogBase->m_dwUID);
|
||
}
|
||
|
||
// ------------------------------------------------------------------------------------------
|
||
|
||
CPositionSearch::CPositionSearch(const CRegion& Region)
|
||
: m_Region(Region)
|
||
{
|
||
|
||
}
|
||
|
||
bool CPositionSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
|
||
{
|
||
return m_Region.IsIn(lpLogBase->m_usXPos,
|
||
lpLogBase->m_usYPos, lpLogBase->m_usZPos);
|
||
}
|
||
|
||
// ------------------------------------------------------------------------------------------
|
||
|
||
CTimeSearch::CTimeSearch(const CTime& StartTime, const CTime& StopTime)
|
||
: m_startTime(StartTime.GetTime()), m_stopTime(StopTime.GetTime())
|
||
{
|
||
|
||
}
|
||
|
||
bool CTimeSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
|
||
{
|
||
time_t time = lpLogBase->m_time;
|
||
|
||
if((m_startTime < time && time < m_stopTime) || 0 == time) { return true; }
|
||
return false;
|
||
}
|
||
|
||
|
||
// ------------------------------------------------------------------------------------------
|
||
|
||
CItemUIDSearch::CItemUIDSearch(const CString& SearchValue_In)
|
||
: m_dwItemUID(StringToDWORD64(SearchValue_In))
|
||
{
|
||
|
||
}
|
||
|
||
|
||
bool CItemUIDSearch::FindItem(const GAMELOG::sCharLoginOut* pLoginOut,
|
||
const DBUpdateData::UpdateList eUpdateList)
|
||
{
|
||
unsigned short usSize = 0;
|
||
unsigned short usItemSize = pLoginOut->m_usDataSize[eUpdateList];
|
||
|
||
const char *lpITEM_DATA = reinterpret_cast<const char*>(pLoginOut+1) +
|
||
std::accumulate(&pLoginOut->m_usDataSize[0], &pLoginOut->m_usDataSize[eUpdateList], 0);
|
||
|
||
while(usSize < usItemSize)
|
||
{
|
||
const Item::ItemData* lpItemData =
|
||
reinterpret_cast<const Item::ItemData*>(lpITEM_DATA + usSize);
|
||
|
||
if(m_dwItemUID == lpItemData->m_dwUID)
|
||
{
|
||
return true;
|
||
}
|
||
|
||
usSize += static_cast<unsigned short>(lpItemData->m_cItemSize);
|
||
}
|
||
|
||
return false;
|
||
}
|
||
|
||
|
||
bool CItemUIDSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
|
||
{
|
||
using namespace GAMELOG;
|
||
|
||
if(0 == m_dwItemUID) { return true; }
|
||
|
||
switch(lpLogBase->m_cCmd)
|
||
{
|
||
case CMD::CHAR_LOGIN:
|
||
case CMD::CHAR_LOGOUT:
|
||
case CMD::CHAR_DBUPDATE:
|
||
|
||
// ¾ÆÀÌÅÛ Çϳª¾¿ ´Ù µÚÁ®¼ UIDÀÏÄ¡ÇÏ´Â °Ô ÀÖÀ¸¸é true¸®ÅÏ
|
||
{
|
||
const GAMELOG::sCharLoginOut* lpLoginOut = static_cast<const GAMELOG::sCharLoginOut*>(lpLogBase);
|
||
|
||
if(FindItem(lpLoginOut, DBUpdateData::ITEM_EQUIP_UPDATE) ||
|
||
FindItem(lpLoginOut, DBUpdateData::ITEM_INVEN_UPDATE) ||
|
||
FindItem(lpLoginOut, DBUpdateData::ITEM_EXTRA_UPDATE) ||
|
||
FindItem(lpLoginOut, DBUpdateData::ITEM_EXCHANGE_UPDATE))
|
||
{
|
||
return true;
|
||
}
|
||
|
||
const char *lpDeposit = reinterpret_cast<const char*>(lpLoginOut+1) +
|
||
std::accumulate(&lpLoginOut->m_usDataSize[0],
|
||
&lpLoginOut->m_usDataSize[DBUpdateData::MAX_UPDATE_DB], 0);
|
||
|
||
unsigned short usSize = 0;
|
||
unsigned short usItemSize = lpLoginOut->m_usDepositData;
|
||
|
||
while(usSize < usItemSize)
|
||
{
|
||
const Item::ItemData* lpItemData =
|
||
reinterpret_cast<const Item::ItemData*>(lpDeposit + usSize);
|
||
|
||
if(m_dwItemUID == lpItemData->m_dwUID)
|
||
{
|
||
return true;
|
||
}
|
||
|
||
usSize += static_cast<unsigned short>(lpItemData->m_cItemSize);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case CMD::MOVE_ITEM:
|
||
|
||
return m_dwItemUID == static_cast<const sMoveItemLog*>(lpLogBase)->m_itemInfo.m_dwItemUID;
|
||
|
||
case CMD::SWAP_ITEM:
|
||
|
||
{
|
||
const sSwapItemLog* lpSwapItemLog = static_cast<const sSwapItemLog*>(lpLogBase);
|
||
return (m_dwItemUID == lpSwapItemLog->m_srcItemInfo.m_dwItemUID) ||
|
||
(m_dwItemUID == lpSwapItemLog->m_dstItemInfo.m_dwItemUID);
|
||
}
|
||
|
||
case CMD::USE_ITEM:
|
||
|
||
// »ç¿ëÇÏ´Â ¾ÆÀÌÅÛ
|
||
return (m_dwItemUID == static_cast<const GAMELOG::sUseItemLog*>(lpLogBase)->m_itemInfo.m_dwItemUID);
|
||
|
||
case CMD::USE_LOTTERY:
|
||
|
||
// »ç¿ëÇÏ´Â ¾ÆÀÌÅÛ
|
||
return (m_dwItemUID == static_cast<const GAMELOG::sUseLotteryLog*>(lpLogBase)->m_itemInfo.m_dwItemUID);
|
||
|
||
case CMD::SPLIT_ITEM:
|
||
|
||
{
|
||
const sSplitItemLog* lpSplitItemLog = static_cast<const GAMELOG::sSplitItemLog*>(lpLogBase);
|
||
return (m_dwItemUID == lpSplitItemLog ->m_prevItem.m_dwItemUID) ||
|
||
(m_dwItemUID == lpSplitItemLog->m_splitItem.m_dwItemUID);
|
||
}
|
||
|
||
case CMD::PICKUP_ITEM:
|
||
|
||
// Áý´Â ¾ÆÀÌÅÛ
|
||
{
|
||
const GAMELOG::sPickupItemLog* lpPickup = static_cast<const GAMELOG::sPickupItemLog*>(lpLogBase);
|
||
const Item::ItemData* lpItemData = reinterpret_cast<const Item::ItemData*>(lpPickup + 1);
|
||
return (0 == lpPickup->m_cErr) ? (m_dwItemUID == lpItemData->m_dwUID) : false;
|
||
}
|
||
|
||
case CMD::DROP_ITEM:
|
||
// ¹ö¸®´Â ¾ÆÀÌÅÛ
|
||
{
|
||
const GAMELOG::sDropItemLog* lpDrop = static_cast<const GAMELOG::sDropItemLog*>(lpLogBase);
|
||
const Item::ItemData* lpItemData = reinterpret_cast<const Item::ItemData*>(lpDrop+1);
|
||
return (0 == lpDrop->m_cErr) ? (m_dwItemUID == lpItemData->m_dwUID) : false;
|
||
}
|
||
|
||
case CMD::BUY_ITEM:
|
||
case CMD::SELL_ITEM:
|
||
// »ç´Â ¾ÆÀÌÅÛ / ÆÄ´Â ¾ÆÀÌÅÛ
|
||
{
|
||
const GAMELOG::sTradeItemLog* lpTrade = static_cast<const GAMELOG::sTradeItemLog*>(lpLogBase);
|
||
const Item::ItemData* lpItemData = reinterpret_cast<const Item::ItemData*>(lpTrade+1);
|
||
return (0 == lpTrade->m_cErr) ? (m_dwItemUID == lpItemData->m_dwUID) : false;
|
||
}
|
||
|
||
case CMD::BEFORE_EXCHANGE_ITEM:
|
||
case CMD::AFTER_EXCHANGE_ITEM:
|
||
// ±³È¯Çϱâ Àü ¾ÆÀÌÅÛ / ±³È¯ ÈÄ ¾ÆÀÌÅÛ
|
||
{
|
||
const GAMELOG::sExchangeItemLog* lpExchange = static_cast<const GAMELOG::sExchangeItemLog*>(lpLogBase);
|
||
const char* lpITEM_DATA = reinterpret_cast<const char*>(lpExchange + 1);
|
||
unsigned short nSize = 0;
|
||
|
||
while(nSize < lpExchange->m_usItemSize)
|
||
{
|
||
const Item::ItemData* lpItemData =
|
||
reinterpret_cast<const Item::ItemData*>(lpITEM_DATA + nSize);
|
||
|
||
if(m_dwItemUID == lpItemData->m_dwUID)
|
||
{
|
||
return true;
|
||
}
|
||
|
||
nSize += static_cast<unsigned short>(lpItemData->m_cItemSize);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case CMD::INSTALL_SOCKET_ITEM:
|
||
|
||
{
|
||
// GemÇϰí, EquipÁ¶»ç
|
||
const GAMELOG::sInstallSocketLog* lpInstallSocket =
|
||
static_cast<const GAMELOG::sInstallSocketLog*>(lpLogBase);
|
||
|
||
if(0 == lpInstallSocket->m_cErr)
|
||
{
|
||
const Item::ItemData* lpItemGemData =
|
||
reinterpret_cast<const Item::ItemData*>(lpInstallSocket+1);
|
||
|
||
if(m_dwItemUID == lpItemGemData->m_dwUID)
|
||
{
|
||
return true;
|
||
}
|
||
|
||
const Item::ItemData* lpItemEquipData = reinterpret_cast<const Item::ItemData*>(
|
||
reinterpret_cast<const char*>(lpInstallSocket + 1) + lpItemGemData->m_cItemSize);
|
||
|
||
if(m_dwItemUID == lpItemEquipData->m_dwUID)
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
|
||
case CMD::REPAIR_ITEM:
|
||
|
||
// ¼ö¸® ¾ÆÀÌÅÛ
|
||
return (m_dwItemUID ==
|
||
static_cast<const GAMELOG::sRepairItemLog*>(lpLogBase)->m_RepairedItem.m_dwItemUID);
|
||
|
||
case CMD::UPGRADE_ITEM:
|
||
|
||
{
|
||
// GemÇϰí, EquipÁ¶»ç
|
||
const GAMELOG::sUpgradeItemLog* lpUpgradeItemLog =
|
||
static_cast<const GAMELOG::sUpgradeItemLog*>(lpLogBase);
|
||
|
||
if(0 == lpUpgradeItemLog->m_cErr)
|
||
{
|
||
const Item::ItemData* lpItemMineralData =
|
||
reinterpret_cast<const Item::ItemData*>(lpUpgradeItemLog+1);
|
||
|
||
if(m_dwItemUID == lpItemMineralData->m_dwUID)
|
||
{
|
||
return true;
|
||
}
|
||
|
||
const Item::ItemData* lpItemEquipData = reinterpret_cast<const Item::ItemData*>(
|
||
reinterpret_cast<const char*>(lpUpgradeItemLog + 1) + lpItemMineralData->m_cItemSize);
|
||
|
||
if(m_dwItemUID == lpItemEquipData->m_dwUID)
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
|
||
case CMD::STALL_ITEM_REGISTER_REMOVE:
|
||
|
||
{
|
||
const GAMELOG::sStallRegisterRemoveItemLog* lpStallRegisterRemoveItemLog =
|
||
static_cast<const GAMELOG::sStallRegisterRemoveItemLog*>(lpLogBase);
|
||
|
||
if(m_dwItemUID == lpStallRegisterRemoveItemLog->m_itemInfo.m_dwItemUID)
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
};
|
||
|
||
return false;
|
||
}
|
||
|
||
CItemTypeIDSearch::CItemTypeIDSearch(const CString& SearchValue_In)
|
||
: m_usItemTypeID(atoi(SearchValue_In))
|
||
{
|
||
}
|
||
|
||
|
||
bool CItemTypeIDSearch::FindItem(const GAMELOG::sCharLoginOut* pLoginOut,
|
||
const DBUpdateData::UpdateList eUpdateList)
|
||
{
|
||
unsigned short usSize = 0;
|
||
unsigned short usItemSize = pLoginOut->m_usDataSize[eUpdateList];
|
||
|
||
const char *lpITEM_DATA = reinterpret_cast<const char*>(pLoginOut+1) +
|
||
std::accumulate(&pLoginOut->m_usDataSize[0], &pLoginOut->m_usDataSize[eUpdateList], 0);
|
||
|
||
while(usSize < usItemSize)
|
||
{
|
||
const Item::ItemData* lpItemData =
|
||
reinterpret_cast<const Item::ItemData*>(lpITEM_DATA + usSize);
|
||
|
||
if(m_usItemTypeID == lpItemData->m_usProtoTypeID)
|
||
{
|
||
return true;
|
||
}
|
||
|
||
usSize += static_cast<unsigned short>(lpItemData->m_cItemSize);
|
||
}
|
||
|
||
return false;
|
||
}
|
||
|
||
|
||
bool CItemTypeIDSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
|
||
{
|
||
using namespace GAMELOG;
|
||
|
||
if(0 == m_usItemTypeID) { return true; }
|
||
|
||
switch(lpLogBase->m_cCmd)
|
||
{
|
||
case CMD::CHAR_LOGIN:
|
||
case CMD::CHAR_LOGOUT:
|
||
case CMD::CHAR_DBUPDATE:
|
||
|
||
// ¾ÆÀÌÅÛ Çϳª¾¿ ´Ù µÚÁ®¼ UIDÀÏÄ¡ÇÏ´Â °Ô ÀÖÀ¸¸é true¸®ÅÏ
|
||
{
|
||
const GAMELOG::sCharLoginOut* lpLoginOut = static_cast<const GAMELOG::sCharLoginOut*>(lpLogBase);
|
||
|
||
if(FindItem(lpLoginOut, DBUpdateData::ITEM_EQUIP_UPDATE) ||
|
||
FindItem(lpLoginOut, DBUpdateData::ITEM_INVEN_UPDATE) ||
|
||
FindItem(lpLoginOut, DBUpdateData::ITEM_EXTRA_UPDATE) ||
|
||
FindItem(lpLoginOut, DBUpdateData::ITEM_EXCHANGE_UPDATE))
|
||
{
|
||
return true;
|
||
}
|
||
|
||
const char *lpDeposit = reinterpret_cast<const char*>(lpLoginOut+1) +
|
||
std::accumulate(&lpLoginOut->m_usDataSize[0],
|
||
&lpLoginOut->m_usDataSize[DBUpdateData::MAX_UPDATE_DB], 0);
|
||
|
||
unsigned short usSize = 0;
|
||
unsigned short usItemSize = lpLoginOut->m_usDepositData;
|
||
|
||
while(usSize < usItemSize)
|
||
{
|
||
const Item::ItemData* lpItemData =
|
||
reinterpret_cast<const Item::ItemData*>(lpDeposit + usSize);
|
||
|
||
if(m_usItemTypeID == lpItemData->m_usProtoTypeID)
|
||
{
|
||
return true;
|
||
}
|
||
|
||
usSize += static_cast<unsigned short>(lpItemData->m_cItemSize);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case CMD::USE_ITEM:
|
||
|
||
// »ç¿ëÇÏ´Â ¾ÆÀÌÅÛ
|
||
{
|
||
const GAMELOG::sUseItemLog* lpUseItem = static_cast<const GAMELOG::sUseItemLog*>(lpLogBase);
|
||
return m_usItemTypeID == lpUseItem->m_itemInfo.m_usProtoTypeID;
|
||
}
|
||
|
||
case CMD::USE_LOTTERY:
|
||
|
||
// »ç¿ëÇÏ´Â ¾ÆÀÌÅÛ
|
||
{
|
||
const GAMELOG::sUseLotteryLog* lpUseLottery = static_cast<const GAMELOG::sUseLotteryLog*>(lpLogBase);
|
||
return m_usItemTypeID == lpUseLottery->m_itemInfo.m_usProtoTypeID;
|
||
}
|
||
|
||
case CMD::PICKUP_ITEM:
|
||
|
||
// Áý´Â ¾ÆÀÌÅÛ
|
||
{
|
||
const GAMELOG::sPickupItemLog* lpPickup = static_cast<const GAMELOG::sPickupItemLog*>(lpLogBase);
|
||
if(0 != lpPickup->m_dwGold) return false;
|
||
|
||
const Item::ItemData* lpItemData = reinterpret_cast<const Item::ItemData*>(lpPickup + 1);
|
||
|
||
return (0 == lpPickup->m_cErr) ? (m_usItemTypeID == lpItemData->m_usProtoTypeID) : false;
|
||
}
|
||
|
||
case CMD::DROP_ITEM:
|
||
// ¹ö¸®´Â ¾ÆÀÌÅÛ
|
||
{
|
||
const GAMELOG::sDropItemLog* lpDrop = static_cast<const GAMELOG::sDropItemLog*>(lpLogBase);
|
||
const Item::ItemData* lpItemData = reinterpret_cast<const Item::ItemData*>(lpDrop+1);
|
||
return (0 == lpDrop->m_cErr) ? (m_usItemTypeID == lpItemData->m_usProtoTypeID) : false;
|
||
}
|
||
|
||
case CMD::BUY_ITEM:
|
||
case CMD::SELL_ITEM:
|
||
// »ç´Â ¾ÆÀÌÅÛ / ÆÄ´Â ¾ÆÀÌÅÛ
|
||
{
|
||
const GAMELOG::sTradeItemLog* lpTrade = static_cast<const GAMELOG::sTradeItemLog*>(lpLogBase);
|
||
const Item::ItemData* lpItemData = reinterpret_cast<const Item::ItemData*>(lpTrade+1);
|
||
return (0 == lpTrade->m_cErr) ? (m_usItemTypeID == lpItemData->m_usProtoTypeID) : false;
|
||
}
|
||
|
||
case CMD::BEFORE_EXCHANGE_ITEM:
|
||
case CMD::AFTER_EXCHANGE_ITEM:
|
||
// ±³È¯Çϱâ Àü ¾ÆÀÌÅÛ / ±³È¯ ÈÄ ¾ÆÀÌÅÛ
|
||
{
|
||
const GAMELOG::sExchangeItemLog* lpExchange = static_cast<const GAMELOG::sExchangeItemLog*>(lpLogBase);
|
||
const char* lpITEM_DATA = reinterpret_cast<const char*>(lpExchange + 1);
|
||
unsigned short nSize = 0;
|
||
|
||
while(nSize < lpExchange->m_usItemSize)
|
||
{
|
||
const Item::ItemData* lpItemData =
|
||
reinterpret_cast<const Item::ItemData*>(lpITEM_DATA + nSize);
|
||
|
||
if(m_usItemTypeID == lpItemData->m_usProtoTypeID)
|
||
{
|
||
return true;
|
||
}
|
||
|
||
nSize += static_cast<unsigned short>(lpItemData->m_cItemSize);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case CMD::INSTALL_SOCKET_ITEM:
|
||
|
||
{
|
||
// GemÇϰí, EquipÁ¶»ç
|
||
const GAMELOG::sInstallSocketLog* lpInstallSocket =
|
||
static_cast<const GAMELOG::sInstallSocketLog*>(lpLogBase);
|
||
|
||
if(0 == lpInstallSocket->m_cErr)
|
||
{
|
||
const Item::ItemData* lpItemGemData =
|
||
reinterpret_cast<const Item::ItemData*>(lpInstallSocket+1);
|
||
|
||
if(m_usItemTypeID == lpItemGemData->m_usProtoTypeID)
|
||
{
|
||
return true;
|
||
}
|
||
|
||
const Item::ItemData* lpItemEquipData = reinterpret_cast<const Item::ItemData*>(
|
||
reinterpret_cast<const char*>(lpInstallSocket + 1) + lpItemGemData->m_cItemSize);
|
||
|
||
if(m_usItemTypeID == lpItemEquipData->m_usProtoTypeID)
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
|
||
case CMD::REPAIR_ITEM:
|
||
|
||
// ¼ö¸® ¾ÆÀÌÅÛ
|
||
return (m_usItemTypeID ==
|
||
static_cast<const GAMELOG::sRepairItemLog*>(lpLogBase)->m_RepairedItem.m_usProtoTypeID);
|
||
|
||
case CMD::UPGRADE_ITEM:
|
||
|
||
{
|
||
// GemÇϰí, EquipÁ¶»ç
|
||
const GAMELOG::sUpgradeItemLog* lpUpgradeItemLog =
|
||
static_cast<const GAMELOG::sUpgradeItemLog*>(lpLogBase);
|
||
|
||
if(0 == lpUpgradeItemLog->m_cErr)
|
||
{
|
||
const Item::ItemData* lpItemMineralData =
|
||
reinterpret_cast<const Item::ItemData*>(lpUpgradeItemLog+1);
|
||
|
||
if(m_usItemTypeID == lpItemMineralData->m_usProtoTypeID)
|
||
{
|
||
return true;
|
||
}
|
||
|
||
const Item::ItemData* lpItemEquipData = reinterpret_cast<const Item::ItemData*>(
|
||
reinterpret_cast<const char*>(lpUpgradeItemLog + 1) + lpItemMineralData->m_cItemSize);
|
||
|
||
if(m_usItemTypeID == lpItemEquipData->m_usProtoTypeID)
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
};
|
||
|
||
return false;
|
||
}
|
||
|
||
CIPSearch::CIPSearch(const CString& SearchValue_In)
|
||
{
|
||
CString resToken;
|
||
int curPos= 0;
|
||
|
||
resToken = SearchValue_In.Tokenize(".",curPos);
|
||
if("" != resToken) { m_sockaddr_In.sin_addr.S_un.S_un_b.s_b1 = atoi(resToken.Trim()); }
|
||
|
||
resToken = SearchValue_In.Tokenize(".",curPos);
|
||
if("" != resToken) { m_sockaddr_In.sin_addr.S_un.S_un_b.s_b2 = atoi(resToken.Trim()); }
|
||
|
||
resToken = SearchValue_In.Tokenize(".",curPos);
|
||
if("" != resToken) { m_sockaddr_In.sin_addr.S_un.S_un_b.s_b3 = atoi(resToken.Trim()); }
|
||
|
||
resToken = SearchValue_In.Tokenize(".\n",curPos);
|
||
if("" != resToken) { m_sockaddr_In.sin_addr.S_un.S_un_b.s_b4 = atoi(resToken.Trim()); }
|
||
}
|
||
|
||
|
||
bool CIPSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
|
||
{
|
||
using namespace GAMELOG;
|
||
|
||
switch(lpLogBase->m_cCmd)
|
||
{
|
||
case CMD::CHAR_LOGIN:
|
||
case CMD::CHAR_LOGOUT:
|
||
{
|
||
const GAMELOG::sCharLoginOut* lpCharLoginOut = static_cast<const GAMELOG::sCharLoginOut*>(lpLogBase);
|
||
if(lpCharLoginOut->m_nIP == m_sockaddr_In.sin_addr.S_un.S_addr)
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
break;
|
||
};
|
||
|
||
return false;
|
||
}
|
||
|
||
// ------------------------------------------------------------------------------------------
|
||
|
||
CCategory::CCategory(const CMDArray& CMDs)
|
||
: m_CMDArray(CMDs)
|
||
{
|
||
|
||
}
|
||
|
||
bool CCategory::operator() (const GAMELOG::sLogBase* lpLogBase)
|
||
{
|
||
return std::binary_search(m_CMDArray.begin(),
|
||
m_CMDArray.end(), lpLogBase->m_cCmd);
|
||
}
|
||
|
||
|
||
// ------------------------------------------------------------------------------------------
|
||
|
||
CGIDSearch::CGIDSearch(const CString& SearchValue_In)
|
||
: m_dwGID((0 == SearchValue_In.GetLength()) ? 0 : StringToDWORD(SearchValue_In))
|
||
{
|
||
|
||
}
|
||
|
||
bool CGIDSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
|
||
{
|
||
using namespace GAMELOG;
|
||
|
||
switch(lpLogBase->m_cCmd)
|
||
{
|
||
case CMD::GUILD_CREATE:
|
||
case CMD::GUILD_JOIN:
|
||
case CMD::GUILD_MEMBER_LEVEL:
|
||
case CMD::GUILD_LEAVE:
|
||
|
||
case CMD::GUILD_RIGHTS_CHANGE:
|
||
case CMD::GUILD_LEVEL_ADJUST:
|
||
case CMD::GUILD_MARK_ADJUST:
|
||
case CMD::GUILD_GOLD_CHANGE:
|
||
|
||
case CMD::GUILD_DISSOLVE:
|
||
|
||
return m_dwGID == static_cast<const sGuildLog*>(lpLogBase)->m_dwGID;
|
||
}
|
||
|
||
return false;
|
||
}
|