private void AddFriendInternal(BnetEntityId entityId) { if (entityId == null) { return; } FriendsUpdate friendsUpdate = default(FriendsUpdate); friendsUpdate.action = 1; friendsUpdate.entity1 = entityId; this.m_updateList.Add(friendsUpdate); this.m_battleNet.Presence.PresenceSubscribe(BnetEntityId.CreateForProtocol(entityId)); this.m_friendEntityId.Add(entityId, new Map <ulong, bnet.protocol.EntityId>()); this.m_friendsCount = (uint)this.m_friendEntityId.Count; }
private void RemoveFriendInternal(BnetEntityId entityId) { if (entityId == null) { return; } FriendsUpdate friendsUpdate = default(FriendsUpdate); friendsUpdate.action = 2; friendsUpdate.entity1 = entityId; this.m_updateList.Add(friendsUpdate); this.m_battleNet.Presence.PresenceUnsubscribe(BnetEntityId.CreateForProtocol(entityId)); if (this.m_friendEntityId.ContainsKey(entityId)) { foreach (bnet.protocol.EntityId current in this.m_friendEntityId[entityId].Values) { this.m_battleNet.Presence.PresenceUnsubscribe(current); } this.m_friendEntityId.Remove(entityId); } this.m_friendsCount = (uint)this.m_friendEntityId.Count; }