Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
h4wek

Headless client locality problem

Recommended Posts

Hello Guys I have somestrange behaviour of readig locality onn HC's machines - I was prepared script for monitor load on every HC so when script check that HC is local make check of local units on it and broadcast to other machines by public variable 

 

while {true} do {

    if (isServer) then {
        SERWERFPS = [gamelogic,"SERWER",round diag_fps,{local _x} count allUnits];publicvariable "SERWERFPS";
        if (!isplayer (HC1FPS#0)) then {if (HC1FPS isnotequalto [objnull,"HC_1",-1,0]) then {HC1FPS = [objnull,"HC_1",-1,0];publicvariable "HC1FPS"}};
        if (!isplayer (HC2FPS#0)) then {if (HC2FPS isnotequalto [objnull,"HC_2",-1,0]) then {HC2FPS = [objnull,"HC_2",-1,0];publicvariable "HC2FPS"}};
    }else {
        if (!isDedicated && !hasInterface && isMultiplayer && (count (entities "HeadlessClient_F") > 0)) then {
                    private _HCS = (entities "HeadlessClient_F");
                    if (count _HCS > 0) then {if (local (_HCS#0)) then {HC1FPS = [(_HCS#0),"HC_1",round diag_fps,{local _x} count allUnits];publicvariable "HC1FPS"}};
                    if (count _HCS > 1) then {if (local (_HCS#1)) then {HC2FPS = [(_HCS#1),"HC_2",round diag_fps,{local _x} count allUnits];publicvariable "HC2FPS"}};
            };
    };
    sleep 5+(random 3);
};

 

And it works perfectly on 1 HC but when I have 2 - it go to hell beacouse  command for check if HC's is local for itself return wrong state for example I have 2 HC's machines with network ID 5 and 6 - this IDs return server when I ask for it by command.

?imw=5000&imh=5000&ima=fit&impolicy=Lett

 

so I ask in variable local_1 and local_2 if HC1 is local for machine 5 and 6 and guess what ......... HC1 is for both of them !!!!! so in my results I get overwrited data form 2 HC's  beacouse they didnt know who they are for themself (for HC1 and HC2 comand localHC1 return true) and for HC2 this command return on both false so ??? HC1 and HC2 is the same machine? or HC2 not exist??

 

?imw=5000&imh=5000&ima=fit&impolicy=Lett

 

So simple question is it bug or not ???

Share this post


Link to post
Share on other sites

×