Exemplo n.º 1
0
    public static BnetErrorInfo CreateFromDll(BattleNet.DllErrorInfo src)
    {
        BnetErrorInfo info = new BnetErrorInfo();

        info.CopyFrom(src);
        return(info);
    }
 private void HandleLastFatalBnetError()
 {
     if (this.m_lastFatalBnetErrorInfo != null)
     {
         if (this.m_handleLastFatalBnetErrorNow)
         {
             Network.Get().OnFatalBnetError(this.m_lastFatalBnetErrorInfo);
             this.m_handleLastFatalBnetErrorNow = false;
         }
         else
         {
             string key = (ApplicationMgr.AllowResetFromFatalError == null) ? "GAMEPLAY_DISCONNECT_BODY" : "GAMEPLAY_DISCONNECT_BODY_RESET";
             if (GameMgr.Get().IsSpectator())
             {
                 key = (ApplicationMgr.AllowResetFromFatalError == null) ? "GAMEPLAY_SPECTATOR_DISCONNECT_BODY" : "GAMEPLAY_SPECTATOR_DISCONNECT_BODY_RESET";
             }
             AlertPopup.PopupInfo info = new AlertPopup.PopupInfo {
                 m_headerText       = GameStrings.Get("GAMEPLAY_DISCONNECT_HEADER"),
                 m_text             = GameStrings.Get(key),
                 m_showAlertIcon    = true,
                 m_responseDisplay  = AlertPopup.ResponseDisplay.OK,
                 m_responseCallback = new AlertPopup.ResponseCallback(this.OnBnetErrorResponse)
             };
             DialogManager.Get().ShowPopup(info);
         }
         this.m_lastFatalBnetErrorInfo = null;
     }
 }
Exemplo n.º 3
0
 public void CopyFrom(BattleNet.DllPartyEvent partyEvent)
 {
     this.eventName     = MemUtils.StringFromUtf8Ptr(partyEvent.eventName);
     this.eventData     = MemUtils.StringFromUtf8Ptr(partyEvent.eventData);
     this.partyId       = partyEvent.partyId;
     this.otherMemberId = partyEvent.otherMemberId;
     this.errorInfo     = BnetErrorInfo.CreateFromDll(partyEvent.errorInfo);
 }
Exemplo n.º 4
0
 private void BnetParty_OnPartyAttributeChanged_Error(PartyInfo party, string attributeKey, bnet.protocol.attribute.Variant value)
 {
     if (party.Type == PartyType.FRIENDLY_CHALLENGE)
     {
         if (this.DidReceiveChallenge() && value.HasIntValue)
         {
             object[] args = new object[] { value.IntValue };
             Log.Party.Print(LogLevel.Error, "BnetParty_OnPartyAttributeChanged_Error - code={0}", args);
             BnetErrorInfo info = new BnetErrorInfo(BnetFeature.Games, BnetFeatureEvent.Games_OnCreated, (BattleNetErrors)((uint)value.IntValue));
             GameMgr.Get().OnBnetError(info, null);
         }
         if (BnetParty.IsLeader(party.Id) && !value.IsNone())
         {
             BnetParty.ClearPartyAttribute(party.Id, attributeKey);
         }
     }
 }
 private bool OnBnetError(BnetErrorInfo info, object userData)
 {
     if (!Network.Get().OnIgnorableBnetError(info))
     {
         if (this.m_handleLastFatalBnetErrorNow)
         {
             return(true);
         }
         this.m_lastFatalBnetErrorInfo = info;
         switch (info.GetError())
         {
         case BattleNetErrors.ERROR_PARENTAL_CONTROL_RESTRICTION:
         case BattleNetErrors.ERROR_SESSION_DUPLICATE:
             this.m_handleLastFatalBnetErrorNow = true;
             break;
         }
     }
     return(true);
 }
Exemplo n.º 6
0
    private bool ShouldIgnoreErrorImpl(BnetErrorInfo errorInfo)
    {
        uint context = (uint)errorInfo.GetContext();

        if (context == 0)
        {
            return(false);
        }
        ClientRequestType clientRequest = this.GetClientRequest(context, "should_ignore_error", true);

        if (clientRequest == null)
        {
            return((this.GetDroppedRequest(context, "should_ignore", true) != null) || (this.GetPendingSendRequest(context, "should_ignore", true) != null));
        }
        BattleNetErrors error = errorInfo.GetError();

        if (clientRequest.IsSubsribeRequest)
        {
            if (clientRequest.System.SubscribeAttempt >= clientRequest.System.MaxResubscribeAttempts)
            {
                return(!clientRequest.ShouldRetryOnError);
            }
            return(true);
        }
        if (!clientRequest.ShouldRetryOnError)
        {
            return(true);
        }
        if (clientRequest.System.PendingResponseTimeout == 0)
        {
            return(false);
        }
        switch (error)
        {
        case (((BattleNetErrors)(BattleNetErrors.ERROR_INTERNAL && BattleNetErrors.ERROR_RPC_REQUEST_TIMED_OUT)) && BattleNetErrors.ERROR_GAME_UTILITY_SERVER_NO_SERVER):
            return(false);
        }
        return(this.ShouldIgnore_ERROR_GAME_UTILITY_SERVER_NO_SERVER(errorInfo, clientRequest));
    }
Exemplo n.º 7
0
    private bool OnBnetError(BnetErrorInfo info, object userData)
    {
        BnetFeature      feature      = info.GetFeature();
        BnetFeatureEvent featureEvent = info.GetFeatureEvent();

        if ((feature == BnetFeature.Friends) && (featureEvent == BnetFeatureEvent.Friends_OnSendInvitation))
        {
            string str;
            switch (info.GetError())
            {
            case BattleNetErrors.ERROR_OK:
                str = GameStrings.Get("GLOBAL_ADDFRIEND_SENT_CONFIRMATION");
                UIStatus.Get().AddInfo(str);
                return(true);

            case BattleNetErrors.ERROR_FRIENDS_FRIENDSHIP_ALREADY_EXISTS:
                str = GameStrings.Get("GLOBAL_ADDFRIEND_ERROR_ALREADY_FRIEND");
                UIStatus.Get().AddError(str);
                return(true);
            }
        }
        return(false);
    }
 private bool OnBnetError(BnetErrorInfo info, object userData)
 {
     object[] args = new object[] { info.GetFeatureEvent(), info.GetError() };
     Log.Mike.Print("BnetFriendMgr.OnBnetError() - event={0} error={1}", args);
     return(true);
 }
Exemplo n.º 9
0
 public bool ShouldIgnoreError(BnetErrorInfo errorInfo)
 {
     return(this.ShouldIgnoreErrorImpl(errorInfo));
 }
Exemplo n.º 10
0
 private bool ShouldIgnore_ERROR_GAME_UTILITY_SERVER_NO_SERVER(BnetErrorInfo errorInfo, ClientRequestType clientRequest)
 {
     this.ScheduleResubscribeWithNewRoute(clientRequest.System);
     return(true);
 }
Exemplo n.º 11
0
 public void SetErrorInfo(BnetErrorInfo errorInfo)
 {
     this.m_errorInfo = errorInfo;
 }
Exemplo n.º 12
0
 public static BnetWhisper CreateFromDll(BattleNet.DllWhisper src)
 {
     return new BnetWhisper { m_speakerId = BnetGameAccountId.CreateFromDll(src.speakerId), m_receiverId = BnetGameAccountId.CreateFromDll(src.receiverId), m_message = MemUtils.StringFromUtf8Ptr(src.message), m_timestampMicrosec = src.timestampMicrosec, m_errorInfo = BnetErrorInfo.CreateFromDll(src.errorInfo) };
 }