Sign in to follow this  
Followers 0
amp

[Bug][0.2.0] /pubstats bug

6 posts in this topic

If understood it right, it must publish my stats to chat?

So, seems like a bug in there. In our hub we have limit of max 10 lines of text. So, hub bot replys to this command

<SpecialForce> Too many chat lines (>10):

-=[ ApexDC++ 0.2.0 ]=-

-=[ Uptime: 14 hours 21 min 27 sec ][ Cpu time: 1:09:47 ]=-

-=[ Memory usage (peak): 15,24 MB (45,91 MB) ]=-

-=[ Virtual memory usage (peak): 46,72 MB (56,48 MB) ]=-

-=[ Downloaded: 1005,10 MB ][ Uploaded: 2,37 GB ]=-

-=[ Total download: 145,36 GB ][ Total upload: 248,24 GB ]=-

-=[ System Uptime: 14 hours 29 min 54 sec ]=-

-=[ CPU Clock: 1800,127563 MHz ]=-

As we can see, output has only 8 lines... I misunderstood something or this is a bug?

Hub is running VerliHub.

Share this post


Link to post
Share on other sites

A line is missed at the top of the command, so its displayed equally.

It uses 9 lines AFAIK.

Share this post


Link to post
Share on other sites

But why error message appears?

If I do /stats and simply copy its output to chat, there is no problem.

Share this post


Link to post
Share on other sites

guessing here but does the text start (or/and end) with a character return/line feed

Share this post


Link to post
Share on other sites

All you need is to replace

snprintf(buf, sizeof(buf), "\n-=[ ApexDC++ %s ]=-\r\n-=[ Uptime: %s][ Cpu time: %s ]=-\r\n-=[ Memory usage (peak): %s (%s) ]=-\r\n-=[ Virtual memory usage (peak): %s (%s) ]=-\r\n-=[ Downloaded: %s ][ Uploaded: %s ]=-\r\n-=[ Total download: %s ][ Total upload: %s ]=-\r\n-=[ System Uptime: %s]=-\r\n-=[ CPU Clock: %f MHz ]=-",

with

snprintf(buf, sizeof(buf), "\r\n-=[ ApexDC++ %s ]=-\r\n-=[ Uptime: %s][ Cpu time: %s ]=-\r\n-=[ Memory usage (peak): %s (%s) ]=-\r\n-=[ Virtual memory usage (peak): %s (%s) ]=-\r\n-=[ Downloaded: %s ][ Uploaded: %s ]=-\r\n-=[ Total download: %s ][ Total upload: %s ]=-\r\n-=[ System Uptime: %s]=-\r\n-=[ CPU Clock: %f MHz ]=-",

And bug is gone.

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0