Jump to content
hellstorm77

Arma 3 Headless Client

Recommended Posts

INIT.sqf:

if !(hasInterface or isServer) then {

execVM "Spawn1.sqf";

};

Spawn1.sqf

if !(hasInterface or isServer) exitwith {};

_side = createCenter EAST;

_Squad1 = [getMarkerPos "Spawn1", _side, ["O_soldier_SL_F","O_soldier_TL_F", "O_soldier_AR_F", "O_soldier_AAR_F", "O_soldier_AA_F"], [], [], [0.3, 0.6]] call BIS_fnc_spawnGroup;

[leader _Squad1,"Sector1","random"] execVM "scripts\UPSMON.sqf";

What's wrong? The headless client is connected, but after 5 min or so, one immortal AI without weapon, spawn right on the Spawn1 marker. He is not moving and I can't kill him.

Share this post


Link to post
Share on other sites
INIT.sqf:

if !(hasInterface or isServer) then {

execVM "Spawn1.sqf";

};

Spawn1.sqf

if !(hasInterface or isServer) exitwith {};

_side = createCenter EAST;

_Squad1 = [getMarkerPos "Spawn1", _side, ["O_soldier_SL_F","O_soldier_TL_F", "O_soldier_AR_F", "O_soldier_AAR_F", "O_soldier_AA_F"], [], [], [0.3, 0.6]] call BIS_fnc_spawnGroup;

[leader _Squad1,"Sector1","random"] execVM "scripts\UPSMON.sqf";

What's wrong? The headless client is connected, but after 5 min or so, one immortal AI without weapon, spawn right on the Spawn1 marker. He is not moving and I can't kill him.

The headless client for GNU/Linux seems broken to me. The client never "fully loads" into the game, even if he is not kicked. Have a look at the player list as admin (ingame, open the map and go to players) and you'll see that the headless still has the sandclock icon. Funny thing is that he is not "nil". So our scripts seem to work.

I installed wine and Xvfb and switched to the windows headless client for now. Works good for us now. Bohemia please fix this.

Share this post


Link to post
Share on other sites

Did the headless client slot up? Because if he didn't a solution I have found is giving him a name in the editor. No idea why that's necessary (as it's nowhere mentioned on the wiki afaik).

Share this post


Link to post
Share on other sites

I have found that in the shortcut that fires up the HC, you need to give a port. So on this page, where it says

Windows: arma3server.exe -client -connect=xxx.xxx.xxx.xxx -password=yourpass

mine actually says

Windows: arma3server.exe -client -connect=127.0.0.1:2309 -password=yourpass

Also, there were some comments about the HC needing a profile. Do I need to do this? the server console says the headlessclient is loadinga profile, but I never made one....

mNHEays.png

Edited by Tankbuster

Share this post


Link to post
Share on other sites
Did the headless client slot up? Because if he didn't a solution I have found is giving him a name in the editor. No idea why that's necessary (as it's nowhere mentioned on the wiki afaik).

Yep, he did slot up. But never finished loading. Sandclock is displayed all the time. As I've said, a workaround for know that works for us is the windows HC via wine.

Share this post


Link to post
Share on other sites

I'm running a HC with Wine as well right now as it still is incompatible with AIATP for whatever reason. Performance seems pretty good for now.

Share this post


Link to post
Share on other sites

Just as a short heads-up. I tried the GNU/Linux headless client again today and it seems to be working now. No more sandclock on the briefing screen. I just tried it without signature verification for now. ArmA on GNU/Linux isn't handling case-sensitivity in file names too well it seems. Also the headless isn't automatically reconnecting after it looses connection (after server shutdown).

Share this post


Link to post
Share on other sites

I am having a really hard time working out some issues I'm having with HC.

 

I have been running a Windows server with HC without any issues but recently I have decided to switch to running my ARMA 3 server and HC on a Linux server which is my personal preferred platform. The problem I am having is that I can't get HC to pass the signature check.

 

I can connect to the server and I pass the signature check without any issues. I figured that the problem most likely is the case of Linux being case sensitive so I changed all of the file names to lower case and tried again without success.

 

I next tried re-signing the mods because previously the key had a capital letter so I created a new private key simply called server.bikey. I have test this on a windows server to ensure its working but for whatever reason I just can't get the HC work with signature checks on.

 

17:48:08 Warning Message: Files "/home/steam/steamcmd/arma3/mods/@golislandsa3\addons\ibr_dualaobjects.pbo", "/home/steam/steamcmd/arma3/mods/@golislandsa3\addons\ibr_plants.pbo", "/home/steam/steamcmd/arma3/mods/@golislandsa3\addons\ibr_rn.pbo", "/home/steam/steamcmd/arma3/mods/@golislandsa3\addons\isladuala3.pbo", "/home/steam/steamcmd/arma3/mods/@golislandsa3\addons\mbg_generic_african_buildings.pbo", "/home/steam/steamcmd/arma3/mods/@golislandsa3\addons\panthera3.pbo", ... are not signed by a key accepted by this server. To play on this server, remove listed files or install additional accepted keys.

 

Looking at the error above I can see that the path changes when loading the mod to \addons rather than /addons so technically this file won't exist if you attempt to 'ls' it. But the mods are loading correctly on the server so I am confused on how I can go about resolving this issue.

 

It would be great if there was a way to allow the HC to skip the signature checks but if anyone could provide me with any advice on how to solve this issue that would be great.

Thanks,

Share this post


Link to post
Share on other sites

I am having a really hard time working out some issues I'm having with HC.

 

I have been running a Windows server with HC without any issues but recently I have decided to switch to running my ARMA 3 server and HC on a Linux server which is my personal preferred platform. The problem I am having is that I can't get HC to pass the signature check.

 

I can connect to the server and I pass the signature check without any issues. I figured that the problem most likely is the case of Linux being case sensitive so I changed all of the file names to lower case and tried again without success.

 

I next tried re-signing the mods because previously the key had a capital letter so I created a new private key simply called server.bikey. I have test this on a windows server to ensure its working but for whatever reason I just can't get the HC work with signature checks on.

 

17:48:08 Warning Message: Files "/home/steam/steamcmd/arma3/mods/@golislandsa3\addons\ibr_dualaobjects.pbo", "/home/steam/steamcmd/arma3/mods/@golislandsa3\addons\ibr_plants.pbo", "/home/steam/steamcmd/arma3/mods/@golislandsa3\addons\ibr_rn.pbo", "/home/steam/steamcmd/arma3/mods/@golislandsa3\addons\isladuala3.pbo", "/home/steam/steamcmd/arma3/mods/@golislandsa3\addons\mbg_generic_african_buildings.pbo", "/home/steam/steamcmd/arma3/mods/@golislandsa3\addons\panthera3.pbo", ... are not signed by a key accepted by this server. To play on this server, remove listed files or install additional accepted keys.

 

Looking at the error above I can see that the path changes when loading the mod to \addons rather than /addons so technically this file won't exist if you attempt to 'ls' it. But the mods are loading correctly on the server so I am confused on how I can go about resolving this issue.

 

It would be great if there was a way to allow the HC to skip the signature checks but if anyone could provide me with any advice on how to solve this issue that would be great.

Thanks,

 

Known issue with linux.

 

http://feedback.arma3.com/view.php?id=22914

 

Can't login to feedback tracker (SHOCKER!) to fix the 'fixed in version XX'

 
It's either related to AiATP or amount of mods loaded, but it has received very little love from A3 devs.

Share this post


Link to post
Share on other sites

I think you're correct it is the amount of mods loaded. I can load any of the single directories on their own without any problems but loading more than three results in the HC being kicked for failing the signature check.

 

I have tried putting all the mods in a single directory but this doesn't work either.

 

Not sure what else I can do really other than turn off signature checks which isn't really something I want to do even on a private server.

 

Quite disappointed that this hasn't been addressed yet.

Share this post


Link to post
Share on other sites

I think you're correct it is the amount of mods loaded. I can load any of the single directories on their own without any problems but loading more than three results in the HC being kicked for failing the signature check.

 

I have tried putting all the mods in a single directory but this doesn't work either.

 

Not sure what else I can do really other than turn off signature checks which isn't really something I want to do even on a private server.

 

Quite disappointed that this hasn't been addressed yet.

We are runnning like 10 mods with the HC and server and no diconnections issues. Check the signatures. Load the exact same configuration yourself (as the HC acts like any other client, if you can connect, the HC can too.)

Share this post


Link to post
Share on other sites

Have you guys seen this?

 

http://www.armaholic.com/page.php?id=28917

 

Maybe its not a big issue for others, but we found with our previous system that we had to remember to exclude any AI that had a waypoint synced with a trigger. Werthes's system is completely automatic. Ive tested it with 20 players and it works well.

Share this post


Link to post
Share on other sites

Hello I need some help I started messing with setting up a headless client again after awhile of not fooling with it had it working before now client just keeps getting kick from the steam ticket failed null. This is what I have in my shortcut to launch the client\

 

 "D:\steam folder\SteamApps\common\Arma 3\arma3.exe" -connect=199.168.142.115:2402 -client -nosound -name=headlessclient -profile=HC -password=...... -mod=@CBA_A3

 

And this is what I have on our dedicated server we rent\ 

 

// Config file generated 8/5/2014 12:11 AM with TADST.
 
hostName = "TIER1 DELTA PRIVATE";
 
password = "....";
 
passwordAdmin = "....";
 
logFile = "server_console.log";
 
motd[] = {
"", "",  
"",
"",
"",
"",
""
};
motdInterval = 3;
 
 
maxPlayers = 20;
 
kickduplicate = 1;
 
verifySignatures = 0;
 
headlessClients[]={"127.0.0.1", "192.168.1.7"};
 
localclient[]={"127.0.0.1" ,"192.168.1.7"};
 
battleyeLicense=1;
 
requiredSecureId = 0;
 
voteMissionPlayers = 3;
 
voteThreshold = 1.5;
 
 
disableVoN = 0;
 
vonCodecQuality = 10;
 
persistent = 1;
 
timeStampFormat = "none";
 
BattlEye = 0;
 
 
doubleIdDetected = "";
 
onUserConnected = "";
 
onUserDisconnected = "";
 
onHackedData = "";
 
onDifferentData = "";
 
onUnsignedData = "";
 
regularCheck = "";
class Missions
{
class Mission1
{
template="co40_liberation.Altis";
difficulty="Regular";
};
};
 
Any help would be great I can't figure out why the client gets kicked every time I have tried all kinds of different ways to make it work thanks.

Share this post


Link to post
Share on other sites

Is the headless client on the same computer ?

When on same, add the server ip to your server.cfg too.

 
headlessClients[]={"127.0.0.1", "192.168.1.7","199.168.142.115"};
localclient[]={"127.0.0.1" ,"192.168.1.7","199.168.142.115"};

 

I am not shure if it´s important, but change your startparameter to

-client -connect=199.168.142.115:2402 ...

 

CBA server key is in keys folder ?

Share this post


Link to post
Share on other sites

Thanks for the response I figured it out the headless client is running on my second PC and connecting to our server we rent as I was adding my local IP instead of the correct IP DUUUHH it would not connect added the right one and boom works like a champ. Anther question I have though is if I add 3 HC slots in a mission for example will the other 2 HC1, HC2 auto slot into those units and will it distribute the AI load across all three HC'S would I have to add something in the init.sqf code for it to recognize them? Also would it be better to have all 3 HC'S on 3 different PC'S or would it still work fine on one with a decent hardware setup? Thanks

Share this post


Link to post
Share on other sites

the easy way for HC implementation read post 291 or look here

http://www.armaholic.com/page.php?id=28917 or check this post

https://forums.bistudio.com/topic/171050-bmr-insurgency/?p=2899976

 

I have Arma Server + 2 HC´s running on same rootserver, it´s fine.

 

Can you use werthless's HC in conjunction with Tophe's dedicated server tool (TADST)?

 

Has anyone tried this?

 

With ALiVE now having full HC support with no scripting required, and TADST having an option to enable HC support and plug in IPs, I'm wondering how I could merge Werthless's HC tool with it.  (never used a HC before)

Share this post


Link to post
Share on other sites

So what does setGroupOwner actually do?

 

If a thread (FSM) is started when a unit or group is created (createUnit/createGroup), then does this thread get terminated on the old machine when ownership is transferred to the new machine?

Share this post


Link to post
Share on other sites

So I'm wondering if anyone else has run into this problem. No matter what script i use to transfer Zeus placed AI to headless client, eventually a handful of the AI will loose all their gear (except glasses, weirdly. These are all run with CBA, RHS, ACE, AiATP, TFAR, and Nwsaigo. Here are the scripts I've tried:

aitohc.sqf

/*
 * aitohc.sqf
 *
 * By VCRPlayer
 *
 * This script will move ANY ai (ie: zeus-spawned, etc)         to the headless client for processing on every frame
 * 
 * In init.sqf, put "[] execVM "scripts\aitohc.sqf";" (without outer quotes)
 *
 * In the description of the HeadlessClient virtual unit, put HC
 */
if (!isServer) exitWith {};
_HC = owner "HC"; //"HC" denotes the name of the unit in-game
waitUntil {!isNil "HC"};

 ["HCS_addToHC", "onEachFrame", {
    if ((isPlayer)||(_x in units group _HC)) exitWith {};
    if (isNull _HC) ExitWith{};

    { _x setGroupOwner _HC; //adding all units that aren't player or aren't already under HC to HC
    }forEach allUnits;

}] call BIS_fnc_addStackedEventHandler;

My Own Custom Script (simpleHC.sqf)

//Run in init.sqf
_run = true;
_HCowned = [];

while {_run} do
{
	_HCid = owner HC;
	_AIgroups = allGroups;
	_notOwned = _AIgroups - _HCowned;
	{_x setGroupOwner _HCid; _HCowned pushBack _x;} forEach _notOwned;
	sleep 30;
};

Another try of my own (simpleHCcheck.sqf)

//Run in initServer.sqf
if (!isServer) exitWith {};
waitUntil {!isNil "HC"};
waitUntil {!isNull HC};

while {true} do
{
_HCid = owner HC;
_PlayerGroups = [];
_PlayerOwners = [];
_AIGroups = [];
_AIOwners = [];

{if (count (units _x)==0) then {deleteGroup _x;}; sleep 2} forEach allGroups;

{if ({isPlayer _x} count units _x > 0) then {_PlayerGroups pushBack _x;}; sleep 2} forEach allGroups;
{if ({isPlayer _x} count units _x == 0) then {_AIGroups pushBack _x;}; sleep 2} forEach allGroups;
{if !((groupOwner _x) isEqualTo _HCid) then {_x setGroupOwner _HCid;}; sleep 4} forEach _AIGroups;

{_PlayerOwners pushback groupOwner _x;} forEach _playerGroups;
{_AIOwners pushback groupOwner _x;} forEach _AIGroups;

Pub_PlayerOwners = _PlayerOwners;
publicVariable "Pub_PlayerOwners";
Pub_AIOwners = _AIOwners;
publicVariable "Pub_AIOwners";
Pub_HCOwner = _HCid;
publicVariable "Pub_HCOwner";

};

And I've also tried (with only 1 HC).

/*
 * passToHCs.sqf
 *
 * In the mission editor, name the Headless Clients "HC", "HC2", "HC3" without the quotes
 *
 * In the mission init.sqf, call passToHCs.sqf with:
 * execVM "passToHCs.sqf";
 *
 * It seems that the dedicated server and headless client processes never use more than 20-22% CPU each.
 * With a dedicated server and 3 headless clients, that's about 88% CPU with 10-12% left over.  Far more efficient use of your processing power.
 *
 */

if (!isServer) exitWith {};

diag_log "passToHCs: Started";

waitUntil {!isNil "HC"};
waitUntil {!isNull HC};

_HC_ID = -1; // Will become the Client ID of HC
_HC2_ID = -1; // Will become the Client ID of HC2
_HC3_ID = -1; // Will become the Client ID of HC3
rebalanceTimer = 60;  // Rebalance sleep timer in seconds
cleanUpThreshold = 50; // Threshold of number of dead bodies + destroyed vehicles before forcing a clean up

diag_log format["passToHCs: First pass will begin in %1 seconds", rebalanceTimer];

while {true} do {
  // Rebalance every rebalanceTimer seconds to avoid hammering the server
  sleep rebalanceTimer;

  // Do not enable load balancing unless more than one HC is present
  // Leave this variable false, we'll enable it automatically under the right conditions  
  _loadBalance = false;

   // Get HC Client ID else set variables to null
   try {
    _HC_ID = owner HC;

    if (_HC_ID > 2) then {
      diag_log format ["passToHCs: Found HC with Client ID %1", _HC_ID];
    } else { 
      diag_log "passToHCs: [WARN] HC disconnected";

      HC = objNull;
      _HC_ID = -1;
    };
  } catch { diag_log format ["passToHCs: [ERROR] [HC] %1", _exception]; HC = objNull; _HC_ID = -1; };

  // Get HC2 Client ID else set variables to null
  if (!isNil "HC2") then {
    try {
      _HC2_ID = owner HC2;

      if (_HC2_ID > 2) then {
        diag_log format ["passToHCs: Found HC2 with Client ID %1", _HC2_ID];
      } else { 
        diag_log "passToHCs: [WARN] HC2 disconnected";

        HC2 = objNull;
        _HC2_ID = -1;
      };
    } catch { diag_log format ["passToHCs: [ERROR] [HC2] %1", _exception]; HC2 = objNull; _HC2_ID = -1; };
  };

  // Get HC3 Client ID else set variables to null
  if (!isNil "HC3") then {
    try {
      _HC3_ID = owner HC3;

      if (_HC3_ID > 2) then {
        diag_log format ["passToHCs: Found HC2 with Client ID %1", _HC3_ID];
      } else { 
        diag_log "passToHCs: [WARN] HC3 disconnected";

        HC3 = objNull;
        _HC3_ID = -1;
      };
    } catch { diag_log format ["passToHCs: [ERROR] [HC3] %1", _exception]; HC3 = objNull; _HC3_ID = -1; };
  };

  // If no HCs present, wait for HC to rejoin
  //if ( (isNull HC) && (isNull HC2) && (isNull HC3) ) then { waitUntil {!isNull HC}; };  

  // Check to auto enable Round-Robin load balancing strategy
  //if ( (!isNull HC && !isNull HC2) || (!isNull HC && !isNull HC3) || (!isNull HC2 && !isNull HC3) ) then { _loadBalance = true; };

  if ( _loadBalance ) then {
    diag_log "passToHCs: Starting load-balanced transfer of AI groups to HCs";
  } else {
    // No load balancing
    diag_log "passToHCs: Starting transfer of AI groups to HC";
  };

  // Determine first HC to start with
  _currentHC = 0;

  if (!isNull HC) then { _currentHC = 1; } else { 
    if (!isNull HC2) then { _currentHC = 2; } else { _currentHC = 3; };
  };

  // Pass the AI
  _numTransfered = 0;
  {
    _swap = true;

    // If a player is in this group, don't swap to an HC
    { if (isPlayer _x) then { _swap = false; }; } forEach (units _x);

    // If load balance enabled, round robin between the HCs - else pass all to HC
    if ( _swap ) then {
      _rc = false;

      if ( _loadBalance ) then {
        switch (_currentHC) do {
          case 1: { _rc = _x setGroupOwner _HC_ID; if (!isNull HC2) then { _currentHC = 2; } else { _currentHC = 3; }; };
          case 2: { _rc = _x setGroupOwner _HC2_ID; if (!isNull HC3) then { _currentHC = 3; } else { _currentHC = 1; }; };
          case 3: { _rc = _x setGroupOwner _HC3_ID; if (!isNull HC) then { _currentHC = 1; } else { _currentHC = 2; }; };
          default { diag_log format["passToHCs: [ERROR] No Valid HC to pass to.  _currentHC = %1", _currentHC]; };
        };
      } else {
        switch (_currentHC) do {
          case 1: { _rc = _x setGroupOwner _HC_ID; };
          case 2: { _rc = _x setGroupOwner _HC2_ID; };
          case 3: { _rc = _x setGroupOwner _HC3_ID; };
          default { diag_log format["passToHCs: [ERROR] No Valid HC to pass to.  _currentHC = %1", _currentHC]; };
        };
      };

      // If the transfer was successful, count it for accounting and diagnostic information
      if ( _rc ) then { _numTransfered = _numTransfered + 1; };
    };
  } forEach (allGroups);

  if (_numTransfered > 0) then {
    // More accounting and diagnostic information

    diag_log format ["passToHCs: Transfered %1 AI groups to HC(s)", _numTransfered];

    _numHC = 0;
    _numHC2 = 0;
    _numHC3 = 0;

    {
      switch (owner ((units _x) select 0)) do {
        case _HC_ID: { _numHC = _numHC + 1; };
        case _HC2_ID: { _numHC2 = _numHC2 + 1; };
        case _HC3_ID: { _numHC3 = _numHC3+ 1; };
      };
    } forEach (allGroups);

    if (_numHC > 0) then { diag_log format ["passToHCs: %1 AI groups currently on HC", _numHC]; };
    if (_numHC2 > 0) then { diag_log format ["passToHCs: %1 AI groups currently on HC2", _numHC2]; };
    if (_numHC3 > 0) then { diag_log format ["passToHCs: %1 AI groups currently on HC3", _numHC3]; };

    diag_log format ["passToHCs: %1 AI groups total across all HC(s)", (_numHC + _numHC2 + _numHC3)];
  } else {
    diag_log "passToHCs: No rebalance or transfers required this round";
  };

  // Force clean up dead bodies and destroyed vehicles
  if (count allDead > cleanUpThreshold) then {
    _numDeleted = 0;
    {
      deleteVehicle _x;

      _numDeleted = _numDeleted + 1;
    } forEach allDead;

    diag_log format ["passToHCs: Cleaned up %1 dead bodies/destroyed vehicles", _numDeleted];
  };
};

Any thoughts, or anyone experiencing the same issues?

Share this post


Link to post
Share on other sites

Also, the above generally happens only after i've placed roughly 8+ groups, and happens faster with larger groups (squad sized) whereas with fireteams i can get to 20 or 25 sometimes. Then again other times it will happen with the 1st or 2nd group.

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

×