new compiler with optional v2 format more like BI's
added expanded startup init logic
moved mirror setup to own function inside epoch core
moved server init code to main gamemode init logic.
This commit is contained in:
vbawol 2016-09-08 12:09:58 -05:00
parent e817f1e2e5
commit 6cdb9633d4
40 changed files with 76 additions and 124 deletions

View File

@ -4,7 +4,7 @@
Contributors:
Description:
Request loot event and setup mirror
Request loot event
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
@ -14,29 +14,4 @@
*/
if (!isNull _this) then {
[_this,player,Epoch_personalToken] remoteExec ["EPOCH_server_lootContainer",2];
if (typeof _this == "wardrobe_EPOCH") then {
if !(_this getVariable["MIRROR_SETUP", false]) then {
_this spawn {
_this setVariable ["MIRROR_SETUP", true];
_cam = "camera" camCreate (_this modelToWorld [0,0.25,1.5]);
_cam camSetTarget (_this modelToWorld [0,-30,1]);
_cam camSetFov 0.3;
_cam camCommit 0;
"rendertargetwardrobe0" setPiPEffect [0];
_cam cameraEffect ["Internal", "FRONT","rendertargetwardrobe0"];
_this setObjectTexture [0,"#(argb,512,512,1)r2t(rendertargetwardrobe0,1.0)"];
waitUntil {
uiSleep 5;
(isNull _this) || ((_this distance player) > 20)
};
_cam cameraEffect ["terminate","back"];
camDestroy _cam;
_this setVariable["MIRROR_SETUP", nil];
_this setObjectTexture [0,""];
};
};
};
};

View File

@ -24,53 +24,52 @@
BOOL
*/
//[[[cog import generate_private_arrays ]]]
private ["_cat","_config","_file","_file_raw","_file_tag","_fnc_path","_itemCompile","_return","_returnConfig","_tag","_var_name","_version"];
private ["_config","_config_name","_file","_file_raw","_file_tag","_fnc_path","_missionConfig","_tag","_var_name","_version"];
//[[[end]]]
params [["_configName","",[""] ] ];
_returnConfig = {
private["_return", "_config"];
_return = (configfile >> _this);
_config = (getMissionConfig _this);
if (isClass _config) then{
_return = _config;
_config = (configfile >> _configName);
_missionConfig = (getMissionConfig _configName);
if (isClass _missionConfig) then{
_config = _missionConfig;
};
_return
};
_config = _configName call _returnConfig;
_version = getNumber(_config >> "version");
if (_version == 1) then {
if (_version >= 1) then {
{
if (isClass(_x)) then {
_tag = getText(_x >> "tag");
_file = getText(_x >> "file");
_file_tag = _file;
_cat = "";
{
if (isClass(_x)) then {
_file = _file_tag;
_file_raw = getText(_x >> "file");
if (_file_raw == "") then {
_cat = configName _x;
_file = _file + "\" + _cat;
_file = format["%1\%2", _file, configName _x];
} else {
_file = _file_raw;
};
{
_var_name = _tag + "_" + configName _x;
_fnc_path = _file + "\" + _var_name + ".sqf";
_config_name = configName _x;
//version 2 More like BI standard fnc / fn_
_var_name = format["%1_fnc_%2", _tag, _config_name];
_fnc_path = format["%1\fn_%2.sqf", _file, _config_name];
if (_version == 1) then {
//version 1 TAG + _ + configName
_var_name = format["%1_%2", _tag, _config_name];
_fnc_path = format["%1\%2.sqf", _file, _var_name];
};
_file_raw = getText(_x >> "file");
if (_file_raw != "") then {
_fnc_path = _file_raw;
};
_itemCompile = compileFinal preprocessFileLineNumbers _fnc_path;
missionNamespace setvariable [_var_name,_itemCompile];
} forEach ("isclass _x" configClasses (_x));
missionNamespace setvariable [_var_name,compileFinal preprocessFileLineNumbers _fnc_path];
if (getNumber(_x >> "preInit") == 1) then {
call (missionNamespace getvariable _var_name);
};
} forEach (configProperties [_x, "isClass _x", true]);
}
} forEach ("isclass _x" configClasses (_x));
} forEach (configProperties [_x, "isClass _x", true]);
};
} forEach ("isclass _x" configClasses (_config));
} else {
diag_log format["Epoch: Error Compiler format for %1 is out of date.",_configName];
} forEach (configProperties [_config, "isClass _x", true]);
};

View File

@ -33,7 +33,6 @@ if ((_handle isEqualTo 666) || (_animSpeed isEqualTo 666) || (_effect isEqualTo
// fix any strings to bool
if (_fixBool) then {
_effect = _effect call EPOCH_fnc_arrayStringToBool;
diag_log str(_handle, _animSpeed, _effect]);
};
_handle ppEffectEnable true;

View File

@ -12,11 +12,30 @@
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/init/fn_init.sqf
*/
if !(isNil "Epoch_CStart") exitWith { false };
Epoch_CStart = true;
if (!isDedicated && hasInterface) then {
if !(isNil "Epoch_Survival_Started") exitWith { false };
Epoch_Survival_Started = true;
_selectedFunction = "CfgClientFunctions";
if (isDedicated) then {
// dedicated server
_selectedFunction = "CfgServerFunctions";
call compile preprocessFileLineNumbers "epoch_code\init\both_init.sqf";
// Epoch Client Only function compiler
"CfgClientFunctions" call EPOCH_fnc_compiler;
} else {
if (hasInterface) then {
// all players
call compile preprocessFileLineNumbers "epoch_code\init\both_init.sqf";
if (isServer) then {
// listen server host
_selectedFunction = "CfgEpochListenServerFunctions";
} else {
// all players
_selectedFunction = "CfgClientFunctions";
};
} else {
// Headless Clients
_selectedFunction = "CfgEpochClientHCFunctions";
};
};
diag_log format["Loading Functions: %1",_selectedFunction];
_selectedFunction call EPOCH_fnc_compiler;
true

View File

@ -12,7 +12,28 @@
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/init/fn_postinit.sqf
*/
if (!isDedicated && isMultiplayer && hasInterface) then {
if (isDedicated) then {
// dedicated server
call compile preprocessFileLineNumbers "\epoch_server\init\server_init.sqf";
} else {
if (hasInterface) then {
if (isMultiplayer) then {
// start multiplayer game
call compile preprocessFileLineNumbers "epoch_code\init\client_init.sqf";
};
if (isServer) then {
// listen server host
} else {
// all players
};
} else {
// Headless Clients
};
};
true

View File

@ -1 +1 @@
build=597;
build=602;

View File

@ -1 +1 @@
build=597;
build=602;

View File

@ -13,25 +13,6 @@ class CfgPatches {
#include "build.hpp"
};
};
class cfgFunctions
{
class A3E
{
tag = "EPOCH";
class Epoch_Server
{
file = "\epoch_server\init";
class init
{
preInit = 1;
};
class postinit
{
postInit = 1;
};
};
};
};
class CfgServerFunctions
{
version = 1;

View File

@ -1,19 +0,0 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors:
Description:
Starts epoch function compiler Server side
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/init/fn_init.sqf
*/
if !(isNil "Epoch_SStart1") exitWith { false };
Epoch_SStart1 = true;
diag_log "Epoch: Init Server Compiler";
"CfgServerFunctions" call EPOCH_fnc_compiler;
true

View File

@ -1,23 +0,0 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors:
Description:
Initalizes variables and starts functions
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/init/fn_postinit.sqf
*/
if (isNil "Epoch_SStart") then {
Epoch_SStart = true;
[] spawn {
call compile preprocessFileLineNumbers "epoch_code\init\both_init.sqf";
call compile preprocessFileLineNumbers "\epoch_server\init\server_init.sqf";
};
};
true

Binary file not shown.

View File

@ -1 +1 @@
build=597;
build=602;

View File

@ -1 +1 @@
build=597;
build=602;

View File

@ -1 +1 @@
597
602