Jump to content

self created addon is not loaded by dedicated linux server

Recommended Posts

Hey guys, i think i m doin a little mistake in my addon creation.
The addon i try to create is called inidb. I know that there is a downloadable release but its library (inidb.dll) is for windows only.
I downloaded the library linux sources from git hub (https://github.com/newtondev/inidb-linux) and compiled them to the needed inidb.so file for my virtual linux server.
The unpacked addon is part of that download and consists of a config.cpp file and a init.sqf.



class CfgPatches {
  class iniDBI {
    units[] = {};
    weapons[] = {};
    requiredVersion = 0.1;
    requiredAddons[] = {};
    init = "call compile preprocessFileLineNumbers '\inidb\init.sqf'";

Those 2 files are the content of the folder inidb which i packed with cpbo to inidb.pbo


My folder structure at server is as described at git hub:


   @inidb               (folder)

         db                (folder)

         inidb.so        (file)

         addons        (folder)

            inidb.pbo  (file)


Im starting my server with the option:  -mod=@inidb


Generaly my dedicated linux server is able to handle mods. I have other mods (not self created) which are running fine.


In my mission which should use the addon i ve the following init.sqf file:



if(isServer) then {
call compile preProcessFile "\inidb\init.sqf";

The log file at server produces the following line:

Warning Message: Script inidb\init.sqf not found

I think there are 2 things which could cause this message and i need your help to get a clue whats goin wrong.

It could be that i did a mistake with the path to the addons init.sqf file.

The other thing could be that the addon is not loaded by the server for some reason, but i dont know.


I googled that problem fo a week and i tried other pathes as described above and i tried to autostart the script by setting up a module in config.cpp and in my mission. But nothing helped, i cant get it working.



Ok, 24 hours r gone since i posted this, 50 views and no little answer. I think i m doin something wrong with that thread. For that reason i try to simplify it to some questions:

How defines an addon the path to its scripts?

Is it defined by the folder which was packed with cpbo?

What does that $PREFIX$ file do i read about? Do i need those file in my case and which content would be correct?

The script file in the addons pbo-file should be called from a script in my mission with call compile preProcessFile "\inidb\init.sqf"; what is to do that this works?

Are there any reasons which could cause a server to not load an addon?


Guys ur help would be very appreciated cause i m stuck with the creation of my mission and cant do a little step forward until the problem with that addon is solved.




code container for WIP:

if (!isServer) exitWith {true};
	Author: Sarogahtyp
	Title: SSSS - Sarogahtyps Simple Server Statistics


	number - refresh time in seconds

	Return value:
	boolean - true if script has been finished

_admin_check = [];
_admin_obj = objNull;

while {true} do
 // wait for a logged in admin
  sleep (20 + random 20);
  _admin_check = (allPlayers - entities "HeadlessClient_F") select {(admin owner _x) != 0};
  (count _admin_check > 0)

 _admin_obj = admin_check select 0;

 //throw infos as long as admin is logged in
 while {(admin owner _admin_obj) != 0} do
  // collect server infos
  _s_fps = str diag_fps; // frames per second
  _s_just_players = allPlayers - entities "HeadlessClient_F"; // all player objects
  _s_plyr_num = count _just_players; // number of players
  _s_just_HCs = entities "HeadlessClient_F"; // all HC objects
  _s_HC_num = count _just_HCs; // number of headless clients

  _s_a_grp_num = {local (leader _x) and alive (leader _x)} count allGroups; // all groups where alive units in
  _s_e_grp_num = { (count units _x) == 0 } count allGroups; // empty groups
  _s_d_grp_num = { ({!alive _x}count units _x) > 0 }count allGroups; //groups where only deads in
  _s_unit_num = {local _x} count allUnits; // living units
  _s_vec_num = {local _x} count (vehicles - entities "WeaponHolderSimulated"); // living vecs
  _s_wh_num = {local _x} count (entities "WeaponHolderSimulated") //weapons on ground
  _s_al_ent_num = {local _x} count entities [[], [], true, true]; // alive entities
  _s_de_ent_num = {local _x} count entities [[], ["Logic"], true]; //dead entities except logic

  //collect HC infos

  //request not available info from HCs remotely 
  if (_s_HC_num >0) then
   for "_i" from 0 to (_s_HC_num - 1) do 
    _str = format ["Saro_HC_report_%1", _i];
    missionNamespace setVariable [_str, []];
    [_str] remoteExecCall ["Saro_fnc_report_stats_to_server", (_s_just_HCs select _i)];

   //wait until all HCs responded with desired info
    sleep (0.1 + random 0.1);
    _sum = 0;
    for "_i" from 0 to (_s_HC_num - 1) do 
     _str = format ["Saro_HC_report_%1", _i];
     if (count (missionNamespace getVariable _str) > 0) then
      _sum =  _sum + 1;
     (_sum == _s_HC_num)
  sleep (15 + random 15);
 }; // info while end

}; // endless while (end)

	Author: Sarogahtyp
	Title: SSSS - Sarogahtyps Simple Server Statistics
	Function Name:  Saro_fnc_report_stats_to_server;

	Description: function used via remote execution by server to recieve some statistical infos

	String - name of global variable which should returned to server by publicVariableServer

	Return value:

 params ["_ret_string"];
 _tmp_info_array = [];
 _tmp_info_array pushBack diag_fps;
 missionNamespace setVariable [_ret_string, _tmp_info_array];
 publicVariableServer _ret_string;


Share this post

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now