« Previous - Version 5/18 (diff) - Next » - Current version
Sickboy, 07/07/2010 20:10


Versioning System

The versioning system allows you to register your mod, incl version.
In Multiplayer, the versions are compared between server and clients, and warnings are displayed when mismatches have been detected.

Implementation

Add to your config.cpp, CfgPatches section:

version = 1.0.1; versionStr = "1.0.1"; versionAr[] = {1,0,1};

To add a custom script function that will be triggered on version mismatch:

class CfgSettings {
   class CBA {
      class Versioning {
         class MyMod {
            handler = "myMod_fnc_mismatch"; // Make sure this function is compiled at a called preInit, not spawn/execVM
         };
      };
   };
};

To add a dependency on e.g CBA:

class CfgSettings {
   class CBA {
      class Versioning {
         class MyMod {
            class Dependencies {
               CBA[]={"cba_main", {0,5,1}, "true"};
            };
         };
      };
   };
};

To add Removed addons to the Upgrade Registry:

class CfgSettings {
   class CBA {
      class Registry {
         class PREFIX {
            removed[] = {"myMod_addon1"};
         };
      };
   };
};