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

            RegisterCommands();
        }
Exemplo n.º 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());
 }
Exemplo n.º 4
0
        void Awake()
        {
            socket = GetComponent <NetSocket>();

            socket.RegisterRpcListener(this);

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