コード例 #1
0
 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);
         }
     }
 }
コード例 #2
0
 private void CacheMyAccountInfo()
 {
     if (this.m_idString == null)
     {
         BnetGameAccountId myGameAccountId = BnetPresenceMgr.Get().GetMyGameAccountId();
         if (myGameAccountId != null)
         {
             BnetPlayer myPlayer = BnetPresenceMgr.Get().GetMyPlayer();
             if (myPlayer != null)
             {
                 BnetAccountId accountId = myPlayer.GetAccountId();
                 if (accountId != null)
                 {
                     BnetBattleTag battleTag = myPlayer.GetBattleTag();
                     if (battleTag != null)
                     {
                         this.m_myGameAccountLo = myGameAccountId.GetLo();
                         StringBuilder builder = new StringBuilder();
                         builder.Append(accountId.GetHi());
                         builder.Append(',');
                         builder.Append(accountId.GetLo());
                         builder.Append(',');
                         builder.Append(myGameAccountId.GetHi());
                         builder.Append(',');
                         builder.Append(myGameAccountId.GetLo());
                         builder.Append(',');
                         builder.Append(battleTag.GetName());
                         builder.Append(',');
                         builder.Append(battleTag.GetNumber());
                         builder.Append(',');
                         builder.Append(BattleNet.GetVersion());
                         builder.Append(',');
                         builder.Append(BattleNet.GetEnvironment());
                         this.m_idString = builder.ToString();
                     }
                 }
             }
         }
     }
 }