Create account / Log in

VASSAL 3.1.0-beta1 is released

Topics related to the main Vassal engine.

Moderators: uckelman, Tim M

VASSAL 3.1.0-beta1 is released

Postby uckelman » May 24th, 2008, 8:57 pm

Thus spake "Michael Kiefte":
Okay, I'm stumped. I've put ampersands all over the buildfile, but it
doesn't seem to mind. Where are the ampersands not supposed to go?

They're not supposed to go in CDATA. Hmmm. Possibly then that "&#1"
is really an entity which isn't recognized.

I think you need to get the ADC2 module in order to move on from here.
--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8611
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

SFE ADC2 module

Postby Biswut » May 24th, 2008, 9:05 pm

HiHo,

I hope I can help here.
The module is no longer sold, it's free, because ADC2 will not be maintained in the future.

You can donwload it here:

http://67.155.107.229/COA/Struggle%20fo ... pe-Med.exe

Best regards
Chris

(I hope the link works, otherwise I can mail it, its just 1,5 Megs)
Biswut
 
Posts: 39
Joined: May 4th, 2008, 12:49 pm
Location: Near Aachen, Germany

VASSAL 3.1.0-beta1 is released

Postby uckelman » May 24th, 2008, 10:07 pm

Thus spake "Michael Kiefte":
Thanks, Chris.

That being said, there's something very fishy about the module. Chris, you
ever notice that the turns in BF Blitzkrieg Setup after SEP 2 1940 don't
actually have names? Actually, they do have names, they just happen to all
start with an illegal character (\001). For some reason, the first
character of every turn name has been changed to \001.

I think I have something unprintable to say about putting unprintable
characters into strings.

Guys what do you think I should do about that? The names are there, but
they all happen to start with a bad character. The importer is actually
doing the right thing (outputting &#1), but it's the loader that's choking.
ADC2 appears to gracefully ignore the problem. How do I decide what an
invalid character is -- anything below 0x20 -- and do I check every string
(it might be easier to do something on the ArchiveWriter side as there's _a
lot_ of places where I would have to check for this).


Argh. That's really nasty. Doing this kind of checking is going to be
slow, so putting it into ArchiveWriter would make all saving slow,
when it's only needed for doing imports.

What's actually the right thing to do here? Are these characters junk?
How'd the y get there?

I think you could just do something like this, if it's ok to chuck
those characters, and if you won't see any Unicode characters:

final Pattern p = Pattern.compile("[^\\x32-\\x7E]");
String fixed = p.matcher(bad).replaceAll("");

(You want to hang on to the Pattern, and reuse it to create your Matchers.)

--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8611
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

VASSAL 3.1.0-beta1 is released

Postby uckelman » May 24th, 2008, 10:12 pm

Thus spake Joel Uckelman:
Thus spake "Michael Kiefte":
Thanks, Chris.

That being said, there's something very fishy about the module. Chris, you
ever notice that the turns in BF Blitzkrieg Setup after SEP 2 1940 don't
actually have names? Actually, they do have names, they just happen to all
start with an illegal character (\001). For some reason, the first
character of every turn name has been changed to \001.

I think I have something unprintable to say about putting unprintable
characters into strings.

Guys what do you think I should do about that? The names are there, but
they all happen to start with a bad character. The importer is actually
doing the right thing (outputting &#1), but it's the loader that's choking.
ADC2 appears to gracefully ignore the problem. How do I decide what an
invalid character is -- anything below 0x20 -- and do I check every string
(it might be easier to do something on the ArchiveWriter side as there's _a
lot_ of places where I would have to check for this).


Argh. That's really nasty. Doing this kind of checking is going to be
slow, so putting it into ArchiveWriter would make all saving slow,
when it's only needed for doing imports.

What's actually the right thing to do here? Are these characters junk?
How'd the y get there?

I think you could just do something like this, if it's ok to chuck
those characters, and if you won't see any Unicode characters:

final Pattern p = Pattern.compile("[^\\x32-\\x7E]");
String fixed = p.matcher(bad).replaceAll("");

(You want to hang on to the Pattern, and reuse it to create your Matchers.)

A better pattern would be "[^\\x32-\\x7E]+" since you may as well remove
as many of them in one go as you can.


--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8611
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Postby Biswut » May 25th, 2008, 5:44 am

HiHo,

sorry for coming up with this problem.

I just like the Game . . .

If I can do anything, please let me know.

Best regards
Chris
Biswut
 
Posts: 39
Joined: May 4th, 2008, 12:49 pm
Location: Near Aachen, Germany

VASSAL 3.1.0-beta1 is released

Postby uckelman » May 25th, 2008, 7:51 am

Thus spake "Michael Kiefte":
What's actually the right thing to do here? Are these characters junk?
How'd the y get there?


Impossible to say. There could have been a bug in the ADC2 module saver.
No one playing ADC2 would be really bothered by it. Someone may have
noticed that the turns had no names after a certain point. ADC2 doesn't
care because it just reads null-terminated strings into a buffer.


Man, that's really grotty. It's not like this was a good idea in 1997 or
whenever, either.


A better pattern would be "[^\\x32-\\x7E]+" since you may as well remove
as many of them in one go as you can.


The pain being that I have to go through the importer, find every instance
where a string is read and apply the Matcher.

Well, you could (should) encapsulate the fixer-upper in a function.

Also, it's probably worth trying this, too, as it might be a lot faster
than using a regex:

String fixup(String s) {
final int len = s.length();
final StringBuilder sb = new StringBuilder(len);

char ch;
for (int i = 0; i < len; i++) {
ch = s.charAt(i);
if (ch >= 0x20 && ch <= 0x7E) sb.append(ch);
}

return sb.toString();
}

Will it be that hard? Aren't you looking for instances of 'new String'
and toString() and such?

--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8611
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

VASSAL 3.1.0-beta1 is released

Postby uckelman » May 25th, 2008, 7:53 am

Thus spake "Biswut":
HiHo,

sorry for coming up with this problem.

No need to be sorry. You're doing us a favor by reporting bugs.
We can't fix bug we don't know about.

--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8611
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

VASSAL 3.1.0-beta1 is released

Postby uckelman » May 25th, 2008, 5:47 pm

Thus spake "Michael Kiefte":
Fixed in branches/mkiefte r3653.

Now the broken turn names will appear without the first letter (which is
marginally better than what ADC2 does).


Michael, do you also want to chuck chars greater than 0x7E? (0x7F is
DEL, for example.)


--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8611
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

VASSAL 3.1.0-beta1 is released

Postby uckelman » May 25th, 2008, 6:10 pm

Thus spake "Michael Kiefte":
Michael, do you also want to chuck chars greater than 0x7E? (0x7F is
DEL, for example.)


Fair enough. I wondered about that almost immediately after I committed
it. Unfortunately, that is not the only place where strings are read in,
but it's the only place where null-terminated strings read in.

Ok. In the long-term, we should probably plan to sanitize all input from
importers, but this is probably ok for now. (Does it matter that the other
strings you're reading in aren't null-terminated? How *are* they
terminated? Do you have byte-lengths appearing before them?

Fixed in r3656.

I've got at least three more bugs to work out, but one is a real struggle.

I have several more as well---but I'm at a point where all of them
depend on input from other people first, so I'm going to go have a
beer soon.

--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8611
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Postby Biswut » May 25th, 2008, 7:37 pm

Dear Joel,

as I have quite a few ADC2 modules, would it help to test more or better wait for beat 2 ?

Have fun with the beer. (Prost !)

Chris
Biswut
 
Posts: 39
Joined: May 4th, 2008, 12:49 pm
Location: Near Aachen, Germany

Postby Biswut » May 27th, 2008, 8:48 am

HiHo,

I know it's the wrong folder but the Import of SFE works now with beta 2.
I try to correct the Turnnames manually.

Th@nx for the great work.

best regards from Germany
Chris
Biswut
 
Posts: 39
Joined: May 4th, 2008, 12:49 pm
Location: Near Aachen, Germany

VASSAL 3.1.0-beta1 is released

Postby uckelman » May 27th, 2008, 4:17 pm

Thus spake "Biswut":
HiHo,

I know it's the wrong folder but the Import of SFE works now with beta 2.
I try to correct the Turnnames manually.

Is there something still amiss with the turn names?
--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8611
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: VASSAL 3.1.0-beta1 is released

Postby Biswut » May 27th, 2008, 4:36 pm

Is there something still amiss with the turn names?
--

Hi Joel,
yes, in most cases the first letter is missing :-)
In others the name is totally missing.
I don't know if it was correct in ADC.
But as there is a counter für the turn anyway, I just deleted the whole menu entry for the turn numbers.

I also changed some other things. I'm becoming comfortable with the Module-Editor:-)

best regards
Chris
Biswut
 
Posts: 39
Joined: May 4th, 2008, 12:49 pm
Location: Near Aachen, Germany

VASSAL 3.1.0-beta1 is released

Postby uckelman » May 29th, 2008, 10:13 pm

Thus spake "Biswut":
Dear Joel,

as I have quite a few ADC2 modules, would it help to test more or better wait
for beat 2 ?

Have fun with the beer. (Prost !)

Chris

Test away. Michael wants to hear about whatever doesn't work.

--
J.

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

Post generated using Mail2Forum (http://www.mail2forum.com)
User avatar
uckelman
Site Admin
 
Posts: 8611
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 7 guests