unitsync function deprecation

unitsync function deprecation

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
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

unitsync function deprecation

Post by Tobi » 24 Oct 2008, 11:21

I'm hereby deprecating the following functions in unitsync:
  • GetCurrentList
  • AddClient
  • RemoveClient
  • GetClientDiff
  • InstallClientDiff
  • IsUnitDisabled
  • IsUnitDisabledByClient
I've removed code for them locally (commit will follow in the weekend) and made them return a sane dummy value.

After the next release or two they'll get dropped entirely from the unitsync DLL.

If you have good reasons for these functions to stay please say so before I commit the change.

I myself couldn't find any find any clients which use these functions, and also I'm sure modders wouldn't particularly like the feature these functions are designed for. Besides that, it isn't supported by lobby infrastructure and I've no clue whether they've actually been tested sometime. In other words, enough reasons to deprecate them :-)
0 x

Fnordia
Former Engine Dev
Posts: 425
Joined: 13 Aug 2004, 16:11

Re: unitsync function deprecation

Post by Fnordia » 24 Oct 2008, 12:48

They are the reason why the dll is actually called unitsync. :) They implement the same method TA used for syncing which units to enable, and was used by the first lobby client. But I would agree that they are of no use today..
0 x

Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: unitsync function deprecation

Post by Tobi » 24 Oct 2008, 13:08

Ah so they even were in use some time long ago :-)

Good to know, but indeed, culture etc. changed in such a way that I don't think it would be good to add it to current lobbies.

Also I suspect Spring will crap out in any case if you have 3rd party units installed, because of the way restricted/disabled units works was changed, IIRC. (I think all unitdefs are loaded always nowadays, so IDs would get messed up between clients and it might result in desync.)
0 x

User avatar
AF
AI Developer
Posts: 20667
Joined: 14 Sep 2004, 11:32

Re: unitsync function deprecation

Post by AF » 24 Oct 2008, 22:42

The majority were intended to be used in the original lobby but jouninkomiko focused more on making the lobby actually work without crashing. When betalord came along and built TASServer and TASClient I assume either he chose not to bother or nobody told him and he was unaware.

Since there was no protocol support and no lobby supported the functions and the necessary archives to add new units would have caused desync flags in the lobby to go red, none of the new lobbies implemented it either.

I think it might be an idea to have unitsync throw an error message the first time a deprecated function is called ( only the first time though son we don't get spam ), this way new developers don't end up scratching their heads, and any future deprecated functions throw the message giving developers encouragement to if the issue so there are no surprises.
0 x

Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: unitsync function deprecation

Post by Tobi » 25 Oct 2008, 13:30

done

(assuming the unitsync Message function actually works and pops up MessageBox on windows)
0 x

Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: unitsync function deprecation

Post by Tobi » 26 Oct 2008, 00:42

This entire change is in SVN since earlier today, in case you didn't notice :-)
0 x

Post Reply

Return to “Engine”