private void AddChangedPlayer(BnetPlayer player, BnetPlayerChangelist changelist)
 {
     if ((player != null) && !changelist.HasChange(player))
     {
         BnetPlayerChange change = new BnetPlayerChange();
         change.SetOldPlayer(player.Clone());
         change.SetNewPlayer(player);
         changelist.AddChange(change);
     }
 }
    private BnetPlayerChangelist ChangeGameField(BnetGameAccount hsGameAccount, uint fieldId, object val)
    {
        if (hsGameAccount == null)
        {
            return(null);
        }
        BnetPlayerChange change = new BnetPlayerChange();

        change.SetOldPlayer(this.m_myPlayer.Clone());
        change.SetNewPlayer(this.m_myPlayer);
        hsGameAccount.SetGameField(fieldId, val);
        BnetPlayerChangelist changelist = new BnetPlayerChangelist();

        changelist.AddChange(change);
        return(changelist);
    }
    private void CreateAccount(BnetAccountId id, BattleNet.PresenceUpdate update, BnetPlayerChangelist changelist)
    {
        BnetAccount account = new BnetAccount();

        this.m_accounts.Add(id, account);
        account.SetId(id);
        BnetPlayer player = null;

        if (!this.m_players.TryGetValue(id, out player))
        {
            player = new BnetPlayer();
            this.m_players.Add(id, player);
            BnetPlayerChange change = new BnetPlayerChange();
            change.SetNewPlayer(player);
            changelist.AddChange(change);
        }
        player.SetAccount(account);
        this.UpdateAccount(account, update, changelist);
    }