예제 #1
0
    private void InformDraftDisplayOfChoices(List <NetCache.CardDefinition> choices)
    {
        DraftDisplay display = DraftDisplay.Get();

        if (display != null)
        {
            if (choices.Count == 0)
            {
                DraftDisplay.DraftMode mode;
                if (this.m_chest == null)
                {
                    mode = DraftDisplay.DraftMode.ACTIVE_DRAFT_DECK;
                    this.m_deckActiveDuringSession = true;
                }
                else
                {
                    mode = DraftDisplay.DraftMode.IN_REWARDS;
                }
                display.SetDraftMode(mode);
            }
            else
            {
                display.SetDraftMode(DraftDisplay.DraftMode.DRAFTING);
                display.AcceptNewChoices(choices);
            }
        }
    }
예제 #2
0
    private void OnError()
    {
        if (SceneMgr.Get().IsModeRequested(SceneMgr.Mode.DRAFT))
        {
            Network.DraftError draftError = Network.GetDraftError();
            DraftDisplay       display    = DraftDisplay.Get();
            switch (draftError)
            {
            case Network.DraftError.DE_UNKNOWN:
                Debug.LogError("DraftManager.OnError - UNKNOWN EXCEPTION - Talk to Brode or Fitch.");
                return;

            case Network.DraftError.DE_NO_LICENSE:
                Debug.LogWarning("DraftManager.OnError - No License.  What does this mean???");
                return;

            case Network.DraftError.DE_RETIRE_FIRST:
                Debug.LogError("DraftManager.OnError - You cannot start a new draft while one is in progress.");
                return;

            case Network.DraftError.DE_NOT_IN_DRAFT:
                if (display != null)
                {
                    display.SetDraftMode(DraftDisplay.DraftMode.NO_ACTIVE_DRAFT);
                }
                return;

            case Network.DraftError.DE_NOT_IN_DRAFT_BUT_COULD_BE:
                if (!Options.Get().GetBool(Option.HAS_SEEN_FORGE, false))
                {
                    DraftDisplay.Get().SetDraftMode(DraftDisplay.DraftMode.NO_ACTIVE_DRAFT);
                    return;
                }
                this.RequestDraftStart();
                return;

            case Network.DraftError.DE_FEATURE_DISABLED:
                Debug.LogError("DraftManager.OnError - The Arena is currently disabled. Returning to the hub.");
                if (!SceneMgr.Get().IsModeRequested(SceneMgr.Mode.HUB))
                {
                    SceneMgr.Get().SetNextMode(SceneMgr.Mode.HUB);
                    Error.AddWarningLoc("GLOBAL_FEATURE_DISABLED_TITLE", "GLOBAL_FEATURE_DISABLED_MESSAGE_FORGE", new object[0]);
                }
                return;
            }
            Debug.LogError("DraftManager.onError - UNHANDLED ERROR - please send this to Brode. ERROR: " + draftError.ToString());
        }
    }