UnitSync :: Game Dependencies

UnitSync :: Game Dependencies

Discuss development of lobby clients, server, autohosts and auto-download software.

Moderators: Moderators, Lobby Developers

Post Reply
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

UnitSync :: Game Dependencies

Post by danil_kalina »

GetPrimaryModCount();
GetPrimaryModName();

UnitSync is not checking game's dependencies, isn't it ?

For example: if we have downloaded BA Chicken Defense but haven't downloaded Balanced Annihilation.
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: UnitSync :: Game Dependencies

Post by koshi »

I suggest you read the doxygen comments again and explain in detail what you didn't understand or what your actual problem is.
https://raw.github.com/spring/spring/de ... sync_api.h
a1983
Posts: 55
Joined: 02 Dec 2009, 12:01

Re: UnitSync :: Game Dependencies

Post by a1983 »

When we build avialable game list, we using GetPrimaryModCount / GetPrimaryModName. And that function return that we have BA chicken defense, for example. But for runing that game we need BA itself. What is the best way to get game dependencies in that case?
abma
Spring Developer
Posts: 3622
Joined: 01 Jun 2009, 00:08

Re: UnitSync :: Game Dependencies

Post by abma »

unitsync currently offers no function to detect dependencies, when the file isn't available.

on http://api.springfiles.com, i solved that by parsing modinfo.lua / mapinfo.lua. not a clean solution, but works fine for the moment.

https://github.com/springfiles/upq/blob ... ta.py#L390

i don't know, if it worked with an old version of unitsync to get the depends or if it broke at some version. :-/

the problem was, spring could be run without all depends, now it enforces it, and maybe that is the cause, why it gets not listed with GetPrimaryModCount / GetPrimaryModName. see https://github.com/spring/spring/commit ... 9216f22245


afaik, GetNextError() should be non-empty after calling AddAllArchives() when a depends is missing.


so: currently the cleanest way is to check depends is before / while downloading. (plasma/springfiles api/rapid have depends)


i made a bug-report: http://springrts.com/mantis/view.php?id=3000


and yes, this code/api really needs a cleanup! :-(

Note: GetPrimaryModName is deprecated...
a1983
Posts: 55
Joined: 02 Dec 2009, 12:01

Re: UnitSync :: Game Dependencies

Post by a1983 »

Thanks, Abma.
May be add to UnitSync GetModDependeciesCount/GetModDependecie?

P.S. I replace GetPrimaryModName with GetPrimaryModInfoCount/GetInfo...
Post Reply

Return to “Lobby Clients & Server”