Skip to content

Commit

Permalink
Merge pull request #398 from EpochModTeam/experimental
Browse files Browse the repository at this point in the history
fixes and less debug
  • Loading branch information
vbawol committed Oct 14, 2015
2 parents b0b3361 + 396f58e commit 3d7447a
Show file tree
Hide file tree
Showing 14 changed files with 218 additions and 188 deletions.
Binary file modified Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo
Binary file not shown.
2 changes: 1 addition & 1 deletion Server_Install_Pack/sc/battleye/createvehicle.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
5 "" !="I_UAV_01_F" !="(I|B|O)_UAV_AI" !"_EPOCH" !="B_65x39_Minigun_Caseless_Red_splash" !="B_762x51_Minigun_Tracer_Yellow_splash" !="B_(Swing|Stick)" !"^SmokeShell" !"^G_40mm_" !"^F_40mm_" !"Sub_F_" !"^F_Signal_" !="mini_Grenade" !="GrenadeHand" !="LaserTarget(C|W|E)" !"^Chemlight_" !="(ClaymoreDirectionalMine|DemoCharge|SatchelCharge)_Remote_Ammo" !="SLAMDirectionalMine_Wire_Ammo" !="(CMflare_Chaff|Sapper_Charge|SapperB_Charge|ATMine_Range)_Ammo" !="APERS(TripMine_Wire|BoundingMine_Range|Mine_Range)_Ammo" !="Epoch_(Sapper|SapperB|Cloak)_F" !="GreatWhite_F" !="groundWeaponHolder" !="WeaponHolderSimulated" !="Epoch_(Male|Female)_F" !"Supply[0-9]" !"Steerable_Parachute_F" !="Epoch_Female_CamoRed_F" !="Land_Cages_F" !="(O|I|B)_UAV_01_backpack_F" !="I_(helipilot|helicrew)_F"
5 "" !="I_UAV_01_F" !="(I|B|O)_UAV_AI" !"_EPOCH" !="B_65x39_Minigun_Caseless_Red_splash" !="B_762x51_Minigun_Tracer_Yellow_splash" !="B_(Swing|Stick)" !"^SmokeShell" !"^G_40mm_" !"^F_40mm_" !"Sub_F_" !"^F_Signal_" !="mini_Grenade" !="GrenadeHand" !="LaserTarget(C|W|E)" !"^Chemlight_" !="(ClaymoreDirectionalMine|DemoCharge|SatchelCharge)_Remote_Ammo" !="SLAMDirectionalMine_Wire_Ammo" !="(CMflare_Chaff|Sapper_Charge|SapperB_Charge|ATMine_Range)_Ammo" !="APERS(TripMine_Wire|BoundingMine_Range|Mine_Range)_Ammo" !="Epoch_(Sapper|SapperB|Cloak)_F" !="GreatWhite_F" !="groundWeaponHolder" !="WeaponHolderSimulated" !="Epoch_(Male|Female)_F" !"Supply[0-9]" !"Steerable_Parachute_F" !="Epoch_Female_CamoRed_F" !="Land_Cages_F" !="(O|I|B)_UAV_01_backpack_F" !="I_(helipilot|helicrew)_F" !="#smokesource"
5 "_EPOCH" !="(SapperHead|Jack|SolarGen)_SIM_EPOCH" !="Wood(Floor|LargeWall|Stairs|Ramp|Foundation|Ladder|Tower)_EPOCH" !="(Tipi|Workbench|StorageShelf|CinderWallHalf|Foundation|Wood(Floor|LargeWall|Stairs|Ramp|Foundation|Ladder|Tower))_Ghost_EPOCH" !="(Tipi|StorageShelf|Safe|LockBox|FirePlace|FirePlaceOn|PlotPole|SolarGen|Jack|Freezer|Tarp|CinderWallHalf|Bobber)_EPOCH" !="I_(Soldier[1-3]|Soldier)_EPOCH" !="(Bed|locker|Filing|Chair|ChairRed|wardrobe|cooker|Couch|Table|Pelican|Fridge|Shelf|ToolRack|Shoebox|Bunk|Rabbit|Cabinet)_EPOCH" !="(Sheep|Goat|Snake|Snake2|Hen|Cock|Fin|Alsatian)_random_EPOCH" !="(Safe|Workbench|LockBox|CinderWall|CinderWallGarage|CinderWallHalf|PlotPole|Tipi|StorageShelf|Fireplace)_SIM_EPOCH" !="Wood(Floor|LargeWall|LargeWallCor|LargeWallDoor|LargeWallDoorL|LargeWallDoorway|Stairs|Stairs2|Ramp|Ladder|Tower)_SIM_EPOCH" !="(WoodFoundation|Foundation)_EPOCH" !="WoodWall[1-4](_SIM|_Ghost|)_EPOCH"
5 SeaGull
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if (isText _config) then {

if (!isNull _newVehicle) then {

diag_log format["building lockbox !isnull %1", _newVehicle];
//diag_log format["building lockbox !isnull %1", _newVehicle];

if !(EPOCH_StorageSlots isEqualTo []) then {

Expand Down
18 changes: 10 additions & 8 deletions Sources/epoch_server/compile/epoch_server/EPOCH_localCleanup.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ if (typename _this != "ARRAY") then {
if (_this select 1) then {
private "_unit";
_unit = _this select 0;
{
_unit removeAllMPEventHandlers _x;
}forEach ["mpkilled","mphit","mprespawn"];
{
_unit removeAllEventHandlers _x;
}forEach ["FiredNear","HandleDamage","Killed","Fired","GetOut","GetIn","Local"];
deleteVehicle _unit;
deleteGroup (group _unit);
if (!isNull _unit) then{
{
_unit removeAllMPEventHandlers _x;
}forEach["mpkilled", "mphit", "mprespawn"];
{
_unit removeAllEventHandlers _x;
}forEach["FiredNear", "HandleDamage", "Killed", "Fired", "GetOut", "GetIn", "Local"];
deleteVehicle _unit;
deleteGroup(group _unit);
};
};
}];
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ for "_i" from 0 to _this do {
// count vehicles
{
_limit = ["CfgTraderLimits", _x, 100] call EPOCH_fnc_returnConfigEntryV2;
_currentStock = (_arr select 1) param[_forEachIndex, 0];
if (_limit == 0) then {
// mark for removal since limit is 0
_toBeRemoved pushBack _forEachIndex;
_currentStock = 0;
} else {
// lower to limit current qty is over limit
_currentStock = (_arr select 1) select _forEachIndex;
if (_currentStock > _limit) then {
(_arr select 1) set [_forEachIndex,_limit];
_currentStock = _limit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ _vehicleBought = false;

_returnIn = [];
_returnOut = [];
_final_location = [];

if (isNull _trader) exitWith{};
if !([_plyr,_this select 4] call EPOCH_server_getPToken) exitWith {};
Expand All @@ -34,7 +35,7 @@ if (_slot != -1) then {
_current_crypto = _vars select _cIndex;
_current_cryptoRaw = _current_crypto;

// diag_log format["_current_crypto: %1 _cIndex:%2", _current_crypto, _cIndex];
//diag_log format["_current_crypto: %1 _cIndex:%2 %3", _current_crypto, _cIndex, _this];

// SELL ITEMS TO TRADER
_aiItems = _trader getVariable["AI_ITEMS", [[], []]];
Expand Down Expand Up @@ -113,22 +114,22 @@ if (_slot != -1) then {
_item = _x;
_itemQty = 1;

// diag_log format["_item: %1", _item];
//diag_log format["_item: %1", _item];
if (isClass (_config >> _item)) then{
_itemWorth = getNumber(_config >> _item >> "price");
_itemTax = getNumber(_config >> _item >> "tax");
_tax = _itemWorth * (EPOCH_taxRate + _itemTax);
_itemWorth = ceil(_itemWorth + _tax);

// diag_log format["_itemWorth: %1", _itemWorth];
//diag_log format["_itemWorth: %1", _itemWorth];

_qtyIndex = _itemClasses find _item;
// add items to array
if (_qtyIndex != -1) then {

_currQty = _itemQtys select _qtyIndex;

// diag_log format["_currQty: %1 >= %2", _currQty, _itemQty];
//diag_log format["_currQty: %1 >= %2", _currQty, _itemQty];

if (_currQty >= _itemQty) then {

Expand All @@ -142,14 +143,30 @@ if (_slot != -1) then {
_position = getPosATL _plyr;

_helipad = nearestObjects[_position, ["Land_HelipadEmpty_F", "Land_HelipadCircle_F"], 100];
_helipads = [];
_smoke = nearestObject[_position, "SmokeShell"];
if (!isNull _smoke) then {
_helipad pushBack _smoke;
};

// water check
if (_item isKindOf "Ship") then {
{
if (surfaceIsWater (getposATL _x)) then {
_helipads pushBack _x;
}
} forEach _helipad;
} else {
{
if !(surfaceIsWater (getposATL _x)) then {
_helipads pushBack _x;
}
} forEach _helipad;
};

// diag_log format["DEBUG: helipad: %1", _helipad];

if !(_helipad isEqualTo[]) then {
if !(_helipads isEqualTo[]) then {

_foundSmoke = false;
{
Expand All @@ -168,9 +185,9 @@ if (_slot != -1) then {
};
};
if (_foundSmoke) exitWith {};
} forEach _helipad;
} forEach _helipads;
if !(_foundSmoke) then {
_position = getPosATL (_helipad select 0);
_position = getPosATL (_helipads select 0);
};
} else {
_tmpposition = [];
Expand All @@ -181,6 +198,10 @@ if (_slot != -1) then {
_tmpposition = [_position, 20, 120, 20, 0, 2000, 0] call BIS_fnc_findSafePos;
};
if ((count _tmpposition) == 2) then {
_tmpposition set [2, 0];
if (surfaceIsWater _tmpposition) then {
_tmpposition = ATLtoASL _tmpposition;
};
_position = _tmpposition;
};
};
Expand All @@ -204,14 +225,20 @@ if (_slot != -1) then {
};

_vehObj = [_item,_position,random 360,true,_vehslot,_lockOwner,"NONE",false] call EPOCH_fnc_spawn_vehicle;

_final_location = getPosATL _vehObj;

_group = group _plyr;
_wp = _group addWaypoint [_final_location, 0];
deleteWaypoint [_group, 0];

_returnOut pushBack _item;

_itemQtys set[_qtyIndex, (_currQty - _itemQty)];
_tradeTotal = _tradeTotal - _itemWorth;
_current_crypto = _current_crypto - _itemWorth;
_tradeQtyTotal = _tradeQtyTotal + _itemQty;
} else {
diag_log "DEBUG: no slots found to spawn vehicle";
};
};
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ for "_i" from 1 to _this do {

_worldspace = _arr select 1;
_wsCount = count _worldspace;
diag_log format ["DEBUG: _wsCount %1 _worldspace %2", _wsCount, _worldspace];
//diag_log format ["DEBUG: _wsCount %1 _worldspace %2", _wsCount, _worldspace];

// new worldspace format
if (_wsCount == 3) then {
Expand Down Expand Up @@ -94,7 +94,7 @@ for "_i" from 1 to _this do {

// missionNamespace setVariable [format ["EPOCH_STORAGE_%1", _i], _vehicle];

diag_log format ["STORAGE: created storage %1 at %2", _class, _location];
// diag_log format ["STORAGE: created storage %1 at %2", _class, _location];

_vehicle call EPOCH_server_storageInit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ if (_immuneVehicleSpawn) then{

addToRemainsCollector _allVehicles;

diag_log format ["VEH SPAWN TIMER %1", diag_tickTime - _diag];
// diag_log (EPOCH_VehicleSlots);
diag_log format ["VEH SPAWN TIMER %1, LOADED 2% VEHICLES", diag_tickTime - _diag, count _allVehicles];

true
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ if (!isNull _this) then {
["Storage", _vehHiveKey, EPOCH_expiresBuilding, _VAL] call EPOCH_fnc_server_hiveSETEX;
//["Storage", _vehHiveKey, _VAL] call EPOCH_fnc_server_hiveSET;

diag_log format["STORAGE: saved to hive %1 Pos %2 Owners %3 Parent %4 Locked %5", _class, _worldspace, _storageOwners, _storageParent, _locked];
diag_log format["STORAGE: saved to hive %1 Pos %2 Owners %3 Locked %4", _class, _worldspace, _storageOwners, _locked];
};

};
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (getNumber(configFile >> "CfgVehicles" >> _type >> "isSecureStorage") == 1) t
if (_type isKindOf "Secure_Storage_Proxy") then {

_owners = _unit getVariable["STORAGE_OWNERS", []];
diag_log format["_owners2 %1", _owners];
//diag_log format["_owners2 %1", _owners];

// allow group members and owner access
if (_plyrGroup != "") then {
Expand Down Expand Up @@ -68,11 +68,11 @@ if (getNumber(configFile >> "CfgVehicles" >> _type >> "isSecureStorage") == 1) t
} else {

_weaponHolder = _unit getVariable["EPOCH_secStorParent", objNull];
diag_log format["DEBUG: SecStor _weaponHolder %1", _weaponHolder];
//diag_log format["DEBUG: SecStor _weaponHolder %1", _weaponHolder];

if (!isNull _weaponHolder) then {
_owners = _weaponHolder getVariable["STORAGE_OWNERS", []];
diag_log format["_owners %1", _owners];
//diag_log format["_owners %1", _owners];

// allow group members and owner access
if (_plyrGroup != "") then {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ _class = typeOf _unit;
if (_class isKindOf 'Constructions_lockedstatic_F') then{

_weaponHolder = _unit getVariable["EPOCH_secStorParent", objNull];
diag_log format["DEBUG: Pack _weaponHolder %1", _weaponHolder];
//diag_log format["DEBUG: Pack _weaponHolder %1", _weaponHolder];

if (!isNull _weaponHolder) then {
_owners = _weaponHolder getVariable["STORAGE_OWNERS", []];
Expand Down

0 comments on commit 3d7447a

Please sign in to comment.