Пример #1
0
	void trySend()
	{
		if (++m_tickcount < 60)
			return;

		m_tickcount = m_tickcount % 60;

		IntPtr addr = TssSdk.tss_get_report_data();

		if(ECGameSession.Instance().IsConnected == false)
			return;

		if (addr != IntPtr.Zero)
		{
			IntPtr anti_data = IntPtr.Zero;
			ushort anti_data_len = 0;
			if (TssSdk.Is64bit())
			{
				short anti_data_len_temp = Marshal.ReadInt16(addr, 0);
				Int64 anti_data_temp = Marshal.ReadInt64(addr, 2);
				anti_data_len = (ushort)anti_data_len_temp;
				anti_data = new IntPtr(anti_data_temp);
			}
			else if (TssSdk.Is32bit())
			{
				short anti_data_len_temp = Marshal.ReadInt16(addr, 0);
				Int64 anti_data_temp = Marshal.ReadInt32(addr, 2);
				anti_data_len = (ushort)anti_data_len_temp;
				anti_data = new IntPtr(anti_data_temp);

			}

			if (anti_data != IntPtr.Zero)
			{
				byte[] data = new byte[anti_data_len];
				Marshal.Copy(anti_data, data, 0, anti_data_len);

				GNET.Common.OctetsStream os = new GNET.Common.OctetsStream();
				os.marshal_long((long)m_roleId);
				os.marshal(data);
				int nProtolNum = 8910;
				CommonData netdata = new CommonData(nProtolNum, os);
				ECGameSession gs = ECGameSession.Instance();
				gs.SendNetData(netdata);

				TssSdk.tss_del_report_data(addr);
			}
		}

	}