	public:
		unsigned char channel;
		unsigned char emotion;
		int srcroleid;
		int dstroleid;
		unsigned int dstlocalsid;
		Octets msg;
		Octets data;
		enum { PROTOCOL_TYPE = PROTOCOL_CHATSINGLECAST };
	public:
		ChatSingleCast() { type = PROTOCOL_CHATSINGLECAST; }
		ChatSingleCast(void*) : Protocol(PROTOCOL_CHATSINGLECAST) { }
		ChatSingleCast (unsigned char l_channel,unsigned char l_emotion,int l_srcroleid,
			int l_dstroleid,unsigned int l_dstlocalsid,const Octets& l_msg,
			const Octets& l_data)
			 : channel(l_channel),emotion(l_emotion),srcroleid(l_srcroleid)
			,dstroleid(l_dstroleid),dstlocalsid(l_dstlocalsid),msg(l_msg)
			,data(l_data)
		{
			type = PROTOCOL_CHATSINGLECAST;
		}

		ChatSingleCast(const ChatSingleCast &rhs)
			: Protocol(rhs),channel(rhs.channel),emotion(rhs.emotion),srcroleid(rhs.srcroleid)
			,dstroleid(rhs.dstroleid),dstlocalsid(rhs.dstlocalsid),msg(rhs.msg)
			,data(rhs.data) { }

		GNET::Protocol *Clone() const { return new ChatSingleCast(*this); }

		OctetsStream& marshal(OctetsStream & os) const
		{
			os << channel;
			os << emotion;
			os << srcroleid;
			os << dstroleid;
			os << dstlocalsid;
			os << msg;
			os << data;
			return os;
		}

		const OctetsStream& unmarshal(const OctetsStream &os)
		{
			os >> channel;
			os >> emotion;
			os >> srcroleid;
			os >> dstroleid;
			os >> dstlocalsid;
			os >> msg;
			os >> data;
			return os;
		}

		int PriorPolicy( ) const { return 1; }

		bool SizePolicy(size_t size) const { return size <= 1024; }
