Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
internetgamer007
Beginner


Joined: 27 Apr 2005
Posts: 22
Location: Portland, Oregon

PostPosted: Thu Sep 21, 2006 3:07 pm   

Sending text with preceding zeros ... not so much.
 
On one of the muds I play on, my password begins with two zeros.
When I type the password, CMUD only sends everything after the zeros.
For example, I type "00password" and it sends "password"

Is there a way to turn this off? Or is it not an option? :)


++ EDIT ++

Hmmm... turns out it *was* an option. I had to deselect Options -> Parse.
Okay, problem fixed. So, nevermind.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Sep 21, 2006 7:30 pm   
 
This is still a bug, and I verified it and added it to the bug list.

Actually, on my test, when I entered

00test

on the command line, it sent

0test

so it seems to condense multiple zeros to a single zero in my testing. The Option/Parse option shouldn't need to be turned off for this to work correctly which is why it's a bug.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Sep 21, 2006 9:23 pm   
 
Well, this turned out to be interesting. What was happening when 00password was entered is that it was being split into the following code:
Code:
INT 0
STR "password"
CONCAT

So, in fact, any leading zeros were going to get stripped. Entering "0123test" would just send "123test".

To fix this, I modified the parser so that after parsing a number, if it finds an alphabetic character next, then it goes back and treats the whole thing as a string instead. So now, in 1.07, when you enter "00password" it generates the proper code:
Code:
STR "00password"


There was only one remaining potential problem. If you entered just a number with leading zeros, like "0123" then it still just sent "123" to the MUD. This is because it was parsing this as an integer and not a string. So, I had to add some additional code to check for leading zeros. Now, in 1.07, when you enter "0123" it will properly send "0123" to the MUD.

So, thanks for reporting this. It uncovered some interesting problems in the parser.
Reply with quote
internetgamer007
Beginner


Joined: 27 Apr 2005
Posts: 22
Location: Portland, Oregon

PostPosted: Fri Sep 22, 2006 3:59 am   Woohoo!
 
I did it!

I contributed something, finally, and it turned out to be something good!

<does a little dance>

Okay, I'm done. Hahaha...
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net