Unitsync documentation

Unitsync documentation

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
tc-
Lobby Developer
Posts: 152
Joined: 19 Apr 2007, 20:15

Unitsync documentation

Post by tc- »

Is there any documentatio on the unitsync library?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Not really. There is a little bit of python help strings in pybind.cpp and I made some examples a while ago: http://www.osrts.info/~tvo/unitsync/
User avatar
tc-
Lobby Developer
Posts: 152
Joined: 19 Apr 2007, 20:15

Post by tc- »

Thanks, that will be of some help. Would have bee nice with a complete documentation of it. But I guess browsing though sources will have to do.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

look at CSync/JSync.java in the aflobby source code. It loads all the unitsync hashes and mapnames and sidenames etc, everything you need for a lobby really.

There are also some functions in the java bindings that wrap up unitsync nicely like the searchVFS and listArchiveFiles, aswell as the WriteMinimap function which can be found in both java and python bindings which writes out a minimap to a given image file.
User avatar
tc-
Lobby Developer
Posts: 152
Joined: 19 Apr 2007, 20:15

Post by tc- »

Thanks, I will have a look at it today.

Anyway, would it be possible to bundle unitsync with the lobby? It's a pain to ask users to download the spring source to compile it and if I ship a compiled version it might not have the same libs as the build machine. Any sugestions how to solve this?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

simple, assume spring is installed. If it isnt handle accordingly and inform the user that they cant join games. Make uitsync a soft dependency not a hard one.
User avatar
tc-
Lobby Developer
Posts: 152
Joined: 19 Apr 2007, 20:15

Post by tc- »

So spring automatically installs the unitsync lib in the standard locations?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Ask the user where spring is if you cant determine it automatically, else assume the programs in the spring install itself and unitsyncs installed to the working directory.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

tc- wrote:So spring automatically installs the unitsync lib in the standard locations?
Yep, in version 0.75 unitsync.so will be installed in /usr/lib/spring/unitsync.so if the install prefix = /usr. I think it is fine to look for it in /usr/lib/spring/unitsync.so and /usr/local/lib/spring/unitsync.so, so you can handle both self compiled Spring installs (with default prefix) and packaged Spring installs, which should have the /usr prefix.
Post Reply

Return to “Engine”