Versioning System

Version 15 (Sickboy, 10/11/2011 07:18)

1 1 Sickboy
h1. Versioning System
2 1 Sickboy
3 1 Sickboy
The versioning system allows you to register your mod, incl version.
4 1 Sickboy
In Multiplayer, the versions are compared between server and clients, and warnings are displayed when mismatches have been detected.
5 1 Sickboy
6 1 Sickboy
h2. Implementation
7 1 Sickboy
8 6 Sickboy
Add to your config.cpp, MyMod_main's CfgPatches section:
9 5 Sickboy
<pre>version = 1.0.1; versionStr = "1.0.1"; versionAr[] = {1,0,1};</pre>
10 1 Sickboy
11 12 Sickboy
To register the mod with the CBA Versioning System:
12 9 Sickboy
<pre>class CfgSettings {
13 9 Sickboy
   class CBA {
14 9 Sickboy
      class Versioning {
15 10 Sickboy
         class MyMod {
16 10 Sickboy
           // This registers MyMod with the versioning system and looks for version info at CfgPatches -> MyMod_main
17 13 Sickboy
18 13 Sickboy
           // Optional: Manually specify the Main Addon for this mod
19 11 Sickboy
           //main_addon = "MyModAddon"; // Uncomment and specify this to manually define the Main Addon (CfgPatches entry) of the mod
20 13 Sickboy
21 13 Sickboy
           // Optional: Add a custom handler function triggered upon version mismatch
22 11 Sickboy
           //handler = "myMod_fnc_mismatch"; // Adds a custom script function that will be triggered on version mismatch. Make sure this function is compiled at a called preInit, not spawn/execVM
23 9 Sickboy
24 11 Sickboy
           // Optional: Dependencies
25 11 Sickboy
           // Example: Dependency on CBA
26 11 Sickboy
           /*
27 4 Sickboy
            class Dependencies {
28 11 Sickboy
               CBA[]={"cba_main", {0,8,0}, "true"};
29 4 Sickboy
            };
30 11 Sickboy
           */
31 4 Sickboy
32 11 Sickboy
           // Optional: Removed addons Upgrade registry
33 11 Sickboy
           // Example: myMod1_addon1 was removed and it's important the user doesn't still have it loaded
34 11 Sickboy
           //removed[] = {"myMod_addon1"};
35 4 Sickboy
         };
36 4 Sickboy
      };
37 7 tcp
   };
38 11 Sickboy
};</pre>
39 7 tcp
40 14 Sickboy
41 7 tcp
h2. Shared Version Display (optional)
42 1 Sickboy
43 14 Sickboy
You find this at the Main menu, right-down.
44 15 Sickboy
Operation: Mouse over to temporarily pause cycling. Left click to cycle forward. Right click to cycle back. Double click to perform currently displayed mod's action, if any.
45 1 Sickboy
46 15 Sickboy
h3. Implementation
47 15 Sickboy
48 14 Sickboy
* versionDesc - String for Display Name. Add to the cycling display of mod names and versions on the main menu.
49 14 Sickboy
* versionAct - String for Code, optional. Add a double click action using MouseButtonDblClick. Leave empty ("") or omit if not used.
50 7 tcp
51 14 Sickboy
Example CfgPatches entries from the A.C.E. mod:
52 7 tcp
<pre>versionDesc = "A.C.E.";
53 1 Sickboy
versionAct = "['MAIN',_this] execVM 'x\ace\addons\main\about.sqf';";</pre>