Vixen
02b45cc4
csharp
public static class NetworkPayload

Puts the kind byte on, and takes it off.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Deliberately a byte rather than bits: a snapshot is bit-packed and a call is bit-packed, and both would have to be shifted by a bit to make room for a smaller marker. One byte a packet, against a snapshot's hundreds, is the cheaper trade — and it keeps the two decoders reading from a byte boundary, which is where their first field expects to be.

Methods (2)

  • public static bool TryWrap(PayloadKind kind, ReadOnlySpan<byte> payload, Span<byte> buffer, out ReadOnlySpan<byte> wrapped)

    Writes a payload with its kind in front of it.

  • public static bool TryUnwrap(ReadOnlySpan<byte> wrapped, out PayloadKind kind, out ReadOnlySpan<byte> payload)

    Reads the kind off the front of a payload.

Used by (6)

  • GameClientMultiplayer
  • GameServerMultiplayer
  • PayloadRecorderVixen.Net.Tests
  • PredictedInputTestsVixen.Net.Tests
  • RpcOverSessionTestsVixen.Net.Tests
  • SessionRpcTransportVixen.Net