Exemple #1
0
 private void Awake()
 {
     Socket = GetComponent <NetSocket>();
     Socket.RegisterRpcListener(this);
     Socket.Events.OnPeerConnected    += PeerConnected;
     Socket.Events.OnPeerDisconnected += PeerDisconnected;
 }
Exemple #2
0
        private void Awake()
        {
            Socket = GetComponent <NetSocket>();
            Socket.Events.OnMessageReceived += ReceiveMessage;

            RegisterCommands();
        }
Exemple #3
0
 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());
 }
Exemple #4
0
        void Awake()
        {
            socket = GetComponent <NetSocket>();

            socket.RegisterRpcListener(this);

            socket.Events.OnFailedToConnect   += ConnectionFailed;
            socket.Events.OnConnectedToServer += ConnectedToZone;
        }
Exemple #5
0
 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);
 }
Exemple #6
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);
     }
 }
Exemple #7
0
 internal RpcDispatcher(NetSocket socket)
 {
     Socket = socket;
 }
 private void Awake()
 {
     Socket      = GetComponent <NetSocket>();
     ViewManager = GetComponent <NetViewManager>();
     ViewManager.OnNetViewCreated += FullScopeCalculation;
 }
 internal RequestDispatcher(NetSocket socket)
 {
     Socket = socket;
 }