コード例 #1
0
    // Token: 0x06000DD8 RID: 3544 RVA: 0x0005FD6C File Offset: 0x0005DF6C
    public static ProgressPopupDialog ShowProgress(string title, string text, Func <float> progress = null)
    {
        ProgressPopupDialog progressPopupDialog = new ProgressPopupDialog(title, text, progress);

        PopupSystem.Show(progressPopupDialog);
        return(progressPopupDialog);
    }
コード例 #2
0
    // Token: 0x0600134A RID: 4938 RVA: 0x00070B88 File Offset: 0x0006ED88
    public void JoinNetworkGame(GameRoom data)
    {
        if (data.Server != null)
        {
            float time = Time.time;
            ProgressPopupDialog dialog = PopupSystem.ShowProgress("Authentication", "Connecting to Server", () => Mathf.Clamp(Time.time - time, 0f, 3f));
            dialog.SetCancelable(delegate
            {
                PopupSystem.HideMessage(dialog);
            });
            Singleton <ChatManager> .Instance.InGameDialog.Clear();

            this.Client.JoinGame(data.Server.ConnectionString, data.Number, string.Empty);
        }
        else
        {
            PopupSystem.ShowError("Game not found", "The game doesn't exist anymore.", PopupSystem.AlertType.OK);
        }
    }
コード例 #3
0
    // Token: 0x06001313 RID: 4883 RVA: 0x00070084 File Offset: 0x0006E284
    private IEnumerator StartCreatingOnBestGameServer()
    {
        if (Singleton <GameServerController> .Instance.SelectedServer == null)
        {
            ProgressPopupDialog _autoJoinPopup = PopupSystem.ShowProgress(LocalizedStrings.LoadingGameList, LocalizedStrings.FindingAServerToJoin, null);
            yield return(UnityRuntime.StartRoutine(Singleton <GameServerManager> .Instance.StartUpdatingLatency(delegate(float progress)
            {
                _autoJoinPopup.Progress = progress;
            })));

            PhotonServer bestServer = Singleton <GameServerManager> .Instance.GetBestServer();

            if (bestServer == null)
            {
                PopupSystem.HideMessage(_autoJoinPopup);
                PopupSystem.ShowMessage("Could not find server", "No suitable server could be located! Please try again soon.");
                yield break;
            }
            Singleton <GameServerController> .Instance.SelectedServer = bestServer;
            PopupSystem.HideMessage(_autoJoinPopup);
        }
        PanelManager.Instance.OpenPanel(PanelType.CreateGame);
        yield break;
    }
コード例 #4
0
    // Token: 0x06001348 RID: 4936 RVA: 0x00070A08 File Offset: 0x0006EC08
    public void CreateNetworkGame(string server, int mapId, GameModeType mode, string name, string password, int timeMinutes, int killLimit, int playerLimit, int minLevel, int maxLevel, GameFlags.GAME_FLAGS flags)
    {
        GameRoomData data = new GameRoomData
        {
            Name        = name,
            Server      = new ConnectionAddress(server),
            MapID       = mapId,
            TimeLimit   = timeMinutes,
            PlayerLimit = playerLimit,
            GameMode    = mode,
            GameFlags   = (int)flags,
            KillLimit   = killLimit,
            LevelMin    = (byte)Mathf.Clamp(minLevel, 0, 255),
            LevelMax    = (byte)Mathf.Clamp(maxLevel, 0, 255)
        };
        float time = Time.time;
        ProgressPopupDialog dialog = PopupSystem.ShowProgress("Authentication", "Connecting to Server", () => Mathf.Clamp(Time.time - time, 0f, 3f));

        dialog.SetCancelable(delegate
        {
            PopupSystem.HideMessage(dialog);
        });
        this.Client.CreateGame(data, password);
    }
コード例 #5
0
 private AuthenticationManager()
 {
     _progress = new ProgressPopupDialog(LocalizedStrings.SettingUp, LocalizedStrings.ProcessingLogin, null);
 }