Beispiel #1
0
        /// <summary>
        /// Creates the messenger buddy string of this user information and returns it.
        /// </summary>
        public override string ToString()
        {
            fuseStringBuilder FSB = new fuseStringBuilder();
            FSB.appendWired(this.ID);
            FSB.appendClosedValue(this.Username);
            FSB.appendWired(this.Sex == 'M');
            FSB.appendClosedValue(messengerMotto);

            bool isOnline = ObjectTree.Game.Users.userIsLoggedIn(this.ID);
            FSB.appendWired(isOnline);

            if (isOnline) // User is online
            {
                Session userSession = ObjectTree.Game.Users.getUserSession(this.ID);
                if (userSession.inRoom)
                {
                    if (userSession.roomInstance.Information.isUserFlat)
                        FSB.Append("Floor1a");
                    else
                        FSB.Append(userSession.roomInstance.Information.Name);
                }
                this.lastActivity = DateTime.Now;
            }
            else
                FSB.Append("Hotel View");

            FSB.appendChar(2);
            FSB.appendClosedValue(this.messengerLastActivity);
            FSB.appendClosedValue(this.Figure);

            return FSB.ToString();
        }
Beispiel #2
0
        /// <summary>
        /// Creates the messenger textmessage message of this string and returns it.
        /// </summary>
        public override string ToString()
        {
            fuseStringBuilder FSB = new fuseStringBuilder();
            FSB.appendWired(this.ID);
            FSB.appendWired(this.senderID);
            FSB.appendClosedValue(this.sentString);
            FSB.appendClosedValue(this.Body);

            return FSB.ToString();
        }
Beispiel #3
0
        /// <summary>
        /// Converts this floor item to a string representation and returns it.
        /// </summary>
        public override string ToString()
        {
            /* Format example: public space object
             * 2732 invisichair 27 32 1 2
            */

            /* Format example: furniture
             * 802610
             * chair_polyfon
             * PB PA I I H 0.0
             * 0,0,0
             * 
             * H data
             */

            fuseStringBuilder FSB = new fuseStringBuilder();
            if (!this.Definition.Behaviour.isPublicSpaceObject)
            {
                FSB.appendClosedValue(this.ID.ToString());
                FSB.appendClosedValue(this.Definition.Sprite);

                FSB.appendWired(this.X);
                FSB.appendWired(this.Y);
                FSB.appendWired(this.Definition.Length);
                FSB.appendWired(this.Definition.Width);
                FSB.appendWired(this.Rotation);
                FSB.appendClosedValue(stringFunctions.formatFloatForClient(this.Z));

                FSB.appendClosedValue(this.Definition.Color);
                FSB.appendClosedValue(null);

                FSB.appendWired(this.teleporterID);
                FSB.appendClosedValue(this.customData);
            }
            else
            {
                FSB.appendWhiteSpacedValue(this.ID.ToString());
                FSB.appendWhiteSpacedValue(this.Definition.Sprite);
                FSB.appendWhiteSpacedValue(this.X.ToString());
                FSB.appendWhiteSpacedValue(this.Y.ToString());
                FSB.appendWhiteSpacedValue(this.Z.ToString());
                FSB.Append(this.Rotation.ToString());
                FSB.appendChar(13);
            }

            return FSB.ToString();
        }
Beispiel #4
0
        /// <summary>
        /// Returns the favorite rooms of a given user as a string.
        /// </summary>
        /// <param name="User">The userInformation object of the user to retrieve the favorite rooms for.</param>
        public string getFavoriteRooms(userInformation User)
        {
            int guestRoomCount = 0;
            StringBuilder Rooms = new StringBuilder();

            Database Database = new Database(false, true);
            Database.addParameterWithValue("userid", User.ID);
            Database.Open();
            DataTable dTable = Database.getTable("SELECT rooms.*,users.username AS owner FROM rooms LEFT JOIN users ON rooms.ownerid = users.id WHERE rooms.id IN (SELECT roomid FROM rooms_favorites WHERE userid = @userid) ORDER BY rooms.id DESC LIMIT 30"); // User flats first

            foreach (DataRow dRow in dTable.Rows)
            {
                roomInformation Room = roomInformation.Parse(dRow, true);
                if (Room.isUserFlat)
                    guestRoomCount++;

                Rooms.Append(Room.ToString(User));
            }

            fuseStringBuilder FSB = new fuseStringBuilder();
            FSB.appendWired(guestRoomCount);
            FSB.Append(Rooms.ToString());

            return FSB.ToString();
        }
Beispiel #5
0
        /// <summary>
        /// Returns the string representation of this arcade game for display in the game list.
        /// </summary>
        public string ToSummaryString()
        {
            fuseStringBuilder FSB = new fuseStringBuilder();
            FSB.appendWired(this.ID);
            FSB.appendClosedValue(this.Title);

            arcadeGamePlayer pOwner = this.getOwnerPlayer();
            if (pOwner != null)
            {
                FSB.appendWired(pOwner.roomUnitID);
                FSB.appendClosedValue(pOwner.Username);
            }
            else
            {
                FSB.appendWired(-1);
                FSB.appendClosedValue("???");
            }

            FSB.appendWired(this.mapID);

            return FSB.ToString();
        }
Beispiel #6
0
        /// <summary>
        /// Returns a string with the usernames of the users in this room.
        /// </summary>
        public string getUserList()
        {
            fuseStringBuilder FSB = new fuseStringBuilder();
            if (!this.Information.isUserFlat)
            {
                FSB.appendWired(this.roomID);
                lock (this.roomUsers)
                {
                    FSB.appendWired(this.roomUsers.Count);
                    foreach (roomUser lRoomUser in this.roomUsers.Values)
                    {
                        FSB.appendClosedValue(lRoomUser.Session.User.Username);
                    }
                }
            }

            return FSB.ToString();
        }
Beispiel #7
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();
        }
Beispiel #8
0
        /// <summary>
        /// Creates the user details string for use with message 5. ('@E')
        /// </summary>
        public override string ToString()
        {
            fuseStringBuilder FSB = new fuseStringBuilder();
            FSB.appendClosedValue(this.sessionID.ToString());
            FSB.appendClosedValue(this.Username);
            FSB.appendClosedValue(this.Figure);
            FSB.appendClosedValue(this.Sex.ToString());
            FSB.appendClosedValue(this.Motto);
            FSB.appendWired(this.Tickets);
            FSB.appendClosedValue(null); // Pool figure
            FSB.appendWired(this.Film);

            return FSB.ToString();
        }