コード例 #1
0
 public static void GetPartyAttributeString(bgs.types.EntityId partyId, string attributeKey, out string value)
 {
     BattleNet.s_impl.GetPartyAttributeString(partyId, attributeKey, out value);
 }
コード例 #2
0
 public static void ClearPartyAttribute(bgs.types.EntityId partyId, string attributeKey)
 {
     BattleNet.s_impl.ClearPartyAttribute(partyId, attributeKey);
 }
コード例 #3
0
 public static void SetPartyAttributeBlob(bgs.types.EntityId partyId, string attributeKey, [In] byte[] value)
 {
     BattleNet.s_impl.SetPartyAttributeBlob(partyId, attributeKey, value);
 }
コード例 #4
0
 public static void RequestPartyInvite(bgs.types.EntityId partyId, bgs.types.EntityId whomToAskForApproval, bgs.types.EntityId whomToInvite, string szPartyType)
 {
     BattleNet.s_impl.RequestPartyInvite(partyId, whomToAskForApproval, whomToInvite, szPartyType);
 }
コード例 #5
0
 public static void KickPartyMember(bgs.types.EntityId partyId, bgs.types.EntityId memberId)
 {
     BattleNet.s_impl.KickPartyMember(partyId, memberId);
 }
コード例 #6
0
 public static void SetPartyPrivacy(bgs.types.EntityId partyId, int privacyLevel)
 {
     BattleNet.s_impl.SetPartyPrivacy(partyId, privacyLevel);
 }
コード例 #7
0
 public static void SendPartyInvite(bgs.types.EntityId partyId, bgs.types.EntityId inviteeId, bool isReservation)
 {
     BattleNet.s_impl.SendPartyInvite(partyId, inviteeId, isReservation);
 }
コード例 #8
0
 private void RequestPresenceFieldsCallback(bgs.types.EntityId entityId, RPCContext context)
 {
     if (base.CheckRPCCallback("RequestPresenceFieldsCallback", context))
     {
         foreach (Field fieldList in QueryResponse.ParseFrom(context.Payload).FieldList)
         {
             this.m_presenceCache.SetCache(entityId, fieldList.Key, fieldList.Value);
             PresenceUpdate boolValue = new PresenceUpdate()
             {
                 entityId   = entityId,
                 programId  = fieldList.Key.Program,
                 groupId    = fieldList.Key.Group,
                 fieldId    = fieldList.Key.Field,
                 index      = fieldList.Key.Index,
                 boolVal    = false,
                 intVal     = (long)0,
                 stringVal  = string.Empty,
                 valCleared = false,
                 blobVal    = new byte[0]
             };
             if (fieldList.Value.HasBoolValue)
             {
                 boolValue.boolVal = fieldList.Value.BoolValue;
             }
             else if (fieldList.Value.HasIntValue)
             {
                 boolValue.intVal = fieldList.Value.IntValue;
             }
             else if (!fieldList.Value.HasFloatValue)
             {
                 if (fieldList.Value.HasStringValue)
                 {
                     boolValue.stringVal = fieldList.Value.StringValue;
                 }
                 else if (fieldList.Value.HasBlobValue)
                 {
                     boolValue.blobVal = fieldList.Value.BlobValue;
                 }
                 else if (fieldList.Value.HasMessageValue)
                 {
                     if (fieldList.Key.Field != 8)
                     {
                         boolValue.blobVal = fieldList.Value.MessageValue;
                     }
                     else
                     {
                         this.FetchRichPresenceResource(fieldList.Value);
                         this.HandleRichPresenceUpdate(boolValue, fieldList.Key);
                     }
                 }
                 else if (fieldList.Value.HasFourccValue)
                 {
                     boolValue.stringVal = (new BnetProgramId(fieldList.Value.FourccValue)).ToString();
                 }
                 else if (!fieldList.Value.HasUintValue)
                 {
                     if (!fieldList.Value.HasEntityidValue)
                     {
                         boolValue.valCleared = true;
                     }
                     else
                     {
                         boolValue.entityIdVal.hi = fieldList.Value.EntityidValue.High;
                         boolValue.entityIdVal.lo = fieldList.Value.EntityidValue.Low;
                     }
                 }
             }
             this.m_presenceUpdates.Add(boolValue);
         }
     }
 }
コード例 #9
0
        private bool SubstituteVariables(out string substitutedString, string originalStr, bgs.types.EntityId entityId, int recurseDepth)
        {
            int    num;
            ulong  num1;
            bool   flag;
            string str;

            substitutedString = originalStr;
            int num2 = 0;

Label1:
            while (num2 < substitutedString.Length)
            {
                num2 = substitutedString.IndexOf("$0x", num2);
                if (num2 != -1)
                {
                    int length = num2 + "$0x".Length;
                    int num3   = this.LastIndexOfOccurenceFromIndex(substitutedString, PresenceAPI.hexChars, length);
                    int num4   = num3 + 1 - length;
                    num = num3 + 1 - num2;
                    string str1 = substitutedString.Substring(length, num4);
                    num1 = (ulong)0;
                    try
                    {
                        num1 = Convert.ToUInt64(str1, 16);
                        goto Label0;
                    }
                    catch (Exception exception)
                    {
                        base.ApiLog.LogWarning("Failed to convert {0} to ulong when substiting rich presence variables", new object[] { str1 });
                        flag = false;
                    }
                    return(flag);
                }
                else
                {
                    break;
                }
            }
            return(true);

Label0:
            if (!this.ResolveRichPresenceStrings(out str, entityId, num1, recurseDepth))
            {
                base.ApiLog.LogWarning("Failed resolve rich presence string for \"{0}\" when substiting variables in \"{1}\"", new object[] { num1, originalStr });
                return(false);
            }
            string str2 = substitutedString.Substring(num2, num);

            substitutedString = substitutedString.Replace(str2, str);
            goto Label1;
        }
コード例 #10
0
 public void CopyFrom(bgs.types.EntityId id)
 {
     this.m_hi = id.hi;
     this.m_lo = id.lo;
 }
コード例 #11
0
        public void HandlePresenceUpdates(ChannelState channelState, ChannelAPI.ChannelReferenceObject channelRef)
        {
            bgs.types.EntityId high = new bgs.types.EntityId();
            high.hi = channelRef.m_channelData.m_channelId.High;
            high.lo = channelRef.m_channelData.m_channelId.Low;
            FieldKey fieldKey = new FieldKey();

            fieldKey.SetProgram(BnetProgramId.BNET.GetValue());
            fieldKey.SetGroup(1);
            fieldKey.SetField(3);
            FieldKey fieldKey1 = fieldKey;
            List <PresenceUpdate> presenceUpdates = new List <PresenceUpdate>();

            foreach (FieldOperation fieldOperationList in channelState.FieldOperationList)
            {
                if (fieldOperationList.Operation != FieldOperation.Types.OperationType.CLEAR)
                {
                    this.m_presenceCache.SetCache(high, fieldOperationList.Field.Key, fieldOperationList.Field.Value);
                }
                else
                {
                    this.m_presenceCache.SetCache(high, fieldOperationList.Field.Key, null);
                }
                PresenceUpdate boolValue = new PresenceUpdate()
                {
                    entityId   = high,
                    programId  = fieldOperationList.Field.Key.Program,
                    groupId    = fieldOperationList.Field.Key.Group,
                    fieldId    = fieldOperationList.Field.Key.Field,
                    index      = fieldOperationList.Field.Key.Index,
                    boolVal    = false,
                    intVal     = (long)0,
                    stringVal  = string.Empty,
                    valCleared = false,
                    blobVal    = new byte[0]
                };
                if (fieldOperationList.Operation == FieldOperation.Types.OperationType.CLEAR)
                {
                    boolValue.valCleared = true;
                    bool program = fieldKey1.Program == fieldOperationList.Field.Key.Program;
                    bool group   = fieldKey1.Group == fieldOperationList.Field.Key.Group;
                    bool field   = fieldKey1.Field == fieldOperationList.Field.Key.Field;
                    if (program && group && field)
                    {
                        BnetEntityId bnetEntityId = BnetEntityId.CreateFromEntityId(boolValue.entityId);
                        this.m_battleNet.Friends.RemoveFriendsActiveGameAccount(bnetEntityId, fieldOperationList.Field.Key.Index);
                    }
                }
                else if (fieldOperationList.Field.Value.HasBoolValue)
                {
                    boolValue.boolVal = fieldOperationList.Field.Value.BoolValue;
                }
                else if (fieldOperationList.Field.Value.HasIntValue)
                {
                    boolValue.intVal = fieldOperationList.Field.Value.IntValue;
                }
                else if (fieldOperationList.Field.Value.HasStringValue)
                {
                    boolValue.stringVal = fieldOperationList.Field.Value.StringValue;
                }
                else if (fieldOperationList.Field.Value.HasFourccValue)
                {
                    boolValue.stringVal = (new BnetProgramId(fieldOperationList.Field.Value.FourccValue)).ToString();
                }
                else if (fieldOperationList.Field.Value.HasEntityidValue)
                {
                    boolValue.entityIdVal.hi = fieldOperationList.Field.Value.EntityidValue.High;
                    boolValue.entityIdVal.lo = fieldOperationList.Field.Value.EntityidValue.Low;
                    bool flag   = fieldKey1.Program == fieldOperationList.Field.Key.Program;
                    bool group1 = fieldKey1.Group == fieldOperationList.Field.Key.Group;
                    bool field1 = fieldKey1.Field == fieldOperationList.Field.Key.Field;
                    if (flag && group1 && field1)
                    {
                        BnetEntityId bnetEntityId1 = BnetEntityId.CreateFromEntityId(boolValue.entityId);
                        this.m_battleNet.Friends.AddFriendsActiveGameAccount(bnetEntityId1, fieldOperationList.Field.Value.EntityidValue, fieldOperationList.Field.Key.Index);
                    }
                }
                else if (fieldOperationList.Field.Value.HasBlobValue)
                {
                    boolValue.blobVal = fieldOperationList.Field.Value.BlobValue;
                }
                else if (!fieldOperationList.Field.Value.HasMessageValue)
                {
                    continue;
                }
                else if (fieldOperationList.Field.Key.Field != 8)
                {
                    continue;
                }
                else
                {
                    this.FetchRichPresenceResource(fieldOperationList.Field.Value);
                    this.HandleRichPresenceUpdate(boolValue, fieldOperationList.Field.Key);
                    continue;
                }
                presenceUpdates.Add(boolValue);
            }
            presenceUpdates.Reverse();
            this.m_presenceUpdates.AddRange(presenceUpdates);
        }
コード例 #12
0
 public static void GetPartySentInvites(bgs.types.EntityId partyId, out PartyInvite[] invites)
 {
     BattleNet.s_impl.GetPartySentInvites(partyId, out invites);
 }
コード例 #13
0
 public static void GetPartyMembers(bgs.types.EntityId partyId, out bgs.types.PartyMember[] members)
 {
     BattleNet.s_impl.GetPartyMembers(partyId, out members);
 }
コード例 #14
0
 public static void GetPartyInviteRequests(bgs.types.EntityId partyId, out InviteRequest[] requests)
 {
     BattleNet.s_impl.GetPartyInviteRequests(partyId, out requests);
 }
コード例 #15
0
 public static void LeaveParty(bgs.types.EntityId partyId)
 {
     BattleNet.s_impl.LeaveParty(partyId);
 }
コード例 #16
0
 public static void RequestPresenceFields(bool isGameAccountEntityId, [In] bgs.types.EntityId entityId, [In] PresenceFieldKey[] fieldList)
 {
     BattleNet.s_impl.RequestPresenceFields(isGameAccountEntityId, entityId, fieldList);
 }
コード例 #17
0
 public static void DissolveParty(bgs.types.EntityId partyId)
 {
     BattleNet.s_impl.DissolveParty(partyId);
 }
コード例 #18
0
 public static void SendFriendlyChallengeInvite(ref bgs.types.EntityId gameAccount, int scenarioId)
 {
     BattleNet.s_impl.SendFriendlyChallengeInvite(ref gameAccount, scenarioId);
 }
コード例 #19
0
 public static void AssignPartyRole(bgs.types.EntityId partyId, bgs.types.EntityId memberId, uint roleId)
 {
     BattleNet.s_impl.AssignPartyRole(partyId, memberId, roleId);
 }
コード例 #20
0
 public static void SetPartyDeck(ref bgs.types.EntityId partyId, long deckID)
 {
     BattleNet.s_impl.SetMyFriendlyChallengeDeck(ref partyId, deckID);
 }
コード例 #21
0
 public static void RevokePartyInvite(bgs.types.EntityId partyId, ulong invitationId)
 {
     BattleNet.s_impl.RevokePartyInvite(partyId, invitationId);
 }
コード例 #22
0
 public static void DeclineFriendlyChallenge(ref bgs.types.EntityId partyId)
 {
     BattleNet.s_impl.DeclineFriendlyChallenge(ref partyId);
 }
コード例 #23
0
 public static void IgnoreInviteRequest(bgs.types.EntityId partyId, bgs.types.EntityId requestedTargetId)
 {
     BattleNet.s_impl.IgnoreInviteRequest(partyId, requestedTargetId);
 }
コード例 #24
0
 public static void AcceptFriendlyChallenge(ref bgs.types.EntityId partyId)
 {
     BattleNet.s_impl.AcceptFriendlyChallenge(ref partyId);
 }
コード例 #25
0
 public static void SendPartyChatMessage(bgs.types.EntityId partyId, string message)
 {
     BattleNet.s_impl.SendPartyChatMessage(partyId, message);
 }
コード例 #26
0
 public static void RescindFriendlyChallenge(ref bgs.types.EntityId partyId)
 {
     BattleNet.s_impl.RescindFriendlyChallenge(ref partyId);
 }
コード例 #27
0
 public static void SetPartyAttributeString(bgs.types.EntityId partyId, string attributeKey, [In] string value)
 {
     BattleNet.s_impl.SetPartyAttributeString(partyId, attributeKey, value);
 }
コード例 #28
0
 public static void JoinParty(bgs.types.EntityId partyId, string partyType)
 {
     BattleNet.s_impl.JoinParty(partyId, partyType);
 }
コード例 #29
0
 public static int GetPartyPrivacy(bgs.types.EntityId partyId)
 {
     return(BattleNet.s_impl.GetPartyPrivacy(partyId));
 }
コード例 #30
0
 public static bool GetPartyAttributeLong(bgs.types.EntityId partyId, string attributeKey, out long value)
 {
     return(BattleNet.s_impl.GetPartyAttributeLong(partyId, attributeKey, out value));
 }