Okay, I just put up an initial implementation at my
BitBucket account. The source is hosted with mercurial; if you're not familiar with mercurial you can download the repo with "
hg clone
http://bitbucket.org/box/drod "
. You can view the major changeset
here, but there are a couple other minor changes I made to get it to compile on my machine. Note that at the moment this will only build on POSIX systems (the janky CaravelNet-on-local-filesystem uses POSIX functions to modify file timestamps); if you guys normally test on Windows I can probably get this all building in Windows too.
So far I have download/upload working on game enter/exit (respectively) and controlled by a per-player option on the Settings screen. It will only update players that it thinks have changed by tracking the LastUpdated field in each player. DRoD seems to do the Right Thing when merging saves (i.e., progress is not lost when an older save is imported), which is really awesome. And by "
download/upload"
I mean write files to the DRoD data directory, as Schik suggested.
The methods I added to CNetInterface are:
UploadPlayer
DownloadPlayer
GetPlayerList
UploadModifiedPlayers
DownloadModifiedPlayers
The last two don't do any direct CaravelNet logic per se, and can be refactored to wherever they actually belong. I added {Upload/Download}ModifiedPlayers at approximately the right spots in Main.cpp, but I'm sure they aren't ideal.
Things left to do are (at least) add the proper localization strings (does DRODUtil build on Linux?) and add UI notifications while working. And we probably want some way to delete players from CaravelNet, I just realized.
So, does this all sound good so far? If so, I'll finish up the UI stuff and we can go from there!
-- John