Tuesday, November 30, 2004

The Map transfer continues.

Transferring the map is turning out to be a real headache. The actual building up of the map ready for export is very easy. It’s just building up the XML string until I have a huge string. (Well not that huge, it just feels like it.). It’s the parsing of the xml string by the challenger that’s the problem.

I’m using XML because that was one of the design goals I’d set. I was going to use a small J2ME xml parser but that will add even more to the overhead, so each of the objects being transferred have their own little parsing routine to extract the information it needs.

Once the map is populated a second pass will be required. This is to make sure that each part of the map is configured properly. Once that’s done, then the challenger will send back an OK command.

There are going to have to be a couple of states to this transfer.

1. The transfer ran OK and we’re ready to play.
2. The transfer failed and the challenger is requesting a retransmit.
3. The transfer failed and the challenger no longer wants to play.
4. The transfer has timed out.

Only with a state of 1 will the game be allowed to proceed.

0 Comments:

Post a Comment

<< Home