Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. private _startTime = diag_tickTime;
  2.  
  3. survive_server_fnc_log = compileFinal preprocessFileLineNumbers "survive_server\functions\server\log.sqf";
  4.  
  5. "Beginning function compile..." call SURVIVE_server_fnc_log;
  6.  
  7. private _totalFunctionsDefined = 0;
  8. {
  9. private _functionTarget = _x;
  10. private _totalFunctionsOfTargetDefined = 0;
  11. format[" Defining '%1' functions:",configName _functionTarget] call SURVIVE_server_fnc_log;
  12. {
  13. private _function = configName _x;
  14. private _file = format["survive_server\functions\%1\%2.sqf",configName _functionTarget,_function];
  15. private _broadcast = getNumber(_x >> "broadcast") > 0;
  16. if !_broadcast then {
  17. _broadcast = getNumber(_functionTarget >> "broadcast") > 0
  18. };
  19. private _code = preprocessFileLineNumbers _file;
  20. if (str _code isEqualTo "{}") then [{
  21. _code = format["Something went wrong during function compile. Function %1(%2) not defined properly!",_function,_file];
  22. _code call SURVIVE_server_fnc_log;
  23. _code = format["systemChat 'SURVIVE | %1'; diag_log 'SURVIVE | %1';",_code];
  24. },{
  25. format[" %1 defined, broadcast: %2",_function,_broadcast] call SURVIVE_server_fnc_log;
  26. _totalFunctionsDefined = _totalFunctionsDefined +1;
  27. _totalFunctionsOfTargetDefined = _totalFunctionsOfTargetDefined +1;
  28. }];
  29. _code = format["_survive_scriptName = '%1'; _survive_broadcast = %2; ",_function,_broadcast] + _code;
  30. missionNamespace setVariable [format["survive_%1_fnc_%2",_functionTarget,_function],compileFinal _code,_broadcast];
  31. } forEach "true" configClasses _x;
  32. format[" Defined %1 '%2' functions",_totalFunctionsOfTargetDefined,configName _functionTarget] call SURVIVE_server_fnc_log;
  33. } forEach "true" configClasses (configFile >> "CfgSurviveServer" >> "CfgFunctions");
  34.  
  35. format["Function compile complete, compiled %1 functions in %2s",_totalFunctionsDefined,diag_tickTime-_startTime] call SURVIVE_server_fnc_log;
  36.  
  37. diag_tickTime call survive_server_fnc_preInit;
  38.  
  39. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement