[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  MCCP on SWRIP1.0, SWR, or SMAUG

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: MCCP on SWRIP1.0, SWR, or SMAUG
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Wed 15 Jun 2005 06:24 PM (UTC)  quote  ]
Message
You actually don't need to cast both operands of a multiplication/division to float/double to get double precision. If the compiler detects that just one of them is floating point, it'll use fp-math. I tend to cast both as well, but it can sometimes save space.

Also, C++ lets you use the (IMO, at least) nicer format of casting: float(foo) instead of (float) foo. (Well, technically this isn't a cast, but it has the same effects.) Not sure if you're using C++ or not; I think I remember something about you moving to it a while ago. :)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Wed 15 Jun 2005 02:05 PM (UTC)  quote  ]
Message
This is the code that I use for my compression stats, feel free to take and modify:

                send_to_char("Compression Info:\n\r", ch);
                send_to_char("Compression: &B[&w", ch);
                if (IS_MXP(ch))
                        send_to_char(MXPTAG("mxptoggle compress"), ch);
                if (ch->desc->compressing)
                        send_to_char("ON ", ch);
                else
                {
                        send_to_char("OFF", ch);
                }
                if (IS_MXP(ch))
                        send_to_char(MXPTAG("/mxptoggle"), ch);
                send_to_char("&B]&D\n\r", ch);
                if (ch->desc->out_compress
                    && ch->desc->out_compress->total_in)
                        ch_printf(ch,
                                  "Total size of input compressed:  &B[&w%d&B]&D\n\r",
                                  ch->desc->out_compress->total_in);
                if (ch->desc->out_compress
                    && ch->desc->out_compress->total_out)
                        ch_printf(ch,
                                  "Total size of output compressed: &B[&w%d&B]&D\n\r",
                                  ch->desc->out_compress->total_out);
                if (ch->desc->out_compress && ch->desc->out_compress->total_in
                    && ch->desc->out_compress->total_out)
                        ch_printf(ch,
                                  "Current compression ratio:       &B[&w%.2f%&B]&D&D\n\r",
                                  (float) ((float) ch->desc->out_compress->
                                           total_out /
                                           (float) ch->desc->out_compress->
                                           total_in * 100));


I also know that the casting is terrible, I just never got around to fixing it... love that pedantic flag.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Wed 15 Jun 2005 02:53 AM (UTC)  quote  ]
Message
I think the MCCP snippets just compress the data. I'm pretty sure they have the before/after sizes there (you need them to compress/send, after all), but I imagine that you'll have to compute the ratios and store it all manually.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Tue 14 Jun 2005 10:28 PM (UTC)  quote  ]
Message
Well I know MUSHclient shows that data, but I don't know any snippets for the actual MUD.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Kasji   (27 posts)  [Biography] bio
Date Tue 14 Jun 2005 09:48 PM (UTC)  quote  ]
Message
Does anyone know how to add MCCP compression stats to a statistics command? I just used a patch to install the MCCP, though I had to do it manually, no autopatching such a heavily modified code.

I'm looking to see the total bytes compressed out and in if possible, and the compression ratio. Anyone know if this information is stored somewhere already, or if it has to be added from scratch?
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


1,488 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]