1
0
forked from cgvr/DeltaVR

deltavr multiplayer 2.0

This commit is contained in:
Toomas Tamm
2023-05-08 15:56:10 +03:00
parent 978809a002
commit 07b9b9e2f4
10937 changed files with 2968397 additions and 1521012 deletions

View File

@@ -0,0 +1,36 @@

using System;
using UnityEngine;
namespace FishNet.Managing.Transporting
{
/// <summary>
/// When inherited from this may be used with the TransportManager to alter messages before they are sent and received.
/// </summary>
public abstract class IntermediateLayer : MonoBehaviour
{
/// <summary>
/// TransportManager associated with this script.
/// </summary>
public TransportManager TransportManager { get; private set; }
/// <summary>
/// Called when data is received.
/// </summary>
/// <param name="src">Original data.</param>
/// <param name="fromServer">True if receiving from the server, false if from a client.</param>
/// <returns>Modified data.</returns>
public abstract ArraySegment<byte> HandleIncoming(ArraySegment<byte> src, bool fromServer);
/// <summary>
/// Called when data is sent.
/// </summary>
/// <param name="src">Original data.</param>
/// <param name="toServer">True if sending to the server, false if to a client.</param>
/// <returns>Modified data.</returns>
public abstract ArraySegment<byte> HandleOutoing(ArraySegment<byte> src, bool toServer);
internal void InitializeOnce(TransportManager manager) => TransportManager = manager;
}
}