Plugin wizard - <plugin requires="4,00"> - note the comma!

Posted by Worstje on Fri 03 Aug 2007 12:15 AM — 7 posts, 18,702 views.

Netherlands #0
The plugin wizard is by default set to '4' currently.

I have a dutch regional settings, where compared to english, the dot and comma have reversed meanings, which ends up in MUSHclient insisting on converting it to a float for printing purposes. It next creates a <plugin> tag with requires="4,00", which MUSHclient doesn't like while loading.

While this one can be easily 'fixed' by putting a different 'subversion' by default, I'd suggest looking over the source for similar spots that may run into localization issues. Although, fair is fair, this is the first time I run into an issue like this in quite some time of using MUSHclient.
Australia Forum Administrator #1
Do you not get the same problem with any value being saved with decimal places? (eg. a timer that fires after 0.5 seconds)?
Netherlands #2
I don't use MUSH timers, heh. I use either DoAfterXXX or a customwritten class in Python that does its timer checks in the prompt-trigger, since that allows me more finesse when checking requirements.

But yes, I suppose that would also fire it. I could test tomorrow if you want; I'm just done playing for the day.
Australia Forum Administrator #3
Yes, a quick test please. The DoAfter may have the same problem, but is probably isn't saved to the disk file, and would thus work internally.
Netherlands #4
Tets I've done (using Python, but since values are passed as strings it shouldn't make a difference):

DoAfterNote():

- world.DoAfterNote("1.5", "test!") displayed 'test!' after 15 seconds. It seems to disregard the . completely, which makes sense since, in my locale, it is used to seperate the thousands (E.g., $2500 becomes 2.500,00 when written out full, as opposed to 2,500.00 in english)

- world.DoAfterNote("1,5", "test!") displayed 'test!' after 1.5 seconds.

Timers:




<timers>
  <timer enabled="y" second="1,50"    send_to="2"
>
  <send>Testing!</send>

  </timer>
</timers>


This displayed 'Testing!' every 1.5 seconds.


<timers>
  <timer enabled="y" second="1.50"    send_to="2"
>
  <send>Testing!</send>

  </timer>
</timers>


- Entering '1.5' in the GUI seconds field gave me an error that it was not a valid number.

- Modifying the first testcase from '1,50' to '1.50', Copying and using the Paste button in the interface gave no error. Looking at the details, MUSHclient had truncated the '1.50' to '1'.


Is there anything else you need tested, Nick?
Australia Forum Administrator #5
That place (version in plugins), and timers, are about the only two places which are affected by this problem. I have chnaged it in version 4.18 to convert the locale back for the duration of saving those values. That should then let it be read back in correctly. That way, if you make a plugin (or timer) and post it here, it will work for other MUSHclient users.
Australia Forum Administrator #6
This problem was actually introduced in version 4.09 where MUSHclient sets the locale internally to the system default. It may not have happened in earlier versions.