more common code cleanup

This commit is contained in:
commy2 2015-09-19 19:40:56 +02:00
parent 20a5c79431
commit cbc7f961b2
4 changed files with 53 additions and 47 deletions

View File

@ -1,22 +1,19 @@
/**
* fn_requestCallback.sqf
* @Descr: N/A
* @Author: Glowbal
/*
* Author: Glowbal
* N/A
*
* @Arguments: []
* @Return:
* @PublicAPI: false
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: No
*/
#include "script_component.hpp"
private ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"];
PARAMS_2(_info,_accepted);
params ["_info", "_accepted"];
_caller = _info select 0;
_target = _info select 1;
_requestID = _info select 2;
_requestMessage = _info select 3;
_callBack = _info select 4;
_info params ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"];
[_caller, _target, _accepted] call compile _callBack;
[_caller, _target, _accepted] call compile _callBack;

View File

@ -1,19 +1,20 @@
/*
* Author: jaynus
*
* Send a request to synchronize an event name from the client->server. Execute on client only.
*
* Argument:
* 0: eventName (String)
* Arguments:
* 0: eventName <STRING>
*
* Return value:
* Return Value:
* Boolean of success
*
* Public: No
*/
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
PARAMS_1(_eventName);
params ["_eventName"];
// Only JIP machines on initialization send this off, requesting sync on events with the serverCommand
if(isServer) exitWith { false };
if (isServer) exitWith {false};
["SEH_s", [_eventName, ACE_player] ] call ace_common_fnc_serverEvent;
["SEH_s", [_eventName, ACE_player] ] call FUNC(serverEvent);

View File

@ -1,39 +1,44 @@
/**
* fn_resetAllDefaults_f.sqf
* @Descr: reset all variables that have been defined
* @Author: Glowbal
/*
* Author: Glowbal
* reset all variables that have been defined
*
* @Arguments: []
* @Return:
* @PublicAPI: false
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_unit);
params ["_unit"];
_unit setvariable ["ACE_isDead",nil,true];
_unit setvariable ["ACE_isDead", nil, true];
_unit setvariable ["ACE_isUnconscious", nil, true];
if (isPlayer _unit) then {
[true] call FUNC(setVolume);
[false] call FUNC(disableKeyInput);
if (["ace_medical"] call FUNC(isModLoader)) then {
[false] call EFUNC(medical,effectBlackOut);
};
if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then {
if !(isNil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then {
// clear all disable user input
{
[_x, false] call FUNC(setDisableUserInputStatus);
}foreach GVAR(DISABLE_USER_INPUT_COLLECTION);
false
} count GVAR(DISABLE_USER_INPUT_COLLECTION);
};
};
{
if (!(_x select 4)) then {
_unit setvariable [(_x select 0),nil,_x select 3];
if !(_x select 4) then {
_unit setvariable [_x select 0, nil, _x select 3];
};
} forEach ([_unit] call FUNC(getAllDefinedSetVariables));
false
} count ([_unit] call FUNC(getAllDefinedSetVariables));
_unit setVariable ["ACE_forceWalkStatusNumber", 0, true];

View File

@ -3,18 +3,19 @@
*
* Called from respawn eventhandler. Resets all public object namespace variables that are added via FUNC(setVariableJIP).
*
* Argument:
* 0: Object (Object)
* Arguments:
* 0: Object <OBJECT>
*
* Return value:
* Nothing.
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit"];
private "_respawnVariables";
PARAMS_1(_unit);
_respawnVariables = _unit getVariable ["ACE_respawnVariables", []];
// yes those
@ -22,4 +23,6 @@ _respawnVariables pushBack "ACE_PersistentFunctions";
{
_unit setVariable [_x, _unit getVariable _x, true];
} forEach _respawnVariables;
false
} count _respawnVariables;
nil