/// <summary> /// Creates a new <see>FriendUser</see>. /// </summary> /// <param name="index">The 0-based index of the user's location.</param> /// <param name="accountName">The account name of the friend.</param> /// <param name="status">The friend's current status.</param> /// <param name="locationType">The friend's current location information.</param> /// <param name="product">The product with which the friend is currently logged on, otherwise <see langword="null" />.</param> /// <param name="location">The name of the friend's current location.</param> public FriendUser(int index, string accountName, FriendStatus status, FriendLocation locationType, Product product, string location) { m_index = index; m_acctName = accountName; m_status = status; m_location = locationType; m_product = product; m_locationName = location; }
private static FriendUser __ParseNewFriend(DataReader dr, int i) { string acct = dr.ReadCString(); FriendStatus status = (FriendStatus)dr.ReadByte(); FriendLocation location = (FriendLocation)dr.ReadByte(); string productID = dr.ReadDwordString(0); Product prod = null; string locationName = string.Empty; if (location == FriendLocation.Offline) { dr.Seek(1); } else { prod = Product.GetByProductCode(productID); locationName = dr.ReadCString(); } FriendUser friend = new FriendUser(i, acct, status, location, prod, locationName); return(friend); }