 |
Rainchild Wizard

Joined: 10 Oct 2000 Posts: 1551 Location: Australia
|
Posted: Wed Nov 26, 2008 3:25 am
Parser crunches IP addresses |
#sh 172.20.4.101
will actually display 172.2.4.101
#mxp <relocate 172.20.4.101 23>
will cause the redirect to go to 172.2.4.101 |
|
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Wed Nov 26, 2008 6:50 am |
Odd. But CMUD works with strings more than zMUD ever did... so you'd want:
#sh "172.20.4.101"
and possibly
#MXP <relocate "172.20.4.101">
Just a thought.
Charneus |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Nov 26, 2008 6:55 am |
Or even better, #mxp "<relocate 172.20.4.101>".
|
|
|
|
 |
Rainchild Wizard

Joined: 10 Oct 2000 Posts: 1551 Location: Australia
|
Posted: Wed Nov 26, 2008 7:07 am |
I was experiencing the problem when the IP was coming from a variable / stringlist but I figured if you can fix the parser so "#SH <ip>" works, then more complex things such as variables/lists should also work too. In particular I had a stringlist of 100ish IP's and I was iterating over the list and doing a relocate to each, the IP's which had a '0' in the second octet got crunched.
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 26, 2008 5:01 pm |
This will happen if CMUD tries to treat the value as a number. I don't know why it's converting the 20 to a 2, but I'll add that to the bug list to look at. My guess is that the floating point conversion is seeing "172.20" and converting this to just 172.2, which is a valid floating point conversion.
As everyone has already said, if you want to force CMUD to use a string value, then you need to put quotes around it. If it is coming from a variable, then the normal auto-type should work fine, unless CMUD thinks you are trying to use it as a number. You can then set the variable to a fixed Literal String type to try and solve that. You can also use the %string() function to ensure that a value is treated as a string. But we would need to see the more specific script that is having problems to offer more suggestions.
With the #MXP command, the proper syntax is:
#mxp {<relocate 172.20.4.101 23>}
Just always remember that CMUD is pickier than zMUD about having strings within quotes or {} braces. Remember that stuff on the command line uses Spaces to delimit the arguments. So in your case of:
#mxp <relocate 172.20.4.101 23>
it was passing "<relocate" as the first argument, then "172.20.4.101" as the second argument, and then "23>" as the third argument. And this causes CMUD to parse each argument separately as auto-type values. But enclosing the entire argument in " quote or {} braces, then you are telling CMUD to treat the entire argument as a single string value. |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 26, 2008 10:55 pm |
I found the problem with this. It was a really easy fix to handle IP addresses instead of treating them as floating-point values, so it is fixed for the next version.
|
|
|
|
 |
|
|
|