Patch for status command

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Postby mand1nga » Sat Dec 13, 2008 2:07 pm

Hey, I just made a quick reading at your code, here my comments:

Don't you cast hours as integers ?

I'd rather to check in just one place if the argument for status goes out of bounds (>2), if that is the case then you can answer with some default (like plain status or "status 1"). This way the code will be just a little bit cleaner and easier to maintain.

I haven't patched my SVN copy yet, I'll do it later and come back with comments.

Cheers
mand1nga
Alien trapper
 
Posts: 321
Joined: Mon May 12, 2008 12:19 am

Postby terencehill » Sat Dec 13, 2008 5:28 pm

Don't you cast hours as integers ?

I didn't touch the code to show the time.

I'd rather to check in just one place if the argument for status goes out of bounds (>2), if that is the case then you can answer with some default (like plain status or "status 1"). This way the code will be just a little bit cleaner and easier to maintain.

As i wrote, I've chosen this option: "Using parameters other than 0, 1 or 2, or using more parameters, it prints nothing.", since the previous behavior of status was to print nothing if any argument was given.
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby divVerent » Sat Dec 13, 2008 6:53 pm

That's good already. It sure will go in, as there is indeed no reason against now, and this code shouldn't be breaking anything (I haven't read it yet though, might need some cleaning up).

Now all you need is to do aesthetics... maybe make the colors look better... only such stuff left.

But why does it show an IP for your bots, and not "botclient"? That looks like a bug :P

BTW, status 1 looks good to parse. Maybe make it look less blinding by the colors (use less colors, that is)... then it could even become a new "standard" among quake engines (that be DP and FTE only, though). It also is fully and simply parsable (nicknames at the end, anything else is easily to find by word splitting).
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby terencehill » Sat Dec 13, 2008 10:16 pm

But why does it show an IP for your bots, and not "botclient"? That looks like a bug Razz

I've changed simply the code during the tests to show an IP instead of botclient.

Maybe make it look less blinding by the colors (use less colors, that is)...

I thought that the better thing was to give a color for each column so that they can be quickly distinguishable and nice to see...

Using less colors, maybe IPs and numbers yellow both, or yellow and green, dunno...
if u want, u can apply the patch and put the colors u like, or remove them all too...
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby Alien » Sun Dec 14, 2008 8:07 am

I miss the layout of the 1st post of yours.
Image[/img]
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby mand1nga » Sun Dec 14, 2008 10:29 pm

terencehill wrote:I didn't touch the code to show the time.


Sure, sorry for that, I've read the patch too quickly

As i wrote, I've chosen this option: "Using parameters other than 0, 1 or 2, or using more parameters, it prints nothing.", since the previous behavior of status was to print nothing if any argument was given.


My suggestion was at code level, but then I've patched dp and saw that your approach is very good. And I don't think that we need a new "status 3" in the short term, so maybe any other effort for improving this function is worthless.

It works like a charm here :D Nice job !!!!
mand1nga
Alien trapper
 
Posts: 321
Joined: Mon May 12, 2008 12:19 am

Postby divVerent » Mon Dec 15, 2008 8:36 am

I have one other suggestion for "status 1": can you make it also show packet loss (code for reading that is in the "pings" command)?
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby terencehill » Wed Dec 17, 2008 1:31 am

Changes:
* List more readable, using alternate colors for the rows
* status 2 now has the same style of status 1
* Added packetloss to status 1

screenshot:
http://sites.google.com/site/terencehill/Nexuiz/status_v3.jpg

patch:
http://sites.google.com/site/terencehill/Nexuiz/status_v3.patch
terencehill
Alien
 
Posts: 176
Joined: Thu Jul 10, 2008 10:33 pm
Location: Italy

Postby Alien » Wed Dec 17, 2008 5:57 am

Yeah, thanks for fixing status 2.
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby divVerent » Wed Dec 17, 2008 7:02 am

I really like this new display, which is easy on the eyes. I'll apply that patch then.

I did change it a bit though, since "status shjdlhjsdflhjdl" does print the regular status in previous DP svn.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

PreviousNext

Return to Nexuiz - Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron