Пример #1
0
 private void DisconnectIfConnected()
 {
     if ((NetworkService != null) && NetworkService.IsConnected)
     {
         NetworkService.Disconnect();
     }
 }
Пример #2
0
 private static void CleanPreviousScene()
 {
     InitConfigurationActivator.LauncherPassed = false;
     DisposeUrlLoaders();
     if ((NetworkService != null) && NetworkService.IsConnected)
     {
         NetworkService.Disconnect();
     }
     DestroyAllGameObjects();
 }
Пример #3
0
        public void Quit()
        {
            CurrentState = GameState.MainMenu;
            HideBoard();
            OnGameQuitSignal.Dispatch();

            if (NetworkService.IsConnected)
            {
                NetworkService.Disconnect();
            }
        }
Пример #4
0
        private void Disconnect()
        {
            networkService.Disconnect();
            WaveServices.SoundPlayer.StopAllSounds();
            //We create a new scene of the same class (myscene, playablescene, test, etc.) of the current scene
            WaveServices.UnregisterService <NetworkService>();
            WaveServices.RegisterService(new NetworkService());

            Scene         newScene      = Activator.CreateInstance(this.GetType()) as Scene;
            ScreenContext screenContext = new ScreenContext(newScene);

            WaveServices.ScreenContextManager.To(screenContext);
        }
Пример #5
0
 public bool Disconnect()
 {
     //do something, in this case show some text on the dialog
     gameobject.Disconnect();
     return(true);
 }
 private void Application_Exit(object sender, ExitEventArgs e)
 {
     NetworkService.Disconnect();
 }
Пример #7
0
 /// <summary>
 /// Intentionally disconnect from one specific peer.<br/>
 /// If we're a running client, this call is synonymous with calling <see cref="Close"/>.
 /// </summary>
 /// <param name="connection">The connection you want to close.</param>
 /// <returns>False, if the given connection is unknown, e.g. due to not longer being alive (already closed).</returns>
 public bool Disconnect(ConnectionHandle connection)
 {
     return(Net.Disconnect(connection));
 }