public void RemoveFriend(BnetAccountId account)
 {
     if (this.m_state == FriendsAPIState.INITIALIZED)
     {
         EntityId val = new EntityId();
         val.SetLow(account.GetLo());
         val.SetHigh(account.GetHi());
         GenericFriendRequest request = new GenericFriendRequest();
         request.SetTargetId(val);
         GenericFriendRequest message = request;
         if (!message.IsInitialized)
         {
             base.ApiLog.LogWarning("Battle.net Friends API C#: Failed to RemoveFriend.");
             base.m_battleNet.EnqueueErrorInfo(BnetFeature.Friends, BnetFeatureEvent.Friends_OnRemoveFriend, BattleNetErrors.ERROR_API_NOT_READY, 0);
         }
         else
         {
             base.m_rpcConnection.QueueRequest(this.m_friendsService.Id, 8, message, new RPCContextDelegate(this.RemoveFriendCallback), 0);
         }
     }
 }
Esempio n. 2
0
        public void RemoveFriend(BnetAccountId account)
        {
            if (this.m_state != FriendsAPI.FriendsAPIState.INITIALIZED)
            {
                return;
            }
            bnet.protocol.EntityId entityId = new bnet.protocol.EntityId();
            entityId.SetLow(account.GetLo());
            entityId.SetHigh(account.GetHi());
            GenericFriendRequest genericFriendRequest = new GenericFriendRequest();

            genericFriendRequest.SetTargetId(entityId);
            GenericFriendRequest genericFriendRequest1 = genericFriendRequest;

            if (!genericFriendRequest1.IsInitialized)
            {
                base.ApiLog.LogWarning("Battle.net Friends API C#: Failed to RemoveFriend.");
                this.m_battleNet.EnqueueErrorInfo(BnetFeature.Friends, BnetFeatureEvent.Friends_OnRemoveFriend, BattleNetErrors.ERROR_API_NOT_READY, 0);
                return;
            }
            this.m_rpcConnection.QueueRequest(this.m_friendsService.Id, 8, genericFriendRequest1, new RPCContextDelegate(this.RemoveFriendCallback), 0);
        }