示例#1
0
		/// <summary>
		/// Write a custom raw byte message with a 1 byte header across the network
		/// </summary>
		/// <param name="id"></param>
		/// <param name="netWorker"></param>
		/// <param name="data"></param>
		public static void WriteRaw(NetWorker netWorker, BMSByte data)
		{
			if (data == null)
			{
				netWorker.ThrowException(new NetworkException(1000, "The data being written can not be null"));
				return;
			}

			if (data.Size == 0)
			{
				netWorker.ThrowException(new NetworkException(1001, "The data being sent can't be empty"));
				return;
			}

			data.InsertRange(0, rawTypeIndicator);
			netWorker.WriteRaw(data);
		}
示例#2
0
		/// <summary>
		/// Write a custom raw byte message with a 1 byte header across the network
		/// </summary>
		/// <param name="id"></param>
		/// <param name="netWorker"></param>
		/// <param name="data"></param>
		public static void WriteRaw(NetWorker netWorker, BMSByte data, string uniqueId, bool reliable)
		{
			if (data == null)
			{
				netWorker.ThrowException(new NetworkException(1000, "The data being written can not be null"));
				return;
			}

			if (data.Size == 0)
			{
				netWorker.ThrowException(new NetworkException(1001, "The data being sent can't be empty"));
				return;
			}

			netWorker.WriteRaw(data, uniqueId, true, reliable);
		}