MCGalaxy icon indicating copy to clipboard operation
MCGalaxy copied to clipboard

Minor cosmetic overflow.

Open rdebath opened this issue 2 years ago • 4 comments

The number of blocks since login wraps at a quite "low" value, maybe it should just overflow to "a lot".

> /info
BobTheBuilder (BobTheBuilder+) has:
  Rank of SuperOP, wrote 4886 messages
  66 deaths, 0/3 (0%) awards
  Modified 95573158724 blocks, -512100804 since login
    46279578 placed, 836171928 deleted, 77252624673 drawn
...

Also some commas would be nice in those big numbers.

rdebath avatar Nov 15 '21 11:11 rdebath

number of blocks modified in the session is stored as an int because I didn't think someone would ever change more than two billion blocks in one session public int SessionModified;

Probably just need to change to a long

UnknownShadow200 avatar Nov 15 '21 11:11 UnknownShadow200

I've just noticed something else on that example, specifically it says "836171928 deleted". but now it's saying:

BobTheBuilder (BobTheBuilder+) has:
  Rank of SuperOP, wrote 5334 messages
  72 deaths, 0/3 (0%) awards
  Modified 128941368738 blocks
    46279578 placed, 59796257 deleted, 103344141179 drawn

It seems that when they're saved on logout the placed and deleted are "Packed" into the top of a 64bit int and are only given 26bits. That is a maximum of 67108864, or 12 wraparounds just on that example. The total modified is also now 46% of the way to it's 38bit wrap around.

BTW: If the modified supposed to be the sum of the other three, that's about 25 billion missing.

rdebath avatar Feb 20 '22 08:02 rdebath

I combined total modified/drawn and total placed/deleted into one value (on the assumption no one would place/delete over 67 million blocks) to maintain the exact same Players table schema as MCForge, which in retrospect is probably unnecessary


Adding , does have the downside of making it quicker for the placed/deleted/drawn line to wrap image

UnknownShadow200 avatar Feb 22 '22 13:02 UnknownShadow200

This is the time I say that the "correct" solution to the wrapping is to update the "LongerMessages" extension so that Server->Client gets the same advantages and wrapping happens client side, where the width of the font is known.

Buuuut, if you use a no-break-space between the number and the "drawn" I think it looks better now.


As long as you don't make any of the columns "NOT NULL" extra cols will be given NULL on insert and unchanged on update, so yes extra columns don't hurt SQL tables.


WRT to the count, sorry to disappoint, but I'm at 65% (44033389) on a guest login (2d2t). It's actually about 16 days to wrap 64M running one session with default anti-spam. Though it's taken a lot longer in real time 'cause we're impatient and use teams to speed up the blocks/s if a given run takes more than an couple of hours. If I hadn't got impatient I would have wrapped it by now.

rdebath avatar Feb 22 '22 19:02 rdebath