From 3246bad8d063041ece12dca290c618d21c9617a4 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Thu, 24 Oct 2013 18:35:36 -0500 Subject: [PATCH] recode so it does not rely on hpp --- SQF/dayz_code/system/REsec.hpp | 34 ---------------------------------- SQF/dayz_code/system/REsec.sqf | 12 +++++++----- 2 files changed, 7 insertions(+), 39 deletions(-) delete mode 100644 SQF/dayz_code/system/REsec.hpp diff --git a/SQF/dayz_code/system/REsec.hpp b/SQF/dayz_code/system/REsec.hpp deleted file mode 100644 index 840fdc424..000000000 --- a/SQF/dayz_code/system/REsec.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - Created exclusively for ArmA2:OA - DayZMod. - Please request permission to use/alter/distribute from project leader (R4Z0R49) AND the author (facoptere@gmail.com) -*/ - -// These RE commands will be cancelled once init.sqf is exec'ed on client or server -#ifndef REMOVED_LIB -#define REMOVED_LIB [ "addAction", "addEventhandler", "addMagazine", "addMagazineCargo", "addWeapon", \ -"addWeaponCargo", "addWPCur", "animate", "callVar", "clearMagazineCargo", "clearWeaponCargo", "createDiaryRecord", \ -"createMarkerLocal", "createSimpleTask", "createTaskSet", "debugLog", "deleteWP", "enablesimulation", "endMission", \ -"execfsm", "fadeMusic", "fadeSound", "failMission", "globalChat", "globalRadio", "groupChat", "groupRadio", \ -"hideObject", "hint", "hintC", "kbAddTopic", "kbreact", "kbRemoveTopic", "kbtell", "land", "move", "moveIn", \ -"playAction", "playActionnow", "playmovenow", "playMusic", "playsound", "removeAction", \ -"removeAllWeapons", "setCaptive", "setCurrentTask", "setCurrentTaskArrays", "setDate", "setDir", "setGroupID", \ -"setMarkerPosLocal", "setObjectTexture", "setSimpleTaskDescription", "setTaskState", "setWPdesc", "setWPtype", \ -"showCommandingMenu", "sideChat", "sideRadio", "skiptime", "spawn", "switchAction", "switchCamera", "taskHint", \ -"titleCut", "Hangender"] -#endif - -// Allowed commands -#ifndef TRACED_LIB -#define TRACED_LIB [ "execVM", "JIPexec", "JIPrequest", "say", "playmove", "switchmove", "titleText" ] -// uncomment following line to log all incoming allowed RE -// #define RESEC_VERBOSE -#endif - -// Special logic for execVM, only these whitelisted scripts will be spawned -#ifndef WHITELISTED_EXECVM -#define WHITELISTED_EXECVM [ ""ca\Modules\Functions\init.sqf"" ] -// uncomment and put in the array above if you want your server be able to kick players (not used in DayZ for now) -//""ca\Modules\MP\data\scriptCommands\endMission.sqf"" -#endif - -#define Stringify(macro) #macro diff --git a/SQF/dayz_code/system/REsec.sqf b/SQF/dayz_code/system/REsec.sqf index f77f4f1a6..7c9bb06bd 100644 --- a/SQF/dayz_code/system/REsec.sqf +++ b/SQF/dayz_code/system/REsec.sqf @@ -3,25 +3,27 @@ Please request permission to use/alter/distribute from project leader (R4Z0R49) AND the author (facoptere@gmail.com) */ -#include "REsec.hpp" +_REMOVED_LIB = ["addAction", "addEventhandler", "addMagazine", "addMagazineCargo", "addWeapon","addWeaponCargo", "addWPCur", "animate", "callVar", "clearMagazineCargo", "clearWeaponCargo", "createDiaryRecord","createMarkerLocal", "createSimpleTask", "createTaskSet", "debugLog", "deleteWP", "enablesimulation", "endMission","execfsm", "fadeMusic", "fadeSound", "failMission", "globalChat", "globalRadio", "groupChat", "groupRadio","hideObject", "hint", "hintC", "kbAddTopic", "kbreact", "kbRemoveTopic", "kbtell", "land", "move", "moveIn","playAction", "playActionnow", "playmovenow", "playMusic", "playsound", "removeAction","removeAllWeapons", "setCaptive", "setCurrentTask", "setCurrentTaskArrays", "setDate", "setDir", "setGroupID","setMarkerPosLocal", "setObjectTexture", "setSimpleTaskDescription", "setTaskState", "setWPdesc", "setWPtype","showCommandingMenu", "sideChat", "sideRadio", "skiptime", "spawn", "switchAction", "switchCamera", "taskHint","titleCut", "Hangender"]; +_TRACED_LIB = ["execVM", "JIPexec", "JIPrequest", "say", "playmove", "switchmove", "titleText"]; + waitUntil{!isNil "BIS_MPF_InitDone"}; -private["_ofn","_nfn"]; +private["_ofn","_nfn","_REMOVED_LIB","_TRACED_LIB"]; { _ofn=format["r%1code",_x]; _nfn=format["r%1code%2",_x,round(random(100000))]; if(_x=="execVM")then{ - call compile format["%1=%2;%2={if((count _this>=3)AND{(!((_this select 2)IN%3))})then{diag_log(""WARNING RE %2 with illegal args:""+str(_this));}else{_this call %1}};",_nfn,_ofn,Stringify(WHITELISTED_EXECVM)]; + call compile format["%1=%2;%2={if((count _this>=3)AND{(!((_this select 2)IN%3))})then{diag_log(""WARNING RE %2 with illegal args:""+str(_this));}else{_this call %1}};",_nfn,_ofn,["ca\Modules\Functions\init.sqf"]]; }else{ #ifdef RESEC_VERBOSE call compile format ["%1=%2;%2={diag_log(""RE %2 args:""+str(_this));_this call %1};",_nfn,_ofn]; #endif }; -}foreach TRACED_LIB; +}foreach _TRACED_LIB; { _ofn=format["r%1code",_x]; call compile format["%1={diag_log(""WARNING illegal RE %1 with args:""+str(_this));};",_ofn]; -}foreach REMOVED_LIB; +}foreach _REMOVED_LIB; #ifndef SKIP_REMOTEEXECUTIONSERVER []spawn{