public void Send(IRemote destination) { List <byte> rawData = new List <byte>(Size); rawData.AddRange(BitConverter.GetBytes((UInt16)Type)); rawData.Add(MessageIndex); rawData.AddRange(BitConverter.GetBytes(GameTime)); rawData.Add((byte)UserAction); if (Parameters != null && Parameters.Length > 0) { if (Parameters.Length > 255) { throw new ArgumentOutOfRangeException("More than 255 parameter bytes are not allowed."); } rawData.Add((byte)Parameters.Length); rawData.AddRange(Parameters); } else { rawData.Add(0); } destination.Send(rawData.ToArray()); }
public void Send(IRemote destination) { if (sendData == null) { throw new ExceptionFreeserf("No data to send."); } destination.Send(sendData); }
public void Send(IRemote destination) { List <byte> rawData = new List <byte>(Size); rawData.AddRange(BitConverter.GetBytes((UInt16)Type)); rawData.AddRange(BitConverter.GetBytes(GameTime)); destination.Send(rawData.ToArray()); }
public void Send(IRemote destination) { List <byte> rawData = new List <byte>(GetSize()); rawData.AddRange(BitConverter.GetBytes((UInt16)Type)); rawData.Add(Number); rawData.Add((byte)Request); destination?.Send(rawData.ToArray()); }
public void Send(IRemote destination) { List <byte> rawData = new List <byte>(Size); rawData.AddRange(BitConverter.GetBytes((UInt16)Type)); rawData.Add(MessageIndex); rawData.Add((byte)ResponseType); destination?.Send(rawData.ToArray()); }
public void Send(IRemote destination) { List <byte> rawData = new List <byte>(Size); rawData.AddRange(BitConverter.GetBytes((UInt16)Type)); rawData.Add(MessageIndex); rawData.AddRange(BitConverter.GetBytes(DateTime.UtcNow.ToBinary())); rawData.Add(PlayerId); destination.Send(rawData.ToArray()); }
public void Send(IRemote destination) { List <byte> rawData = new List <byte>(Size); rawData.AddRange(BitConverter.GetBytes((UInt16)Type)); rawData.Add(MessageIndex); rawData.AddRange(BitConverter.GetBytes(GameTime)); rawData.Add((byte)(Full ? 1 : 0)); rawData.AddRange(BitConverter.GetBytes((UInt32)SerializedData.Length)); rawData.AddRange(SerializedData); destination.Send(rawData.ToArray()); }