#include "stdafx.h" #include "Ryl_AgentServerParseData.h" #include #include #include #include #include #include #include #include #include #include #include bool CAgentServerParseData::PARSE_CHAR_BASIC_DATA(CModifyCharacter* lpCharacter, char* lpDataBuffer) { unsigned short* lpSizeArray = reinterpret_cast(lpDataBuffer); char* lpCharDataBuffer = lpDataBuffer + (sizeof(unsigned short) * DBUpdateData::MAX_UPDATE_DB); if(!lpCharacter->SetCharacterInfo(lpCharDataBuffer, lpSizeArray)) { ERRLOG0(g_Log, "PARSE_CHAR_BASIC_DATA ½ÇÆÐ"); return false; } return true; } bool CAgentServerParseData::PARSE_CHAR_EXTRA_DATA(CModifyCharacter* lpCharacter, char* lpDataBuffer) { CModifyCharacter::CHAR_EXTRA_DATA& ExtraData = lpCharacter->GetExtraData(); ExtraData.m_CharInfoEX = *reinterpret_cast(lpDataBuffer); lpDataBuffer += sizeof(CHAR_INFOEX); ExtraData.m_Quest = *reinterpret_cast(lpDataBuffer); lpDataBuffer += sizeof(QUEST); ExtraData.m_History = *reinterpret_cast(lpDataBuffer); lpDataBuffer += sizeof(HISTORY); ExtraData.m_Config = *reinterpret_cast(lpDataBuffer); lpDataBuffer += sizeof(CONFIG); // STORE_INFO LPSTORE_INFO lpStoreInfo = reinterpret_cast(lpDataBuffer); Item::CDepositContainer& DepositContainer = lpCharacter->GetDeposit(); DepositContainer.SetPassword(lpStoreInfo->Password, STORE_INFO::MAX_PASS_LEN); DepositContainer.SetTabFlag(lpStoreInfo->Flag); DepositContainer.DeductGold(lpCharacter->GetDeposit().GetGold()); DepositContainer.AddGold(lpStoreInfo->Gold); lpCharacter->RevisionQuestNation(); lpCharacter->ParseQuestData(); return true; } bool CAgentServerParseData::PARSE_CHAR_FRIEND_DATA(CModifyCharacter* lpCharacter, char* lpDataBuffer, unsigned short PaseLength) { CFriendList& FriendList = lpCharacter->GetFriendList(); if(!FriendList.SerializeIn(lpDataBuffer, PaseLength)) { ERRLOG0(g_Log, "PARSE_CHAR_FRIEND_DATA ½ÇÆÐ (Ä£±¸ ¸®½ºÆ® ½Ã¸®¾ó¶óÀÌÁî ÀÎ ½ÇÆÐ)"); return false; } return true; } bool CAgentServerParseData::PARSE_CHAR_BAN_DATA(CModifyCharacter* lpCharacter, char* lpDataBuffer, unsigned short PaseLength) { CBanList& BanList = lpCharacter->GetBanList(); if(!BanList.SerializeIn(lpDataBuffer, PaseLength)) { ERRLOG0(g_Log, "PARSE_CHAR_BAN_DATA ½ÇÆÐ (°ÅºÎ ¸®½ºÆ® ½Ã¸®¾ó¶óÀÌÁî ÀÎ ½ÇÆÐ)"); return false; } return true; } bool CAgentServerParseData::PARSE_STORE_12_DATA(CModifyCharacter* lpCharacter, char* lpDataBuffer) { LPSTORE lpStore12 = reinterpret_cast(lpDataBuffer); Item::CDepositContainer& DepositContainer = lpCharacter->GetDeposit(); if(!DepositContainer.SerializeIn(lpStore12->Data, lpStore12->dwSize)) { ERRLOG0(g_Log, "PARSE_STORE_12_DATA ½ÇÆÐ (â°í12 ½Ã¸®¾ó¶óÀÌÁî ÀÎ ½ÇÆÐ)"); return false; } else { lpCharacter->SetOperationFlag(CCharacter::CHAR_INFO_LOADED); } return true; } bool CAgentServerParseData::PARSE_STORE_34_DATA(CModifyCharacter* lpCharacter, char* lpDataBuffer) { LPSTORE lpStore34 = reinterpret_cast(lpDataBuffer); Item::CDepositContainer& DepositContainer = lpCharacter->GetDeposit(); if(!DepositContainer.SerializeIn(lpStore34->Data, lpStore34->dwSize)) { ERRLOG0(g_Log, "PARSE_STORE_34_DATA ½ÇÆÐ (â°í34 ½Ã¸®¾ó¶óÀÌÁî ÀÎ ½ÇÆÐ)"); return false; } return true; }