Skip to content

Commit

Permalink
Added editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Fank committed Jul 9, 2021
1 parent 54a782e commit ed2bac5
Show file tree
Hide file tree
Showing 26 changed files with 321 additions and 321 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# every file
[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

*.pbo
16 changes: 8 additions & 8 deletions addons/@ocap/OcapReplaySaver2.cfg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"addFileUrl": "http://127.0.0.1:5000/data/receive.php?option=addFile",
"dbInsertUrl": "http://127.0.0.1:5000/data/receive.php?option=dbInsert",
"httpRequestTimeout": 120,
"newMode": 1,
"newServerGameType": "PvE",
"newUrl": "http://127.0.0.1:5000/api/v1/operations/add",
"newUrlRequestSecret": "temp123",
"traceLog": 0
"addFileUrl": "http://127.0.0.1:5000/data/receive.php?option=addFile",
"dbInsertUrl": "http://127.0.0.1:5000/data/receive.php?option=dbInsert",
"httpRequestTimeout": 120,
"newMode": 1,
"newServerGameType": "PvE",
"newUrl": "http://127.0.0.1:5000/api/v1/operations/add",
"newUrlRequestSecret": "temp123",
"traceLog": 0
}
16 changes: 8 additions & 8 deletions addons/@ocap/OcapReplaySaver2.cfg.json.sample
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"addFileUrl": "http://127.0.0.1/data/receive.php?option=addFile",
"dbInsertUrl": "http://127.0.0.1/data/receive.php?option=dbInsert",
"httpRequestTimeout": 120,
"newMode": 0,
"newServerGameType": "TvT",
"newUrl": "https://127.0.0.1/api/v1/operations/add",
"newUrlRequestSecret": "pwd1234",
"traceLog": 0
"addFileUrl": "http://127.0.0.1/data/receive.php?option=addFile",
"dbInsertUrl": "http://127.0.0.1/data/receive.php?option=dbInsert",
"httpRequestTimeout": 120,
"newMode": 0,
"newServerGameType": "TvT",
"newUrl": "https://127.0.0.1/api/v1/operations/add",
"newUrlRequestSecret": "pwd1234",
"traceLog": 0
}
2 changes: 1 addition & 1 deletion addons/@ocap/addons/ocap/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ class CfgRemoteExec
allowedTargets = 0;
};
};
};
};
2 changes: 1 addition & 1 deletion addons/@ocap/addons/ocap/functions/fn_addEventHandlers.sqf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
if ((_this call BIS_fnc_objectType) # 0 == "Soldier") then {_this addEventHandler ["FiredMan", {_this spawn ocap_fnc_eh_fired}]};
_this addEventHandler ["Hit", {_this spawn ocap_fnc_eh_hit}];
if ((_this call BIS_fnc_objectType) # 0 == "Soldier") then {ocap_fnc_trackAceThrowing remoteExec ["call", _this]};
if ((_this call BIS_fnc_objectType) # 0 == "Soldier") then {ocap_fnc_trackAceThrowing remoteExec ["call", _this]};
4 changes: 2 additions & 2 deletions addons/@ocap/addons/ocap/functions/fn_addEventMission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if (ocap_saveMissionEnded) then {
// Custom event handler
ocap_customEvent_handle = ["ocap_handleCustomEvent", {
params ["_eventName", "_eventMessage"];
[":EVENT:",
[":EVENT:",
[ocap_captureFrameNo, _eventName, _eventMessage]
] call ocap_fnc_extension;
}] call CBA_fnc_addEventHandler;
Expand All @@ -46,4 +46,4 @@ call ocap_fnc_handleMarkers;

["WMT_fnc_EndMission", {
_this call ocap_fnc_exportData;
}] call CBA_fnc_addEventHandler;
}] call CBA_fnc_addEventHandler;
4 changes: 2 additions & 2 deletions addons/@ocap/addons/ocap/functions/fn_eh_connected.sqf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[":EVENT:",
[":EVENT:",
[ocap_captureFrameNo, "connected", _this select 2]
] call ocap_fnc_extension;
] call ocap_fnc_extension;
4 changes: 2 additions & 2 deletions addons/@ocap/addons/ocap/functions/fn_eh_disconnected.sqf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[":EVENT:",
[":EVENT:",
[ocap_captureFrameNo, "disconnected", _this select 3]
] call ocap_fnc_extension;
] call ocap_fnc_extension;
4 changes: 2 additions & 2 deletions addons/@ocap/addons/ocap/functions/fn_eh_fired.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if (_ammoSimType isEqualTo "shotBullet") then {
_markTextLocal = format["%1 - %2", _muzzleDisp, _magDisp];
};
};

_markName = format["Projectile#%1", _int];
_markColor = "ColorRed";
_markerType = "";
Expand Down Expand Up @@ -131,4 +131,4 @@ if (_ammoSimType isEqualTo "shotBullet") then {
// deleteMarkerLocal _markName;
// };
["ocap_handleMarker", ["DELETED", _markName]] call CBA_fnc_localEvent;
};
};
179 changes: 89 additions & 90 deletions addons/@ocap/addons/ocap/functions/fn_eh_killed.sqf
Original file line number Diff line number Diff line change
@@ -1,100 +1,99 @@
params ["_victim", "_killer", "_instigator"];
if !(_victim getvariable ["ocapIsKilled",false]) then {
_victim setvariable ["ocapIsKilled",true];
_victim setvariable ["ocapIsKilled",true];

[_victim, _killer, _instigator] spawn {
params ["_victim", "_killer", "_instigator"];
private _frame = ocap_captureFrameNo;
if (_killer == _victim) then {
private _time = diag_tickTime;
[_victim, {
_this setVariable ["ace_medical_lastDamageSource", (_this getVariable "ace_medical_lastDamageSource"), 2];
}] remoteExec ["call", _victim];
waitUntil {diag_tickTime - _time > 10 || !(isNil {_victim getVariable "ace_medical_lastDamageSource"})};
_killer = _victim getVariable ["ace_medical_lastDamageSource", _killer];
} else {
_killer
};
if (isNull _instigator) then {
_instigator = UAVControl vehicle _killer select 0
};
if ((isNull _instigator) || (_instigator == _victim)) then {
_instigator = _killer
};
if (_instigator isKindOf "AllVehicles") then {
// _instigator = effectiveCommander _instigator
_instigator = call {
if(alive(gunner _instigator))exitWith{gunner _instigator};
if(alive(commander _instigator))exitWith{commander _instigator};
if(alive(driver _instigator))exitWith{driver _instigator};
effectiveCommander _instigator
};
};
if (isNull _instigator) then {
_instigator = _killer
};
[_victim, _killer, _instigator] spawn {
params ["_victim", "_killer", "_instigator"];
private _frame = ocap_captureFrameNo;
if (_killer == _victim) then {
private _time = diag_tickTime;
[_victim, {
_this setVariable ["ace_medical_lastDamageSource", (_this getVariable "ace_medical_lastDamageSource"), 2];
}] remoteExec ["call", _victim];
waitUntil {diag_tickTime - _time > 10 || !(isNil {_victim getVariable "ace_medical_lastDamageSource"})};
_killer = _victim getVariable ["ace_medical_lastDamageSource", _killer];
} else {
_killer
};
if (isNull _instigator) then {
_instigator = UAVControl vehicle _killer select 0
};
if ((isNull _instigator) || (_instigator == _victim)) then {
_instigator = _killer
};
if (_instigator isKindOf "AllVehicles") then {
// _instigator = effectiveCommander _instigator
_instigator = call {
if(alive(gunner _instigator))exitWith{gunner _instigator};
if(alive(commander _instigator))exitWith{commander _instigator};
if(alive(driver _instigator))exitWith{driver _instigator};
effectiveCommander _instigator
};
};
if (isNull _instigator) then {
_instigator = _killer
};

// [ocap_captureFrameNo, "killed", _victimId, ["null"], -1];
private _victimId = _victim getVariable ["ocap_id", -1];
if (_victimId == -1) exitWith {};
private _eventData = [_frame, "killed", _victimId, ["null"], -1];
// [ocap_captureFrameNo, "killed", _victimId, ["null"], -1];
private _victimId = _victim getVariable ["ocap_id", -1];
if (_victimId == -1) exitWith {};
private _eventData = [_frame, "killed", _victimId, ["null"], -1];

if (!isNull _instigator) then {
_killerId = _instigator getVariable ["ocap_id", -1];
if (_killerId != -1) then {
private _killerInfo = [];
if (_instigator isKindOf "CAManBase") then {
if (vehicle _instigator != _instigator) then {
if (!isNull _instigator) then {
_killerId = _instigator getVariable ["ocap_id", -1];
if (_killerId != -1) then {
private _killerInfo = [];
if (_instigator isKindOf "CAManBase") then {
if (vehicle _instigator != _instigator) then {

// pilot/driver doesn't return a value, so check for this
private _turPath = [];
if (count (assignedVehicleRole _instigator) > 1) then {
_turPath = assignedVehicleRole _instigator select 1;
} else {
_turPath = [-1];
};
// pilot/driver doesn't return a value, so check for this
private _turPath = [];
if (count (assignedVehicleRole _instigator) > 1) then {
_turPath = assignedVehicleRole _instigator select 1;
} else {
_turPath = [-1];
};

private _curVic = getText(configFile >> "CfgVehicles" >> (typeOf vehicle _instigator) >> "displayName");
private _curWepInfo = weaponstate [vehicle _instigator, _turPath];
_curWepInfo params ["_curWep", "_curMuzzle", "_curFiremode", "_curMag"];
private _curWepDisplayName = getText(configFile >> "CfgWeapons" >> _curWep >> "displayName");
private _curMagDisplayName = getText(configFile >> "CfgMagazines" >> _curMag >> "displayName");

private _text = "";
if (count _curMagDisplayName < 22) then {
_text = _curVic + " [" + _curWepDisplayName + " / " + _curMagDisplayName + "]";
} else {
if (_curWep != _curMuzzle) then {
_text = _curVic + " [" + _curWepDisplayName + " / " + _curMuzzle + "]";
} else {
_text = _curVic + " [" + _curWepDisplayName + "]";
};
};
private _curVic = getText(configFile >> "CfgVehicles" >> (typeOf vehicle _instigator) >> "displayName");
private _curWepInfo = weaponstate [vehicle _instigator, _turPath];
_curWepInfo params ["_curWep", "_curMuzzle", "_curFiremode", "_curMag"];
private _curWepDisplayName = getText(configFile >> "CfgWeapons" >> _curWep >> "displayName");
private _curMagDisplayName = getText(configFile >> "CfgMagazines" >> _curMag >> "displayName");
private _text = "";
if (count _curMagDisplayName < 22) then {
_text = _curVic + " [" + _curWepDisplayName + " / " + _curMagDisplayName + "]";
} else {
if (_curWep != _curMuzzle) then {
_text = _curVic + " [" + _curWepDisplayName + " / " + _curMuzzle + "]";
} else {
_text = _curVic + " [" + _curWepDisplayName + "]";
};
};

_killerInfo = [
_killerId,
_text
];
} else {
_killerInfo = [
_killerId,
getText (configFile >> "CfgWeapons" >> currentWeapon _instigator >> "displayName")
];
};
} else {
_killerInfo = [_killerId];
};
_killerInfo = [
_killerId,
_text
];
} else {
_killerInfo = [
_killerId,
getText (configFile >> "CfgWeapons" >> currentWeapon _instigator >> "displayName")
];
};
} else {
_killerInfo = [_killerId];
};

_eventData = [
_frame,
"killed",
_victimId,
_killerInfo,
round(_instigator distance _victim)
];
};
};
_eventData = [
_frame,
"killed",
_victimId,
_killerInfo,
round(_instigator distance _victim)
];
};
};

[":EVENT:", _eventData] call ocap_fnc_extension;
};
};
[":EVENT:", _eventData] call ocap_fnc_extension;
};
};
2 changes: 1 addition & 1 deletion addons/@ocap/addons/ocap/functions/fn_exportData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ if (ocap_needToSave) then {
};
} else {
LOG(["ocap_needToSave is set to false. Not saving"]);
};
};
2 changes: 1 addition & 1 deletion addons/@ocap/addons/ocap/functions/fn_extension.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ _res params ["_result","_returnCode","_errorCode"];

if (_errorCode != 0 || _returnCode != 0) then {
diag_log ["fnc_callextension_zlt.sqf: Error: ", _result, _returnCode, _errorCode, _command, _args];
}
}
2 changes: 1 addition & 1 deletion addons/@ocap/addons/ocap/functions/fn_getDelay.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ isNil {
_sleep = 0;
};
};
_sleep
_sleep
2 changes: 1 addition & 1 deletion addons/@ocap/addons/ocap/functions/fn_getUnitType.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ if (_role == "Man") then {
};
};

_role;
_role;
Loading

0 comments on commit ed2bac5

Please sign in to comment.