Sunday, November 6, 2016

AbiathRPC - Infrastructure for editing

Today I wrote the parts of AbiathRPC Server that allow clients to actually edit the levels. That consists of a few WCF method contracts: one to add a level, one to remove a level, and one to edit tiles in a level. That last one is a little interesting, because it's possible that a client could have edited a tile in between when a different one issued a write and when the server received it. Currently, I have the server not change the tile again when it sees that's happened, but I'm not sure whether that's a useful check.

Anyway, calling any of those methods results in the server taking note that changes were made. It saves the levels to disk at ten-minute intervals if there are any unsaved modifications.

Since clients will need to occasionally encode levels into LevelInformation instances (when creating a level with existing data, e.g. by resizing or loading an ASLEV), I refactored the level translation code out of the server and into the bindings library so it can be used by both server and client.

It looks like the server doesn't need to be as complex as I thought. Getting the client to hook all the right places in Abiathar will be the next thing to do.

No comments:

Post a Comment