📄 ggguildchat.h
字号:
//----------------------------------------------------------------------// // Filename : GGGuildChat.h // Written By : Reiot// Description : // //----------------------------------------------------------------------#ifndef __GG_GUILD_CHAT_H__#define __GG_GUILD_CHAT_H__// include files#include "DatagramPacket.h"#include "PacketFactory.h"//----------------------------------------------------------------------//// class GGGuildChat;////----------------------------------------------------------------------class GGGuildChat : public DatagramPacket {public : // Datagram 按眉俊辑何磐 单捞鸥甫 佬绢辑 菩哦阑 檬扁拳茄促. void read(Datagram & iDatagram) throw(ProtocolException, Error); // Datagram 按眉肺 菩哦狼 官捞呈府 捞固瘤甫 焊辰促. void write(Datagram & oDatagram) 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_GG_GUILD_CHAT; } // get packet's body size PacketSize_t getPacketSize() const throw() { return szGuildID + // GuildID szBYTE + m_Sender.size() + // Sender szuint + // Color szBYTE + m_Message.size(); // Message } // get packet name string getPacketName() const throw() { return "GGGuildChat"; } // get packet's debug string string toString() const throw();public : // get/set Guild ID GuildID_t getGuildID() const throw() { return m_GuildID; } void setGuildID( GuildID_t guildID ) throw() { m_GuildID = guildID; } // get/set Sender const string& getSender() const throw() { return m_Sender; } void setSender( const string& sender ) throw() { m_Sender = sender; } // get/set text color uint getColor() const throw() { return m_Color; } void setColor( uint color ) throw() { m_Color = color; } // get/set message const string& getMessage() const throw() { return m_Message; } void setMessage( const string& message ) throw() { m_Message = message; }private : // Guild ID GuildID_t m_GuildID; // Sender string m_Sender; // text color uint m_Color; // message string m_Message;};////////////////////////////////////////////////////////////////////////// class GGGuildChatFactory;//// Factory for GGGuildChat////////////////////////////////////////////////////////////////////////class GGGuildChatFactory : public PacketFactory {public : // create packet Packet* createPacket() throw() { return new GGGuildChat(); } // get packet name string getPacketName() const throw() { return "GGGuildChat"; } // get packet id PacketID_t getPacketID() const throw() { return Packet::PACKET_GG_GUILD_CHAT; } // get packet's max body size // *OPTIMIZATION HINT* // const static GGGuildChatPacketMaxSize 甫 沥狼, 府畔窍扼. PacketSize_t getPacketMaxSize() const throw() { return szGuildID + // GuildID szBYTE + 10 + // Sender szuint + // Color szBYTE + 128; // Message }};////////////////////////////////////////////////////////////////////////// class GGGuildChatHandler;////////////////////////////////////////////////////////////////////////class GGGuildChatHandler { public : // execute packet's handler static void execute(GGGuildChat* pPacket) throw(ProtocolException, Error);};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -