Blueprint maps causing unitsync to throw errors(wrong call?)

Blueprint maps causing unitsync to throw errors(wrong call?)

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
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Blueprint maps causing unitsync to throw errors(wrong call?)

Post by Forboding Angel »

First of all, let me point out, that the only lobby that has issues with this is ZKLobby, SL and the rest work fine.

However, the reason for this thread is because it seems that lobby devs are not being told what correct calls they need to use in order to get information out of mapinfo.lua and the mapoptions stuff, etc.

Could one of the engine devs kinda explain it so everyone can understand and how to fix the issue so that if any of us run into this again we can point towards this thread?

Thanks! :-)
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Blueprint maps causing unitsync to throw errors(wrong call?)

Post by abma »

can you be a bit more specific please?

unitsync.log maybe or c&p stdout or screenshot?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Blueprint maps causing unitsync to throw errors(wrong call?)

Post by Forboding Angel »

Well it's basically the same issue that I posed about in general discussion ( http://springrts.com/phpbb/viewtopic.php?f=1&t=27783 ), however, until recently NotaLobby was plagued by the same issue (which has since been resolved).

All I know is, this is very not awesome, and it appears that lobbydevs aren't getting the full scoop as far as what they should be using to get map info out of the archive. In particular, it seems to happen the most with maps using mapinfo.lua as opposed to SMD.

This thread is an attempt to have a place where they might be able to find by searching or that others of us can refer to for them to get proper answers.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Blueprint maps causing unitsync to throw errors(wrong call?)

Post by Kloot »

The reason is that all blueprint code assumes the "Spring" table and its synced access functions like GetMapOptions always exist / are valid, which they don't when unitsync executes it. You want the

Code: Select all

if (Spring.GetMapOptions ~= nil and Spring.GetMapOptions().key == "value")
pattern.
Last edited by Kloot on 09 Mar 2012, 00:51, edited 1 time in total.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Blueprint maps causing unitsync to throw errors(wrong call?)

Post by abma »

https://github.com/jk3064/Map-Blueprint/issues/1

(thanks, i wasn't sure before if thats an issue or not... it is!)
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Blueprint maps causing unitsync to throw errors(wrong call?)

Post by knorke »

if the whole "Spring" table does not exist, wouldnt it have to be
if (Spring and Spring.GetMapOptions and ...) then
Post Reply

Return to “Engine”