예제 #1
0
        /// <summary>
        /// Generates the trade box for a given session and returns it as as string.
        /// </summary>
        /// <param name="Session">The Woodpecker.Sessions.Session object to generate the trade box string for.</param>
        public string generateTradeBox(Session Session)
        {
            fuseStringBuilder Box = new fuseStringBuilder();

            if (Session.itemStripHandler.isTrading)
            {
                Box.appendTabbedValue(Session.User.Username);
                Box.appendTabbedValue(Session.itemStripHandler.tradeAccept.ToString().ToLower());
                Box.Append(Session.itemStripHandler.getTradeOfferItems());
                Box.appendChar(13);
            }

            return(Box.ToString());
        }
예제 #2
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.customData);
                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());
        }
예제 #3
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 = Engine.Game.Users.userIsLoggedIn(this.ID);

            FSB.appendWired(isOnline);

            if (isOnline) // User is online
            {
                Session userSession = Engine.Game.Users.getUserSession(this.ID);
                if (userSession == null)
                {
                    FSB.Append("Hotel View");
                }
                else
                {
                    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(messengerLastActivity);
            FSB.appendClosedValue(this.Figure);

            return(FSB.ToString());
        }
예제 #4
0
        /// <summary>
        /// Converts the required fields from this object to a user flat information string. The 'show owner username' property is handled here as well, by checking the permissions of the given user.
        /// </summary>
        /// <param name="viewingUser">The userInformation object of the user that requests the flat information string.</param>
        /// <returns></returns>
        public string ToUserFlatString()
        {
            fuseStringBuilder FSB = new fuseStringBuilder();

            FSB.appendTabbedValue(this.ID.ToString());
            FSB.appendTabbedValue(this.Name);
            FSB.appendTabbedValue(this.Owner);

            FSB.appendTabbedValue(this.accessType.ToString());
            FSB.appendTabbedValue("x");
            FSB.appendTabbedValue(this.currentVisitors.ToString());
            FSB.appendTabbedValue(this.maxVisitors.ToString());
            FSB.appendTabbedValue("null");
            FSB.appendTabbedValue(this.Description);
            FSB.appendTabbedValue(this.Description);
            FSB.appendChar(13);

            return(FSB.ToString());
        }
예제 #5
0
        /// <summary>
        /// Returns a string with all the string representations of all the wall items in this room instance.
        /// </summary>
        /// <returns></returns>
        public string getWallItems()
        {
            if (this.Information.isUserFlat)
            {
                fuseStringBuilder FSB = new fuseStringBuilder();
                lock (this.wallItems)
                {
                    foreach (wallItem lItem in this.wallItems)
                    {
                        FSB.Append(lItem.ToString());
                        FSB.appendChar(13);
                    }
                }

                return FSB.ToString();
            }
            else
                return "";
        }
예제 #6
0
        /// <summary>
        /// Returns a string with all the string representations of all the wall items in this room instance.
        /// </summary>
        /// <returns></returns>
        public string getWallItems()
        {
            if (this.Information.isUserFlat)
            {
                fuseStringBuilder FSB = new fuseStringBuilder();
                lock (this.wallItems)
                {
                    foreach (wallItem lItem in this.wallItems)
                    {
                        FSB.Append(lItem.ToString());
                        FSB.appendChar(13);
                    }
                }

                return(FSB.ToString());
            }
            else
            {
                return("");
            }
        }
예제 #7
0
        /// <summary>
        /// Creates the messenger buddy status string of this user information and returns it.
        /// </summary>
        public string ToStatusString()
        {
            fuseStringBuilder FSB = new fuseStringBuilder();

            FSB.appendWired(this.ID);
            FSB.appendClosedValue(messengerMotto);

            bool isOnline = Engine.Game.Users.userIsLoggedIn(this.ID);

            FSB.appendWired(isOnline);

            if (isOnline) // User is online
            {
                Session userSession = Engine.Game.Users.getUserSession(this.ID);
                if (userSession.inRoom)
                {
                    if (userSession.roomInstance.Information.isUserFlat)
                    {
                        FSB.Append("Floor1a");
                    }
                    else
                    {
                        FSB.Append(userSession.roomInstance.Information.Name);
                    }
                }
                else
                {
                    FSB.Append("on Hotel View");
                }
            }
            else
            {
                FSB.Append(messengerLastActivity);
            }
            FSB.appendChar(2);

            return(FSB.ToString());
        }