Unitsync documentation?
Moderator: Moderators
Unitsync documentation?
The link on the wiki (http://spring.osocial.se/db/de7/unitsync__api_8h.html) leads to a "503 Service Temporarily Unavailable" page, and has done so for some time now. I'm wondering if there is an alternative source of documentation on how the unitsync library is designed to be used?
Re: Unitsync documentation?
Maybe I should clarify a little.
I know about the API docs inside the unitsync.h file itself. What I'm more interested in are the subtleties of how it should be used.
Is a loaded instance of unitsync thread-safe, or should I lock/unlock before and after each call to the library?
I've discovered that reading most of the map info is quite a time-consuming operation, but getting the list of map names is relatively quick by comparison.
I know that I need to call the Init() function before anything else, but there is an UnInit() function as well. If e.g. a new map is downloaded and put in the maps directory, will the value I have cached for GetMapCount() now be invalid, or will unitsync not know about the new map until UnInit() and then Init() are called again?
Regarding the info map - GetInfoMapSize() returns an int - I presume this is the number of bytes needed to create a buffer of sufficient size for the GetInfoMap() call? What is the "type" info map? The height map - is each entry a float value indicating the height in the same scale as returned by the GetMapMinHeight/GetMapMaxHeight functions?
(I'm only working on map-related functionality right now, so I'm sure I'll run into questions later on with mods, etc).
Thanks in advance for any help :)
I know about the API docs inside the unitsync.h file itself. What I'm more interested in are the subtleties of how it should be used.
Is a loaded instance of unitsync thread-safe, or should I lock/unlock before and after each call to the library?
I've discovered that reading most of the map info is quite a time-consuming operation, but getting the list of map names is relatively quick by comparison.
I know that I need to call the Init() function before anything else, but there is an UnInit() function as well. If e.g. a new map is downloaded and put in the maps directory, will the value I have cached for GetMapCount() now be invalid, or will unitsync not know about the new map until UnInit() and then Init() are called again?
Regarding the info map - GetInfoMapSize() returns an int - I presume this is the number of bytes needed to create a buffer of sufficient size for the GetInfoMap() call? What is the "type" info map? The height map - is each entry a float value indicating the height in the same scale as returned by the GetMapMinHeight/GetMapMaxHeight functions?
(I'm only working on map-related functionality right now, so I'm sure I'll run into questions later on with mods, etc).
Thanks in advance for any help :)
Re: Unitsync documentation?
Oh, and I take it that client code is responsible for freeing the buffer returned by the GetMinimap call?
Re: Unitsync documentation?
what do you want to do?
springlobby has a wrapper for unitsync which should make unitsync thread-safe: https://github.com/springlobby/lsl/blob ... unitsync.h
also it can handle multiple versions of unitsync... dynamicly load/unload it when needed.
api is here:
https://github.com/spring/spring/blob/d ... sync_api.h
(the broken link created some html text from the source file, it didn't contain better/different info)
springlobby has a wrapper for unitsync which should make unitsync thread-safe: https://github.com/springlobby/lsl/blob ... unitsync.h
also it can handle multiple versions of unitsync... dynamicly load/unload it when needed.
api is here:
https://github.com/spring/spring/blob/d ... sync_api.h
(the broken link created some html text from the source file, it didn't contain better/different info)
Re: Unitsync documentation?
I'm experimenting right now with writing a Swift/Objective-C wrapper to the unitsync library, with the possible eventual goal of writing a native OS X Spring client / lobby.abma wrote:what do you want to do?
I'll take a look at that and see what I can learn :)springlobby has a wrapper for unitsync which should make unitsync thread-safe: https://github.com/springlobby/lsl/blob ... unitsync.h
I've already got code in my wrapper that can do this :)also it can handle multiple versions of unitsync... dynamicly load/unload it when needed.
Ah, I was hoping it had different info. The unitsync_api.h file has already been useful to me, but it is lacking in certain areas.api is here:
https://github.com/spring/spring/blob/d ... sync_api.h
(the broken link created some html text from the source file, it didn't contain better/different info)
I also discovered a bug in the documentation: specifically for the GetMinimap call. The documentation states:
Code: Select all
* @param fileName The name of the map, including extension.
Re: Unitsync documentation?
whats wrong with springlobby?Belmakor wrote:I'm experimenting right now with writing a Swift/Objective-C wrapper to the unitsync library, with the possible eventual goal of writing a native OS X Spring client / lobby.
also there is a WIP for an inengine lobby. viewtopic.php?f=64&t=32030
Re: Unitsync documentation?
I use Springlobby all the time and I'm thankful it's there. It's currently the only viable option (that I know of) on OS X.abma wrote:whats wrong with springlobby?
However:
- there are plenty of usability issues with springlobby on OS X; I personally find the UI design of the lobby frustrating: back in my early Spring days I loved TASclient, but it's Windows-only and I moved to OS X years ago.
- I was casting around for a project to further my OS X programming skills (I'm a former Java developer turned iOS developer) and this seemed like a good fit i.e. this is a learning project for me.
- As this is a "for fun"/learning project for me, I'm not keen on spending time wrestling with someone else's well-established and large code-base, especially if it's mostly C++.
Looks interesting! That isn't part of the current development engine, is it? (I haven't seen it in the dev builds I've been running)also there is a WIP for an inengine lobby. viewtopic.php?f=64&t=32030
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Unitsync documentation?
Perhaps you might like to help in this effort. I was running weblobby on a macbook for a while (unfortunately the current version of spring was not supporting OSX at that time, no idea if it does now).
https://github.com/springweblobby/swl-w ... evelopment
https://github.com/springweblobby/swl-w ... evelopment
Re: Unitsync documentation?
No it's not.Belmakor wrote:Looks interesting! That isn't part of the current development engine, is it? (I haven't seen it in the dev builds I've been running)also there is a WIP for an inengine lobby. viewtopic.php?f=64&t=32030
This is technically an in-game lobby rather than an in-engine one - it's standalone and runs like any other game.
I've been developing it and as abma said, it's still pretty early in the development (not usable), but I'd gladly welcome any outside contribution.
The only caveat is that it requires a special version of spring that contains some changes to allow md5 server login and pr-downloader support which aren't yet ready to be merged upstream.
Re: Unitsync documentation?
It's not really the area I want to be playing in at the moment, but thanks for the tip anyway :)CarRepairer wrote:Perhaps you might like to help in this effort. I was running weblobby on a macbook for a while (unfortunately the current version of spring was not supporting OSX at that time, no idea if it does now).
https://github.com/springweblobby/swl-w ... evelopment
Re: Unitsync documentation?
I think I'll continue playing with what I'm working on, then :)gajop wrote:This is technically an in-game lobby rather than an in-engine one - it's standalone and runs like any other game.
I've been developing it and as abma said, it's still pretty early in the development (not usable), but I'd gladly welcome any outside contribution.
The only caveat is that it requires a special version of spring that contains some changes to allow md5 server login and pr-downloader support which aren't yet ready to be merged upstream.