📄 gcnpcinfo.h
字号:
//--------------------------------------------------------------------------------// // Filename : GCNPCInfo.h // Written By : Reiot// Description : // //--------------------------------------------------------------------------------#ifndef __GC_NPC_INFO_H__#define __GC_NPC_INFO_H__// include files#include "Packet.h"#include "PacketFactory.h"#include "GameTime.h"#include "PCSlayerInfo2.h"#include "PCVampireInfo2.h"#include "InventoryInfo.h"#include "GearInfo.h"#include "ExtraInfo.h"#include "EffectInfo.h"#include "Assert.h"#include "RideMotorcycleInfo.h"#include "NPCInfo.h"#define FLAG_PREMIUM_ZONE 0x10 // premium栏肺 汲沥等 粮捞促.#define FLAG_PREMIUM_PLAY 0x01 // premium play甫 窍绰 吝牢啊?//--------------------------------------------------------------------------------//// class GCNPCInfo;//// 努扼捞攫飘啊 霸烙 辑滚俊 立加秦辑 CGConnect 菩哦阑 焊郴搁, 霸烙 辑滚绰 农府贸客// 家蜡 酒捞袍阑 肺爹秦辑 粮俊 甸绢哎 霖厚甫 窍霸 等促. 弊促澜 PC客 酒捞袍 沥焊,// 弊府绊 粮 沥焊甫 GCNPCInfo俊 淬酒辑 努扼捞攫飘肺 傈价窍霸 等促.////--------------------------------------------------------------------------------class GCNPCInfo : public Packet {public : // constructor GCNPCInfo() throw(); // destructor ~GCNPCInfo() throw(); // 涝仿胶飘覆(滚欺)栏肺何磐 单捞鸥甫 佬绢辑 菩哦阑 檬扁拳茄促. void read(SocketInputStream & iStream) throw(ProtocolException, Error); // 免仿胶飘覆(滚欺)栏肺 菩哦狼 官捞呈府 捞固瘤甫 焊辰促. void write(SocketOutputStream & oStream) const throw(ProtocolException, Error); // execute packet's handler void execute(Player* pPlayer) throw(ProtocolException, Error); // get packet id PacketID_t getPacketID() const throw() { return PACKET_GC_NPC_INFO; } // get packet's body size PacketSize_t getPacketSize() const throw() { PacketSize_t size = 0; size += szBYTE; list<NPCInfo*>::const_iterator itr = m_NPCInfos.begin(); for(; itr != m_NPCInfos.end(); itr++) { NPCInfo* pInfo = *itr; size += pInfo->getSize(); } return size; } // get packet name string getPacketName() const throw() { return "GCNPCInfo"; } // get packet's debug string string toString() const throw();//--------------------------------------------------// methods//--------------------------------------------------public : // get/set npc info void addNPCInfo(NPCInfo* pInfo) { m_NPCInfos.push_back(pInfo);} NPCInfo* popNPCInfo(void) { if (m_NPCInfos.empty()) return NULL; NPCInfo* pInfo = m_NPCInfos.front(); m_NPCInfos.pop_front(); return pInfo; }//--------------------------------------------------// data members//--------------------------------------------------private : // 泅犁 粮俊 粮犁窍绰 NPC甸俊 措茄 沥焊 list<NPCInfo*> m_NPCInfos;};//--------------------------------------------------------------------------------//// class GCNPCInfoFactory;//// Factory for GCNPCInfo////--------------------------------------------------------------------------------class GCNPCInfoFactory : public PacketFactory {public : // create packet Packet* createPacket() throw() { return new GCNPCInfo(); } // get packet name string getPacketName() const throw() { return "GCNPCInfo"; } // get packet id PacketID_t getPacketID() const throw() { return Packet::PACKET_GC_NPC_INFO; } // get packet's max body size // *OPTIMIZATION HINT* // const static GCNPCInfoPacketMaxSize 甫 沥狼, 府畔窍扼. PacketSize_t getPacketMaxSize() const throw() { PacketSize_t size = 0; size += szBYTE; size += NPCInfo::getMaxSize()* 255; return size; }};//--------------------------------------------------------------------------------//// class GCNPCInfoHandler;////--------------------------------------------------------------------------------class GCNPCInfoHandler {public : // execute packet's handler static void execute(GCNPCInfo* pPacket, Player* pPlayer) throw(ProtocolException, Error);};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -