mirror of
https://github.com/Bjanski/ExAd.git
synced 2024-08-30 16:52:14 +00:00
Core release candidate
Core release candidate finished.
This commit is contained in:
parent
c08f744167
commit
1b9e6e93f4
1
@ExileServer/addons/exad_core/$PREFIX$
Normal file
1
@ExileServer/addons/exad_core/$PREFIX$
Normal file
@ -0,0 +1 @@
|
||||
exad_core
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
fn_clientDispatch.sqf
|
||||
|
||||
Copyright 2016 Jan Babor
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
private ["_params","_recipents"];
|
||||
|
||||
_params = [_this,0,nil] call BIS_fnc_param;
|
||||
_recipents = [_this,1,-2,[0]] call BIS_fnc_param;
|
||||
_jip = [_this,2,false] call BIS_fnc_param;
|
||||
|
||||
if(isNil "_params")exitWith{false};
|
||||
|
||||
_resString = _params remoteExec ["ExAd_fnc_incomingRequest",_recipents,_jip];
|
||||
|
||||
_resString
|
@ -0,0 +1 @@
|
||||
/**
* fn_incomingRequest.sqf
* Modified by Jan Babor 2016
*
* Originally
* ExileClient_system_network_dispatchIncomingMessage
*
* Exile Mod
* www.exilemod.com
* © 2015 Exile Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*/
private["_payload","_messageName","_messageParameters","_allowedParameters","_message","_exception"];
_payload = _this;
try
{
if (isNil "_payload") then
{
throw "Message payload is not defined!";
};
if (typeName _payload != "ARRAY") then
{
throw "Message payload is not a array!";
};
if (count _payload != 2) then
{
throw format ["Wrong envelope field count! Payload: %1", _payload];
};
_messageName = _payload select 0;
_messageParameters = _payload select 1;
if !(isClass (configFile >> "CfgNetworkMessages" >> _messageName)) then
{
throw format ["Forbidden message name! Payload: %1", _payload];
};
_allowedParameters = getArray(configFile >> "CfgNetworkMessages" >> _messageName >> "parameters");
if (count _messageParameters != count _allowedParameters) then
{
throw format ["Parameter count mismatch! Payload: %1", _payload];
};
{
if (_x != typeName (_messageParameters select _forEachIndex)) then
{
throw format ["Parameter type mismatch! Payload: %1", _payload];
};
}
forEach _allowedParameters;
diag_log format["Dispatching message '%1'...", _messageName];
call compile format["_messageParameters call ExAdServer_fnc_%1;",_messageName];
}
catch
{
["clientRequest", _exception, true] call ExAd_fnc_debugHandler;
};
true
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
fn_createArray.sqf
|
||||
|
||||
Copyright 2016 Jan Babor
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
private ["_array"];
|
||||
|
||||
_array = [];
|
||||
{
|
||||
for "_i" from 1 to (_x select 0) do {
|
||||
_array pushBack (_x select 1)
|
||||
}
|
||||
}forEach _this;
|
||||
|
||||
_array
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
fn_createCrate.sqf
|
||||
|
||||
Copyright 2016 Jan Babor
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
private["_pos","_list","_crateType","_crate"];
|
||||
|
||||
_pos = [_this,0,[0,0,0]] call BIS_fnc_param;
|
||||
_list = [_this,1,[]] call BIS_fnc_param;
|
||||
_crateType = [_this,2,"Box_IND_AmmoVeh_F"] call BIS_fnc_param;
|
||||
|
||||
_crate = _crateType createVehicle _pos;
|
||||
clearBackpackCargoGlobal _crate;
|
||||
clearItemCargoGlobal _crate;
|
||||
clearMagazineCargoGlobal _crate;
|
||||
clearWeaponCargoGlobal _crate;
|
||||
|
||||
{
|
||||
_crate addItemCargoGlobal [_x select 0,_x select 1]
|
||||
}forEach _list;
|
||||
|
||||
_crate
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
fn_createMarker.sqf
|
||||
|
||||
Copyright 2016 Jan Babor
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
private["_markerPos","_markerColor","_markerSize","_markerName","_markerText","_markerDot","_markers","_marker","_dot"];
|
||||
|
||||
_markerPos = [_this,0,[0,0,0]] call BIS_fnc_param;
|
||||
_markerColor = [_this,1,"Default"] call BIS_fnc_param;
|
||||
_markerSize = [_this,2,50] call BIS_fnc_param;
|
||||
_markerName = [_this,3,("ExAdMarker" + str diag_tickTime)] call BIS_fnc_param;
|
||||
_markerText = [_this,4,""] call BIS_fnc_param;
|
||||
_markerDot = [_this,5,false] call BIS_fnc_param;
|
||||
|
||||
_markers = [];
|
||||
|
||||
_marker = createMarker [_markerName,_markerPos];
|
||||
_marker setMarkerColor _markerColor;
|
||||
_marker setMarkerShape "ELLIPSE";
|
||||
_marker setMarkerBrush "Solid";
|
||||
_marker setMarkerSize [_markerSize,_markerSize];
|
||||
_marker setMarkerText (_markerText);
|
||||
_markers pushBack _marker;
|
||||
if(_markerDot)then{
|
||||
_dot = createMarker [format["%1dot",_markerName], _markerPos];
|
||||
_dot setMarkerColor "ColorBlack";
|
||||
_dot setMarkerType "mil_dot";
|
||||
_dot setMarkerText _markerText;
|
||||
_markers pushBack _dot;
|
||||
};
|
||||
|
||||
_markers
|
@ -0,0 +1,59 @@
|
||||
/*
|
||||
fn_putInContainer.sqf
|
||||
|
||||
Copyright 2016 Jan Babor
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
private["_lootHolder","_itemClassName","_cargoType","_magazineClassNames","_magazineClassName","_numberOfMagazines"];
|
||||
|
||||
_lootHolder = _this select 0;
|
||||
_itemClassName = _this select 1;
|
||||
|
||||
_cargoType = _itemClassName call ExileClient_util_cargo_getType;
|
||||
|
||||
switch (_cargoType) do {
|
||||
case 1:
|
||||
{
|
||||
if (_itemClassName isEqualTo "Exile_Item_MountainDupe") then
|
||||
{
|
||||
_lootHolder addMagazineCargoGlobal [_itemClassName, 2];
|
||||
}
|
||||
else
|
||||
{
|
||||
_lootHolder addMagazineCargoGlobal [_itemClassName, 1];
|
||||
};
|
||||
};
|
||||
case 3:
|
||||
{
|
||||
_lootHolder addBackpackCargoGlobal [_itemClassName, 1];
|
||||
};
|
||||
case 2:
|
||||
{
|
||||
_lootHolder addWeaponCargoGlobal [_itemClassName, 1];
|
||||
if (_itemClassName != "Exile_Melee_Axe") then
|
||||
{
|
||||
_magazineClassNames = getArray(configFile >> "CfgWeapons" >> _itemClassName >> "magazines");
|
||||
if (count(_magazineClassNames) > 0) then
|
||||
{
|
||||
_magazineClassName = _magazineClassNames select (floor(random (count _magazineClassNames)));
|
||||
_numberOfMagazines = 1 + floor(random 3);
|
||||
_lootHolder addMagazineCargoGlobal [_magazineClassName, _numberOfMagazines];
|
||||
};
|
||||
};
|
||||
};
|
||||
default { _lootHolder addItemCargoGlobal [_itemClassName,1]; };
|
||||
};
|
||||
|
||||
true
|
1
@ExileServer/addons/exad_core/PboPrefix.txt
Normal file
1
@ExileServer/addons/exad_core/PboPrefix.txt
Normal file
@ -0,0 +1 @@
|
||||
exad_core
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
config.cpp
|
||||
|
||||
Copyright 2016 Jan Babor
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
class CfgPatches {
|
||||
class ExAd_Core {
|
||||
requiredVersion = 0.1;
|
||||
requiredAddons[] = {"exile_server"};
|
||||
};
|
||||
};
|
||||
|
||||
class CfgFunctions {
|
||||
class ExAdServer {
|
||||
class System {
|
||||
file = "exad_core\Functions\System";
|
||||
class clientDispatch {};
|
||||
class clientRequest {};
|
||||
};
|
||||
class Utils {
|
||||
file = "exad_core\Functions\Utils";
|
||||
class createArray {};
|
||||
class createCrate {};
|
||||
class createMarker {};
|
||||
class putInContainer {};
|
||||
};
|
||||
};
|
||||
};
|
@ -15,8 +15,8 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
params ["_fnc","_exception"];
|
||||
params ["_fnc","_exception",["_server", false]];
|
||||
|
||||
if(ExAd_Debug)then{
|
||||
diag_log format["ExAd Debugger: Error in %1 - '%2'",_fnc, _exception]
|
||||
diag_log format["ExAd%3 Debugger: Error in %1 - '%2'",_fnc, _exception, (if(_server)then{"Server"}else{""})]
|
||||
}
|
Loading…
Reference in New Issue
Block a user