Code:
while {(GVAR(runServer))} do {
if(isNil QUOTE(GVAR(pipeHandle))) then {
LOG("ATEEEMPTING TO OPEN PIPE!");
GVAR(pipeHandle) = ["\\.\pipe\acre_comm_pipe"] call jayarma2lib_fnc_openPipe;
if(isNil(QUOTE(GVAR(pipeHandle)))) then {
if(time > 5) then {
hintSilent "WARNING: ACRE IS NOT CONNECTED TO TEAMSPEAK!";
LOG("Teamspeak3 not responding, trying again.");
};
GVAR(serverStarted) = false;
} else {
LOG("PIPE OPENED!");
GVAR(serverStarted) = true;
};
};
sleep 5;
};
and in another script (read script)...
Code:
if(!(isNil QUOTE(GVAR(pipeHandle)))) then {
_ret = [GVAR(pipeHandle)] call jayarma2lib_fnc_readPipe;
if(!(isNil "_ret")) then {
if(!(_ret == "_JERR_FALSE")) then {
if(_ret != "_JERR_NULL") then {
TRACE_1("got message", _ret);
_ret call GVAR(ioEventFnc);
};
} else {
GVAR(pipeHandle) = nil;
};
};
};
---------- Post added at 01:56 PM ---------- Previous post was at 01:55 PM ----------
oh and I forgot to mention - we use async pipes in JayArmA2Lib, so read will *always* return instantly, it does not block. Same with write. So you can guarantee off of those basic return values in read whether the read was successful or not.
Write operates basically the same. But we have it as a *guaranteed* communication of a single packet if the pipe is open. No partial packet failures.
---------- Post added at 02:12 PM ---------- Previous post was at 01:56 PM ----------
Added OA Beta 73968 Support
VERSION 1.3.5
- Added OA 1.54 B73968 NON-STEAM beta support