#ifndef _SOLAR_SLOT_SCSOCKETINFO_H #define _SOLAR_SLOT_SCSOCKETINFO_H #pragma once //================================================================================================== /// ¾ÆÀÌÅÛ ¼ÒÄÏ Á¤º¸ Ŭ·¡½º /** @author Kim Min Wook < taiyo@webzen.co.kr > @since 2006. 1. 9 @remark - ¹ÙÀ̳ʸ® ¼ÒÄÏ ¿É¼Ç ºÎºÐÀ» DecodeÇÑ Á¤º¸¸¦ ³ªÅ¸³¿ - SCItemSlotÀÇ ¸É¹ö·Î »ç¿ëµÊ - ¾ÆÀÌÅÛÂÊÀº eATTR_TYPEÀÇ ÃÖ´ë°ªÀÌ Å©±â¶§¹®¿¡ Á÷Á¢ ½ºÅ©¸³Æ®¿¡¼­ »ç¿ëÇÏÁö ¾Ê°í, µû·Î AttrIndex·Î eATTR_TYPE¿¡ ´ëÀÀÇÏ¿© °ªÀ» °¡Á®¿À´Â ¹æ½ÄÀ» ÃëÇÑ´Ù. (sRANK_ATTR_VALUEÀÇ ¸É¹ö m_AttrIndex -> m_AttrTypeÀ¸·Î ÄÁ¹öÆÃÀ» ÇÑ´Ù. Decode()½Ã) @note - m_AttrIndex == 0 : ¼Ó¼ºÀÌ ¾øÀ½ - 1 <= m_AttrIndex <= 31 : ¿É¼ÇÀÇ À妽º - eSOCKET_LEVELÀÇ °ª¿¡ µû¶ó SocketOption1,2,3ÀÇ °ªÀ» +0(ÇϱÞ),+31(»ó±Þ)À» ÇØÁØ´Ù. - ¼Ó¼º Á¸Àç ¿©ºÎ üũ ½Ã : GetSocketAttrIndex(sock) == 0 ¶Ç´Â GetSocketAttr(sock) == eATTR_TYPE_INVALID ¶Ç´Â //GetSocketAttrValue(sock) == 0 ÀÌ¸é ¼Ó¼ºÀº Á¸ÀçÇÏÁö ¾Ê´Â´Ù. @history - 09.09.06 | waverix | code rearrangement */ //================================================================================================== #include "ItemOptionHeader.h" #include "SCSlotStruct.h" #include class BitStream; //================================================================================================== // class SCSocketInfo { // ½ÇÁ¦ Slot¿¡¼­ »ç¿ëÇÏ´Â Á¤º¸ // ÇöÀç ¾ÆÀÌÅÛÀÌ °¡Áø ¿É¼Ç Á¤º¸ÀÇ ´©Àû°ª struct AttrValues { eSOCKET_LEVEL socket_level_; int attr_index_; eATTR_TYPE attr_type_; int attr_value_; const sSOCKET_OPTION* socket_option_; }; SCSocketInfo& GetEditableObject() const { return const_cast(*this); } void Clear(); //void Encode(BitStream& IN bitstream) const; //void Decode(BitStream& OUT bitstream); //void Encode(const WORD sub_type, OPTIONPART_VER5* OUT dest) const; //void Decode(const WORD sub_type, const OPTIONPART_VER5* IN src); const AttrValues& GetSocketAttrBlock(eSOCKET sock) const; private: void SetInfo(const nsSlot::SerializeItemOption::sEquip& src, const BASE_ITEMINFO* item_info); void SetInfo(const nsSlot::SerializeItemOption::sEquipTime& src, const BASE_ITEMINFO* item_info); void SetInfo(const nsSlot::SerializeItemOption::sEquipEtc& src, const BASE_ITEMINFO* item_info);//xiaomi fix accesory SocketOption void SetInfo(const nsSlot::SerializeItemOption::sEquipEtcTime& src, const BASE_ITEMINFO* item_info);//xiaomi fix accesory SocketOption void SetInfo(const nsSlot::SerializeItemOption::sLimited& src, const BASE_ITEMINFO* item_info); void SetInfo(const nsSlot::SerializeItemOption::sFate& src, const BASE_ITEMINFO* item_info); void GetInfo(nsSlot::SerializeItemOption::sEquip* dest); void GetInfo(nsSlot::SerializeItemOption::sEquipTime* dest); void GetInfo(nsSlot::SerializeItemOption::sEquipEtc* dest);//xiaomi fix accesory SocketOption void GetInfo(nsSlot::SerializeItemOption::sEquipEtcTime* dest);//xiaomi fix accesory SocketOption void GetInfo(nsSlot::SerializeItemOption::sLimited* dest); void GetInfo(nsSlot::SerializeItemOption::sFate* dest); //BYTE GetSocketNum() const { return number_of_sockets_; } //void SetSocketNum(BYTE num) { number_of_sockets_ = num; } void SetSocketAttr(eSOCKET sock, eSOCKET_LEVEL level, const sSOCKET_OPTION* socket_option); BOOLEAN CopySocketInfo(const SCSocketInfo& sock_info); void _SetInfo(ulong number_of_sockets, const ulong sockets[SOCKET_MAX], const BASE_ITEMINFO* item_info); void _GetInfo(ulong* number_of_sockets, ulong sockets[SOCKET_MAX]); int SocketIndexToBinary(const AttrValues* node) const; BOOLEAN BinaryToSocketIndex(int IN binary_index, int& OUT attr_index, eSOCKET_LEVEL& OUT level); static void _SetSocketAttr(SCSocketInfo::AttrValues* OUT dest, eSOCKET_LEVEL level, const sSOCKET_OPTION* socket_option); //---------------------------------------------------------------------------------------------- static const DWORD NumberOfBits_NumberOfSockets = 2; static const DWORD NumberOfBits_SocketIndex = 8; //---------------------------------------------------------------------------------------------- BYTE number_of_sockets_; AttrValues socket_attributes_[SOCKET_MAX]; AttrValues dummy_; friend class SCItemSlot; }; //-------------------------------------------------------------------------------------------------- inline void SCSocketInfo::Clear() { ZeroMemory(this, sizeof(*this)); } //inline void //SCSocketInfo::_SetInfo(ulong attr_index, const BASE_ITEMINFO* item_info) { // Clear(); // SLOT_BITBOUND_SET(attr_index, NumberOfBits_AttrIndex); // SetNOptionAttr(item_info->m_wType, item_info->m_LV, attr_index); //} // //inline void //SCSocketInfo::_GetInfo(ulong* attr_index) const { // *attr_index = attr_index_; // SLOT_BITBOUND_SET(*attr_index, NumberOfBits_AttrIndex); //} inline void SCSocketInfo::SetInfo(const nsSlot::SerializeItemOption::sEquip& src, const BASE_ITEMINFO* item_info) { _SetInfo(src.NumberOfSockets, src.SocketOption, item_info); } inline void SCSocketInfo::SetInfo(const nsSlot::SerializeItemOption::sEquipTime& src, const BASE_ITEMINFO* item_info) { _SetInfo(src.NumberOfSockets, src.SocketOption, item_info); } inline void SCSocketInfo::SetInfo(const nsSlot::SerializeItemOption::sEquipEtc& src, const BASE_ITEMINFO* item_info) {//xiaomi fix accesory SocketOption _SetInfo(src.NumberOfSockets, src.SocketOption, item_info); } inline void SCSocketInfo::SetInfo(const nsSlot::SerializeItemOption::sEquipEtcTime& src, const BASE_ITEMINFO* item_info) {//xiaomi fix accesory SocketOption _SetInfo(src.NumberOfSockets, src.SocketOption, item_info); } inline void SCSocketInfo::SetInfo(const nsSlot::SerializeItemOption::sLimited& src, const BASE_ITEMINFO* item_info) { _SetInfo(src.NumberOfSockets, src.SocketOption, item_info); } inline void SCSocketInfo::SetInfo(const nsSlot::SerializeItemOption::sFate& src, const BASE_ITEMINFO* item_info) { _SetInfo(src.NumberOfSockets, src.SocketOption, item_info); } inline void SCSocketInfo::GetInfo(nsSlot::SerializeItemOption::sEquip* dest) { _GetInfo(&dest->NumberOfSockets, dest->SocketOption); } inline void SCSocketInfo::GetInfo(nsSlot::SerializeItemOption::sEquipTime* dest) { _GetInfo(&dest->NumberOfSockets, dest->SocketOption); } inline void SCSocketInfo::GetInfo(nsSlot::SerializeItemOption::sEquipEtc* dest) { //xiaomi fix accesory SocketOption _GetInfo(&dest->NumberOfSockets, dest->SocketOption); } inline void SCSocketInfo::GetInfo(nsSlot::SerializeItemOption::sEquipEtcTime* dest) {//xiaomi fix accesory SocketOption _GetInfo(&dest->NumberOfSockets, dest->SocketOption); } inline void SCSocketInfo::GetInfo(nsSlot::SerializeItemOption::sLimited* dest) { _GetInfo(&dest->NumberOfSockets, dest->SocketOption); } inline void SCSocketInfo::GetInfo(nsSlot::SerializeItemOption::sFate* dest) { _GetInfo(&dest->NumberOfSockets, dest->SocketOption); } inline const SCSocketInfo::AttrValues& SCSocketInfo::GetSocketAttrBlock(eSOCKET sock) const { if(FlowControl::FCAssert(sock < SOCKET_MAX && sock < number_of_sockets_)) { return socket_attributes_[sock]; } return dummy_; } //================================================================================================== //================================================================================================== //================================================================================================== // #endif //_SOLAR_SLOT_SCSOCKETINFO_H