/* TODO : REMOVE HERE #include "stdafx.h" #include "ObjectInfoFactory.h" #include #include #include #include #include #include using namespace BroadcastInfo; bool BroadcastInfo::SerializeOutAggresiveCreatureInfo(CAggresiveCreature& AggresiveCreature, DataType::Type eDataType, char* szBuffer_Out, unsigned long& dwBufferSize_InOut) { // ±âº» Á¤º¸ »ðÀÔ. unsigned long dwObjectSize = GetObjectSize(eDataType); if (0 != dwObjectSize && dwObjectSize <= dwBufferSize_InOut) { const Position& Pos = AggresiveCreature.GetCurrentPos(); SObject* lpObjectInfo = new (szBuffer_Out) SObject(AggresiveCreature.GetCID()); const MotionInfo& motionInfo = AggresiveCreature.GetMotionInfo(); lpObjectInfo->m_NetworkPos.Initialize(Pos.m_fPointX, Pos.m_fPointY, Pos.m_fPointZ, motionInfo.m_fDirection, (0 == motionInfo.m_dwFrame) ? 0.0f : motionInfo.m_fVelocity / motionInfo.m_dwFrame); lpObjectInfo->SetObjectType(ObjectType::AGGRESIVE_CREATURE); lpObjectInfo->SetDataType(eDataType); if (IsAggresiveCreatureInfo(eDataType)) { SAggresiveCreature* lpAggresiveCreatureInfo = static_cast(lpObjectInfo); std::copy(AggresiveCreature.GetEnchantInfo().m_dwStatusFlag, AggresiveCreature.GetEnchantInfo().m_dwStatusFlag + EnchantInfo::MAX_ARRAY, lpAggresiveCreatureInfo->m_EnchantInfo.m_dwStatusFlag); lpAggresiveCreatureInfo->m_nNowHP = AggresiveCreature.GetStatus().m_nNowHP; } dwBufferSize_InOut = dwObjectSize; return true; } dwBufferSize_InOut = 0; return false; } bool BroadcastInfo::SerializeOutMonsterInfo(CMonster& Monster, DataType::Type eDataType, char* szBuffer_Out, unsigned long& dwBufferSize_InOut) { if (BroadcastInfo::SerializeOutAggresiveCreatureInfo(Monster, eDataType, szBuffer_Out, dwBufferSize_InOut)) { SObject* lpObjectInfo = reinterpret_cast(szBuffer_Out); lpObjectInfo->SetObjectType(ObjectType::MONSTER); if (IsMonsterInfo(eDataType)) { Monster::SMonster* lpMonsterInfo = static_cast(lpObjectInfo); } return true; } return false; } bool BroadcastInfo::SerializeOutSummonMonsterInfo(CSummonMonster& SummonMonster, DataType::Type eDataType, char* szBuffer_Out, unsigned long& dwBufferSize_InOut) { if (BroadcastInfo::SerializeOutMonsterInfo(SummonMonster, eDataType, szBuffer_Out, dwBufferSize_InOut)) { SObject* lpObjectInfo = reinterpret_cast(szBuffer_Out); if (IsSummonMonsterInfo(eDataType)) { Monster::SSummonMonster* lpSummonMonsterInfo = static_cast(lpObjectInfo); CCharacter* lpMaster = SummonMonster.GetMaster(); if (NULL == lpMaster) { // ¿î¿µÀÚ ¸í·ÉÀ¸·Î ¼ÒȯÇÑ ¼Òȯ¼ö return true; } lpSummonMonsterInfo->m_dwMasterID = lpMaster->GetCID(); } lpObjectInfo->SetObjectType(ObjectType::SUMMON_MONSTER); return true; } return false; } */