/
version.py
194 lines (182 loc) · 7.13 KB
/
version.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
from pathlib import Path
MAJOR_VERSION = 11
MINOR_VERSION = 1
MICRO_VERSION = 0
VERSION_NUMBER = ".".join(str(v) for v in (MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION))
def _optional_build_id_component(path: Path) -> str | None:
if path.exists():
return path.read_text().strip()
return None
BUILD_NUMBER = _optional_build_id_component(Path("resources/buildnumber"))
GIT_SHA = _optional_build_id_component(Path("resources/gitsha"))
def _build_version_string() -> str:
components = [VERSION_NUMBER]
if BUILD_NUMBER is not None:
components.append(BUILD_NUMBER)
if GIT_SHA is not None:
components.append(GIT_SHA)
if not Path("resources/final").exists():
components.append("preview")
return "-".join(components)
#: Current version of Liberation.
VERSION = _build_version_string()
#: The latest version of the campaign format. Increment this version whenever all
#: existing campaigns should be flagged as incompatible in the UI. We will still attempt
#: to load old campaigns, but this provides a warning to the user that the campaign may
#: not work correctly.
#:
#: There is no verification that the campaign author updated their campaign correctly
#: this is just a UI hint.
#:
#: Version history:
#:
#: Version 0
#: * Unknown compatibility.
#:
#: Version 1
#: * Compatible with Liberation 2.5.
#:
#: Version 2
#: * Front line endpoints now define convoy origin/destination waypoints. They should be
#: placed on or near roads.
#: * Factories (Workshop_A) define factory objectives. Only control points with
#: factories will be able to recruit ground units, so they should exist in sufficient
#: number and be protected by IADS.
#:
#: Version 3
#: * Bulker Handy Winds define shipping lanes. They should be placed in port areas that
#: are navigable by ships and have a route to another port area. DCS ships *will not*
#: avoid driving into islands, so ensure that their waypoints plot a navigable route.
#:
#: Version 4
#: * TriggerZones define map based building targets. White TriggerZones created by right
#: clicking an object and using "assign as..." define the buildings within an objective.
#: Blue circular TriggerZones created normally must surround groups of one or more
#: white TriggerZones to define an objective. If a white TriggerZone is not surrounded
#: by a blue circular TriggerZone, campaign creation will fail. Blue circular
#: TriggerZones must also have their first property's value field define the type of
#: objective (a valid value for a building TGO category, from `game.db.PRICES`).
#:
#: Version 4.1
#: * All objective types may now be set as required generation (similar to the required
#: IADS generation). This includes:
#: * SHORADS
#: * Armor groups
#: * Strike targets
#: * Offshore strike targets
#: * Ships
#: * Missile sites
#: * Coastal defenses
#:
#: See the unit lists in MizCampaignLoader in conflicttheater.py for unit types.
#:
#: Version 4.2
#: * Adds support for AAA objectives. Place with any of the following units (either red
#: or blue):
#: * Flak18,
#: * Vulcan,
#: * ZSU_23_4_Shilka,
#:
#: Version 5.0
#: * Ammunition Depots objective locations are now predetermined using the "Ammunition
# Depot" Warehouse object, and through trigger zone based scenery objects.
#: * The number of alive Ammunition Depot objective buildings connected to a control
#: point directly influences how many ground units can be supported on the front
#: line.
#: * The number of supported ground units at any control point is artificially
#: capped at 50, even if the number of alive Ammunition Depot objectives can
#: support more.
#:
#: Version 6.0
#: * Random objective generation no is longer supported. Fixed objective locations were
#: added in 4.1.
#:
#: Version 6.1
#: * Support for new Syrian airfields in DCS 2.7.2.7910.1 (Cyprus update).
#:
#: Version 7.0
#: * DCS 2.7.2.7910.1 (Cyprus update) changed the IDs of scenery strike targets. Any
#: mission using map buildings as strike targets must check and potentially recreate
#: all those objectives. This definitely affects all Syria campaigns, other maps are
#: not yet verified.
#:
#: Version 7.1
#: * Support for Mariana Islands terrain
#:
#: Version 8.0
#: * DCS 2.7.4.9632 changed scenery target IDs. Any mission using map buildings as
#: strike targets must check and potentially recreate all those objectives.
#:
#: Version 8.1
#: * You can now add "Invisible FARP" static to FOB to add helicopter slots
#:
#: Version 9.0
#: * Campaign files now define the initial squadron layouts. See
#: https://github.com/dcs-liberation/dcs_liberation/wiki/Custom-Campaigns.
#: * CV and LHA control points now get their names from the group name in the campaign
#: miz.
#:
#: Version 9.1
#: * Campaign files can optionally define a start date with
#: `recommended_start_date: YYYY-MM-DD`.
#:
#: Version 9.2
#: * Squadrons defined in campaign files can optionally setup squadrons' name,
#: nickname and/or generated female pilot name percentage
#:
#: Version 10.0
#: * The new introduced layout system extends the mission generation so that a
#: campaign designer can now define the heading of the ground objects which will be
#: also used later in mission generation to orient the group accordingly.
#: This removes the randomization of the orientation from the generation.
#: Most campaigns will not need any updates and will work out of the box.
#: If the campaign designer sets the heading to 0 then we will automatically change
#: the orientation of the generated TGO to head towards the conflict if it is
#: required by the TGO to work properly. Values other than 0 will prevent the
#: automatic orientation.
#:
#: Version 10.1
#: * Campaign designers can now define the recommended economy settings:
#: `recommended_player_money: 2000`.
#: `recommended_enemy_money: 2000`.
#: `recommended_player_income_multiplier: 1.0`.
#: `recommended_enemy_income_multiplier: 1.0`.
#:
#: Version 10.2
#: * Campaign files can optionally define the iads configuration
#: It is possible to define if the campaign supports advanced iads
#:
#: Version 10.3
#: * Campaign files can optionally include a start time in their recommended_start_date
#: field. For example, `recommended_start_date: 2022-08-31 13:30:00` will have the
#: first turn start at 13:30. If omitted, or if only a date is given, the mission will
#: start at a random hour in the middle of the day as before.
#:
#: Version 10.4
#: * Support for the Falklands.
#:
#: Version 10.5
#: * Support for scenery objectives defined by quad zones.
#:
#: Version 10.6
#: * Support in-line definitions of campaign-specific factions.
#:
#: Version 10.7
#: * Support for defining squadron sizes.
#:
#: Version 10.8
#: * Support for Normandy 2.
#:
#: Version 10.9
#: * Campaign is compatible with new squadron rules. The default air wing configuration
#: has enough parking available at each base when squadrons begin at full strength.
#:
#: Version 10.10
#: * Support for Sinai.
#:
#: Version 10.11
#: * Support for ferry-only bases.
#:
#: Version 11.0
#: * The squadron sizes introduced in 10.7 are required.
CAMPAIGN_FORMAT_VERSION = (11, 0)