public BnetErrorInfo(BnetFeature feature, BnetFeatureEvent featureEvent, BattleNetErrors error, int context) { this.m_feature = feature; this.m_featureEvent = featureEvent; this.m_error = error; this.m_clientContext = context; }
public void CopyFrom(BattleNet.DllErrorInfo src) { this.m_feature = (BnetFeature)src.feature; this.m_featureEvent = (BnetFeatureEvent)src.featureEvent; this.m_error = (BattleNetErrors)src.code; this.m_clientContext = src.context; }
public void EnqueueErrorInfo(BnetFeature feature, BnetFeatureEvent featureEvent, BattleNetErrors error, int context = 0) { Log.BattleNet.Print(LogLevel.Warning, string.Format("Enqueuing BattleNetError {0} {1} code={2} context={3}", new object[] { feature.ToString(), featureEvent.ToString(), new Error(error), context })); this.m_errorEvents.Add(new BnetErrorInfo(feature, featureEvent, error)); }
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); }
public void SetFeatureEvent(BnetFeatureEvent featureEvent) { this.m_featureEvent = featureEvent; }
private static bool IsIgnorableError(BnetFeatureEvent feature, BattleNetErrors code) { HashSet <BattleNetErrors> hashSet; return(BnetParty.s_ignorableErrorCodes.TryGetValue(feature, out hashSet) && hashSet.Contains(code)); }
private static void RaisePartyError(bool isOperationCallback, string debugContext, BattleNetErrors errorCode, BnetFeature feature, BnetFeatureEvent featureEvent, PartyId partyId, string szPartyType, string stringData, string errorMessageFormat, params object[] args) { if (BnetParty.OnError == null) { return; } BnetParty.RaisePartyError(new PartyError { IsOperationCallback = isOperationCallback, DebugContext = debugContext, ErrorCode = errorCode, Feature = feature, FeatureEvent = featureEvent, PartyId = partyId, szPartyType = szPartyType, StringData = stringData }); }
private static void RaisePartyError(bool isOperationCallback, string szPartyType, BnetFeatureEvent featureEvent, string errorMessageFormat, params object[] args) { string debugContext = string.Format(errorMessageFormat, args); BnetParty.RaisePartyError(new PartyError { IsOperationCallback = isOperationCallback, DebugContext = debugContext, ErrorCode = BattleNetErrors.ERROR_OK, Feature = BnetFeature.Party, FeatureEvent = featureEvent, szPartyType = szPartyType }); }