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 »

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 :-)
Fnordia
Former Engine Dev
Posts: 425
Joined: 13 Aug 2004, 16:11

Re: unitsync function deprecation

Post by Fnordia »

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

Re: unitsync function deprecation

Post by Tobi »

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.)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: unitsync function deprecation

Post by AF »

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

Re: unitsync function deprecation

Post by Tobi »

done

(assuming the unitsync Message function actually works and pops up MessageBox on windows)
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: unitsync function deprecation

Post by Tobi »

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

Return to “Engine”