Ejemplo n.º 1
0
	Packet Encode()
	{
		Packet packet;
		U32 scene_rot_pos_buff_len = 0;
		BYTE* scene_rot_pos_buff = m_scene_rot_pos->GetBytes(&scene_rot_pos_buff_len);
		packet.WriteBytes(scene_rot_pos_buff, scene_rot_pos_buff_len);
		U32 forward_buff_len = 0;
		BYTE* forward_buff = m_forward->GetBytes(&forward_buff_len);
		packet.WriteBytes(forward_buff, forward_buff_len);
		packet.WriteString(m_ani_name);
		packet.WriteI16(m_x_axis);
		packet.WriteU32(m_uid);
		packet.Encode(Msg::P_ACK_SCENE_MOVE);
		return packet;
	}
Ejemplo n.º 2
0
	Packet Encode()
	{
		Packet packet;
		U16 players_count = (U16)m_players.size();
		packet.WriteU16(players_count);
		for (list<MsgScenePlayer*>::iterator i = m_players.begin(); i != m_players.end(); i++)
		{
			U32 players_buff_len = 0;
			MsgScenePlayer* xx = (MsgScenePlayer*)*i;
			BYTE* players_buff = xx->GetBytes(&players_buff_len);
			packet.WriteBytes(players_buff, players_buff_len);
		}
		packet.Encode(Msg::P_ACK_SCENE_PLAYERS);
		return packet;
	}
Ejemplo n.º 3
0
 Packet Encode()
 {
     Packet packet;
     packet.WriteU8(m_id_u8);
     packet.WriteU16(m_id_u16);
     packet.WriteU32(m_id_u32);
     U16 repeat_id_u8_count = (U16)m_repeat_id_u8.size();
     packet.WriteU16(repeat_id_u8_count);
     for (list<U8>::iterator i = m_repeat_id_u8.begin(); i != m_repeat_id_u8.end(); i++)
     {
         packet.WriteU8((U8)*i);
     }
     packet.WriteU8(m_optional_id_u8_flag);
     if (m_optional_id_u8_flag == 1)
     {
         packet.WriteU8(m_optional_id_u8);
     }
     packet.Encode(Msg::P_ACK_TEST_X_X);
     return packet;
 }