private void Awake() { Socket = GetComponent <NetSocket>(); Socket.RegisterRpcListener(this); Socket.Events.OnPeerConnected += PeerConnected; Socket.Events.OnPeerDisconnected += PeerDisconnected; }
private void Awake() { Socket = GetComponent <NetSocket>(); Socket.Events.OnMessageReceived += ReceiveMessage; RegisterCommands(); }
public NetRequest(NetSocket socket, uint viewId, ushort requestId, float timeout = 3f) { this.socket = socket; this.viewId = viewId; this.timeout = timeout; this.requestId = requestId; WaitUntilDone = socket.StartCoroutine(RequestCoroutine()); }
void Awake() { socket = GetComponent <NetSocket>(); socket.RegisterRpcListener(this); socket.Events.OnFailedToConnect += ConnectionFailed; socket.Events.OnConnectedToServer += ConnectedToZone; }
internal NetConnection(bool isServer, bool isPeer, NetSocket socket, IPEndPoint endpoint, uint id = 0) { IsServer = isServer; IsPeer = isPeer; Socket = socket; Endpoint = endpoint; Id = id; Unreliable = new NetChannelUnreliable(this); Reliable = new NetChannelReliable(this); LastReceiveTime = LastSendTime = Created = NetTime.Milliseconds(); AddToGroup(0); }
/// <summary> Releases a stream back to the pool for reuse. This should be called once a stream is no longer needed. </summary> public void Release() { if (Pool.Count > MaxSize) { return; } Reset(); Connection = null; Socket = null; WriteLength = false; if (!Pool.Contains(this)) { Pool.Enqueue(this); } }
internal RpcDispatcher(NetSocket socket) { Socket = socket; }
private void Awake() { Socket = GetComponent <NetSocket>(); ViewManager = GetComponent <NetViewManager>(); ViewManager.OnNetViewCreated += FullScopeCalculation; }
internal RequestDispatcher(NetSocket socket) { Socket = socket; }