public static void IgnoreInviteRequest(PartyId partyId, BnetGameAccountId requestedTargetId) { EntityId partyId2 = partyId.ToEntityId(); EntityId requestedTargetId2 = BnetEntityId.CreateEntityId(requestedTargetId); BattleNet.IgnoreInviteRequest(partyId2, requestedTargetId2); }
public static Variant GetPartyAttributeVariant(PartyId partyId, string attributeKey) { Variant variant = new Variant(); EntityId partyId2 = partyId.ToEntityId(); long intValue; if (BattleNet.GetPartyAttributeLong(partyId2, attributeKey, out intValue)) { variant.IntValue = intValue; } else { string text; BattleNet.GetPartyAttributeString(partyId2, attributeKey, out text); if (text != null) { variant.StringValue = text; } else { byte[] array; BattleNet.GetPartyAttributeBlob(partyId2, attributeKey, out array); if (array != null) { variant.BlobValue = array; } } } return(variant); }
public static KeyValuePair <string, object>[] GetAllPartyAttributes(PartyId partyId) { if (partyId == null) { return(new KeyValuePair <string, object> [0]); } string[] array; BattleNet.GetAllPartyAttributes(partyId.ToEntityId(), out array); KeyValuePair <string, object>[] array2 = new KeyValuePair <string, object> [array.Length]; for (int i = 0; i < array2.Length; i++) { string text = array[i]; object value = null; long? partyAttributeLong = BnetParty.GetPartyAttributeLong(partyId, text); if (partyAttributeLong != null) { value = partyAttributeLong; } string partyAttributeString = BnetParty.GetPartyAttributeString(partyId, text); if (partyAttributeString != null) { value = partyAttributeString; } byte[] partyAttributeBlob = BnetParty.GetPartyAttributeBlob(partyId, text); if (partyAttributeBlob != null) { value = partyAttributeBlob; } array2[i] = new KeyValuePair <string, object>(text, value); } return(array2); }
public static void RevokeSentInvite(PartyId partyId, ulong inviteId) { if (!BnetParty.IsInParty(partyId)) { return; } BattleNet.RevokePartyInvite(partyId.ToEntityId(), inviteId); }
public static int CountMembers(PartyId partyId) { if (partyId == null) { return(0); } return(BattleNet.GetCountPartyMembers(partyId.ToEntityId())); }
public static void SendChatMessage(PartyId partyId, string chatMessage) { if (!BnetParty.IsInParty(partyId)) { return; } BattleNet.SendPartyChatMessage(partyId.ToEntityId(), chatMessage); }
public static PrivacyLevel GetPrivacyLevel(PartyId partyId) { if (partyId == null) { return(PrivacyLevel.CLOSED); } return((PrivacyLevel)BattleNet.GetPartyPrivacy(partyId.ToEntityId())); }
public static void SetPrivacy(PartyId partyId, PrivacyLevel privacyLevel) { if (!BnetParty.IsInParty(partyId)) { return; } EntityId partyId2 = partyId.ToEntityId(); BattleNet.SetPartyPrivacy(partyId2, (int)privacyLevel); }
public static byte[] GetPartyAttributeBlob(PartyId partyId, string attributeKey) { if (partyId == null) { return(null); } byte[] result; BattleNet.GetPartyAttributeBlob(partyId.ToEntityId(), attributeKey, out result); return(result); }
public static InviteRequest[] GetInviteRequests(PartyId partyId) { if (partyId == null) { return(new InviteRequest[0]); } InviteRequest[] result; BattleNet.GetPartyInviteRequests(partyId.ToEntityId(), out result); return(result); }
public static PartyInvite[] GetSentInvites(PartyId partyId) { if (partyId == null) { return(new PartyInvite[0]); } PartyInvite[] result; BattleNet.GetPartySentInvites(partyId.ToEntityId(), out result); return(result); }
public static void DissolveParty(PartyId partyId) { if (!BnetParty.IsInParty(partyId)) { return; } EntityId partyId2 = partyId.ToEntityId(); BattleNet.DissolveParty(partyId2); }
public static string GetPartyAttributeString(PartyId partyId, string attributeKey) { if (partyId == null) { return(null); } string result; BattleNet.GetPartyAttributeString(partyId.ToEntityId(), attributeKey, out result); return(result); }
public static void KickMember(PartyId partyId, BnetGameAccountId memberId) { if (!BnetParty.IsInParty(partyId)) { return; } EntityId partyId2 = partyId.ToEntityId(); EntityId memberId2 = BnetEntityId.CreateEntityId(memberId); BattleNet.KickPartyMember(partyId2, memberId2); }
public static void SendInvite(PartyId toWhichPartyId, BnetGameAccountId recipientId) { if (!BnetParty.IsInParty(toWhichPartyId)) { return; } EntityId partyId = toWhichPartyId.ToEntityId(); EntityId inviteeId = BnetEntityId.CreateEntityId(recipientId); BattleNet.SendPartyInvite(partyId, inviteeId, false); }
public static bool IsPartyFull(PartyId partyId, bool includeInvites = true) { if (partyId == null) { return(false); } int num = BnetParty.CountMembers(partyId); int num2 = (!includeInvites) ? 0 : BnetParty.GetSentInvites(partyId).Length; int maxPartyMembers = BattleNet.GetMaxPartyMembers(partyId.ToEntityId()); return(num + num2 >= maxPartyMembers); }
public static void SetLeader(PartyId partyId, BnetGameAccountId memberId) { if (!BnetParty.IsInParty(partyId)) { return; } EntityId partyId2 = partyId.ToEntityId(); EntityId memberId2 = BnetEntityId.CreateEntityId(memberId); PartyType partyType = BnetParty.GetPartyType(partyId); uint leaderRoleId = PartyMember.GetLeaderRoleId(partyType); BattleNet.AssignPartyRole(partyId2, memberId2, leaderRoleId); }
public static long?GetPartyAttributeLong(PartyId partyId, string attributeKey) { if (partyId == null) { return(null); } long value; if (BattleNet.GetPartyAttributeLong(partyId.ToEntityId(), attributeKey, out value)) { return(new long?(value)); } return(null); }
public static PartyMember[] GetMembers(PartyId partyId) { if (partyId == null) { return(new PartyMember[0]); } PartyMember[] array; BattleNet.GetPartyMembers(partyId.ToEntityId(), out array); PartyMember[] array2 = new PartyMember[array.Length]; for (int i = 0; i < array2.Length; i++) { PartyMember partyMember = array[i]; array2[i] = new PartyMember { GameAccountId = BnetGameAccountId.CreateFromEntityId(partyMember.memberGameAccountId), RoleIds = new uint[] { partyMember.firstMemberRole } }; } return(array2); }
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); }
public static void SetPartyAttributeBlob(PartyId partyId, string attributeKey, byte[] value) { BattleNet.SetPartyAttributeBlob(partyId.ToEntityId(), attributeKey, value); }
public static void SetPartyAttributeString(PartyId partyId, string attributeKey, string value) { BattleNet.SetPartyAttributeString(partyId.ToEntityId(), attributeKey, value); }
public static void ClearPartyAttribute(PartyId partyId, string attributeKey) { BattleNet.ClearPartyAttribute(partyId.ToEntityId(), attributeKey); }
public static void JoinParty(PartyId partyId, PartyType partyType) { EntityId partyId2 = partyId.ToEntityId(); BattleNet.JoinParty(partyId2, EnumUtils.GetString <PartyType>(partyType)); }