コード例 #1
0
        private void NetworkHandler_NetworkInitializingFinished(InitializeNetworkHandler handler)
        {
            try
            {
                handler.NetworkInitializingFinished -= NetworkHandler_NetworkInitializingFinished;

                ConnectionLobby.Status = handler.Message;

                if (!handler.Error)
                {
                    Network = handler.Network;

                    SessionInformation = new SessionConnectParameters(handler.ConnectParameters.ServerIP, ParentControl.NetworkDeathHandler, Network.ClientSession);
                    ShowReconnectOptions();

                    if (handler.ConnectParameters.GameReconnect)
                    {
                        ParentControl.StatusControl.SetReconnecting();
                        ParentControl.SwitchMode(GameMode.Status);
                    }
                    else
                    {
                        ParentControl.OptionControl.SetServerIP(handler.ConnectParameters.ServerIP.ToString());
                        ParentControl.SwitchMode(GameMode.Options);
                    }
                }
            }
            finally
            {
                Connecting = false;
            }
        }
コード例 #2
0
        private void HandleInitResponse(ServerInitializeGameResponse initResponse)
        {
            if (initResponse.m_players == null || initResponse.m_ball == null || initResponse.m_field == null)
            {
                IntiializeDelayedCancel();
                StatusLobby.SetStatus("Invalid server response!");
                return;
            }

            ParentControl.GameControl.InitializeGame(initResponse.m_players, initResponse.m_field, initResponse.m_ball);
            ParentControl.SwitchMode(GameMode.Game);
        }
コード例 #3
0
        private void ApplyConfiguration()
        {
            switch (GameOptionLobby.SelectedOption)
            {
            case RequestOptions.Matchmaking:
                ParentControl.RegistrationControl.MaxPlayers = GameOptionLobby.PlayerCount;
                ParentControl.RegistrationControl.ResetSelection();
                ParentControl.SwitchMode(GameMode.Registration);
                break;

            case RequestOptions.Observe:
                Network.SendClientObserve(GameOptionLobby.PlayerCount);
                ParentControl.SwitchMode(GameMode.Status);
                break;
            }
        }
コード例 #4
0
 private void Cancel()
 {
     ParentControl.SwitchMode(GameMode.Connect);
 }
コード例 #5
0
 private void OnReady()
 {
     Network.SendClientQueueMatchmaking(MaxPlayers, RegistrationLobby.PlayerTeamWishes);
     ParentControl.SwitchMode(GameMode.Status);
 }
コード例 #6
0
ファイル: GameControl.cs プロジェクト: ThoenigAdrian/PingPong
 private void SetGameFinished(ServerGameControlPackage package)
 {
     ParentControl.FinishControl.ProcessFinishPackage(package);
     ParentControl.SwitchMode(GameMode.Finish);
 }