Ejemplo n.º 1
0
        //
        // Generic
        //

        private void NewSocket()
        {
            currentSocket = new NetworkSocket(owner);
            currentSocket.OnNewNetworkConnection          += CurrentSocket_OnNewNetworkConnection;
            currentSocket.OnNetworkConnectionReady        += CurrentSocket_OnNetworkConnectionReady;
            currentSocket.OnNetworkConnectionDisconnected += CurrentSocket_OnNetworkConnectionDisconnected;
            currentSocket.OnShutdown += CurrentSocket_OnShutdown;
        }
        public NetworkConnection(NetworkSocket networkSocket, int connectionID)
        {
            this.connectionID  = connectionID;
            this.networkSocket = networkSocket;
            DevTools.Logger.Log(NetworkService.NetworkLog, "New Connection: {}", () => new object[] { connectionID });

            // Register this connection to receive updates on scene changes.
            if (networkSocket.IsHost)
            {
                ServiceLocator.SceneService.OnLoadScene += Host_OnLoadScene;
                Host_OnLoadScene(ServiceLocator.SceneService.CurrentLoaded);
            }
            else
            {
                ServiceLocator.SceneService.OnFinishedLoading += Client_OnFinishedLoading;
            }
        }
Ejemplo n.º 3
0
 public NetworkWriterWrapper(NetworkSocket socket)
 {
     this.socket = socket;
     this.writer = new NetworkWriter();
 }