コード例 #1
0
ファイル: messengerBuddy.cs プロジェクト: habb0/Woodpecker
        /// <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 = 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);
                }
                else
                    FSB.Append("on Hotel View");
            }
            else
                FSB.Append(this.messengerLastActivity);
            FSB.appendChar(2);

            return FSB.ToString();
        }
コード例 #2
0
ファイル: itemStripHandler.cs プロジェクト: habb0/Woodpecker
        /// <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();
        }
コード例 #3
0
ファイル: itemInstance.cs プロジェクト: habb0/Woodpecker
        /// <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();
        }
コード例 #4
0
ファイル: roomInformation.cs プロジェクト: habb0/Woodpecker
        /// <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();
        }