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

            RegisterCommands();
        }
Пример #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());
 }
Пример #4
0
        void Awake()
        {
            socket = GetComponent <NetSocket>();

            socket.RegisterRpcListener(this);

            socket.Events.OnFailedToConnect   += ConnectionFailed;
            socket.Events.OnConnectedToServer += ConnectedToZone;
        }
Пример #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);
 }
Пример #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);
     }
 }
Пример #7
0
 internal RpcDispatcher(NetSocket socket)
 {
     Socket = socket;
 }
Пример #8
0
 private void Awake()
 {
     Socket      = GetComponent <NetSocket>();
     ViewManager = GetComponent <NetViewManager>();
     ViewManager.OnNetViewCreated += FullScopeCalculation;
 }
Пример #9
0
 internal RequestDispatcher(NetSocket socket)
 {
     Socket = socket;
 }