private static void RaisePartyError(PartyError error) { string message = string.Format("BnetParty: event={0} feature={1} code={2} partyId={3} type={4} strData={5}", new object[] { error.FeatureEvent.ToString(), (int)error.FeatureEvent, error.ErrorCode, error.PartyId, error.szPartyType, error.StringData }); LogLevel level = (!(error.ErrorCode == BattleNetErrors.ERROR_OK)) ? LogLevel.Error : LogLevel.Info; Log.Party.Print(level, message); if (BnetParty.OnError != null) { BnetParty.OnError(error); } }
public static void RequestInvite(PartyId partyId, BnetGameAccountId whomToAskForApproval, BnetGameAccountId whomToInvite, PartyType partyType) { if (BnetParty.IsLeader(partyId)) { PartyError error = default(PartyError); error.IsOperationCallback = true; error.DebugContext = "RequestInvite"; error.ErrorCode = BattleNetErrors.ERROR_INVALID_TARGET_ID; error.Feature = BnetFeature.Party; error.FeatureEvent = BnetFeatureEvent.Party_RequestPartyInvite_Callback; error.PartyId = partyId; error.szPartyType = EnumUtils.GetString <PartyType>(partyType); error.StringData = "leaders cannot RequestInvite - use SendInvite instead."; BnetParty.OnError(error); return; } EntityId partyId2 = partyId.ToEntityId(); EntityId whomToAskForApproval2 = BnetEntityId.CreateEntityId(whomToAskForApproval); EntityId whomToInvite2 = BnetEntityId.CreateEntityId(whomToInvite); string @string = EnumUtils.GetString <PartyType>(partyType); BattleNet.RequestPartyInvite(partyId2, whomToAskForApproval2, whomToInvite2, @string); }