예제 #1
0
 /// <summary>
 /// Returns the max amount of buddies a given user can have on his buddy list for the messenger. The user's role and club subscription is being checked.
 /// </summary>
 /// <param name="User">The userInformation object containing the values to calculate the length with.</param>
 public int getMaxBuddyListLength(userInformation User)
 {
     if (User.hasFuseRight("fuse_extended_buddylist"))
         return this._maxBuddyListLength_Extended;
     else
         return this._maxBuddyListLength;
 }
예제 #2
0
        /// <summary>
        /// Parses the generic roomInformation object to a room information string.
        /// </summary>
        /// <param name="viewingUser">The userInformation object of the user that requests the flat information string.</param>
        public string ToString(userInformation viewingUser)
        {
            fuseStringBuilder FSB = new fuseStringBuilder();
            FSB.appendWired(this.ID); // Room ID
            if (!this.isUserFlat) // Public space flag
                FSB.appendWired(true);

            FSB.appendClosedValue(this.Name); // Room name

            if (this.isUserFlat) // User flat
            {
                if (this.showOwner || this.ownerID == viewingUser.ID || viewingUser.hasFuseRight("fuse_see_all_roomowners"))
                    FSB.appendClosedValue(this.Owner);
                else
                    FSB.Append("-");
                FSB.appendClosedValue(this.accessType.ToString());
            }

            FSB.appendWired(this.currentVisitors);
            FSB.appendWired(this.maxVisitors);

            if (!this.isUserFlat)
                FSB.appendWired(this.categoryID);

            FSB.appendClosedValue(this.Description);
            if (!this.isUserFlat)
            {
                FSB.appendWired(this.ID);
                FSB.appendWired(false);
                FSB.appendClosedValue(this.CCTs);
                FSB.appendWired(false);
                FSB.appendWired(true);
            }

            return FSB.ToString();
        }