moved persistent color configs server side.

This commit is contained in:
vbawol 2016-06-13 12:05:10 -05:00
parent b1efe1429a
commit 10f97fc448
5 changed files with 17 additions and 14 deletions

View File

@ -12,7 +12,7 @@
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf
*/
private ["_availableColorsConfig","_location","_class","_dmg","_actualHitpoints","_hitpoints","_textures","_color","_colors","_textureSelectionIndex","_selections","_count","_objTypes","_objQty","_wMags","_wMagsArray","_attachments","_magazineSizeMax","_magazineName","_magazineSize","_qty","_objType","_marker","_found","_vehicle","_allHitpoints","_cfgBaseBuilding","_worldspace","_damage","_arr","_arrNum","_vehicleSlotIndex","_vehHiveKey","_response","_immuneVehicleSpawnTime","_diag","_dataFormat","_dataFormatCount","_allVehicles","_serverSettingsConfig","_simulationHandler","_immuneVehicleSpawn"];
private ["_availableColorsConfig","_location","_class","_dmg","_actualHitpoints","_hitpoints","_textures","_color","_colors","_textureSelectionIndex","_selections","_count","_objTypes","_objQty","_wMags","_wMagsArray","_attachments","_magazineSizeMax","_magazineName","_magazineSize","_qty","_objType","_marker","_found","_vehicle","_allHitpoints","_cfgEpochVehicles","_worldspace","_damage","_arr","_arrNum","_vehicleSlotIndex","_vehHiveKey","_response","_immuneVehicleSpawnTime","_diag","_dataFormat","_dataFormatCount","_allVehicles","_serverSettingsConfig","_simulationHandler","_immuneVehicleSpawn"];
params [["_maxVehicleLimit",0]];
_diag = diag_tickTime;
@ -94,12 +94,12 @@ for "_i" from 1 to _maxVehicleLimit do {
_vehicle setFuel (_arr select 4);
_cfgBaseBuilding = 'CfgBaseBuilding' call EPOCH_returnConfig;
_availableColorsConfig = (_cfgBaseBuilding >> _class >> "availableColors");
_cfgEpochVehicles = 'CfgEpochVehicles' call EPOCH_returnConfig;
_availableColorsConfig = (_cfgEpochVehicles >> _class >> "availableColors");
if (isArray(_availableColorsConfig)) then {
_color = _arr select 7;
_colors = getArray(_availableColorsConfig);
_textureSelectionIndex = (_cfgBaseBuilding >> _class >> "textureSelectionIndex");
_textureSelectionIndex = (_cfgEpochVehicles >> _class >> "textureSelectionIndex");
_selections = if (isArray(_textureSelectionIndex)) then { getArray(_textureSelectionIndex) } else { [0] };
_count = (count _colors) - 1;
{

View File

@ -12,7 +12,7 @@
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf
*/
private ["_maxDamage","_textures","_textureSelectionIndex","_selections","_colors","_color","_count","_vehLockHiveKey","_marker","_cfgBaseBuilding","_vehObj"];
private ["_maxDamage","_textures","_textureSelectionIndex","_selections","_colors","_color","_count","_vehLockHiveKey","_marker","_cfgEpochVehicles","_vehObj"];
params ["_vehClass","_position","_direction","_locked","_slot",["_lockOwner",""],["_can_collide","CAN_COLLIDE"],["_spawnLoot",false],["_spawnDamaged",true]];
if !(isClass (configFile >> "CfgVehicles" >> _vehClass)) exitWith {objNull};
_vehObj = createVehicle[_vehClass, _position, [], 0, _can_collide];
@ -50,11 +50,11 @@ if !(isNull _vehObj) then{
};
// get colors from config
_cfgBaseBuilding = 'CfgBaseBuilding' call EPOCH_returnConfig;
_availableColorsConfig = (_cfgBaseBuilding >> _vehClass >> "availableColors");
_cfgEpochVehicles = 'CfgEpochVehicles' call EPOCH_returnConfig;
_availableColorsConfig = (_cfgEpochVehicles >> _vehClass >> "availableColors");
if (isArray(_availableColorsConfig)) then{
_textureSelectionIndex = (_cfgBaseBuilding >> _vehClass >> "textureSelectionIndex");
_textureSelectionIndex = (_cfgEpochVehicles >> _vehClass >> "textureSelectionIndex");
_selections = if (isArray(_textureSelectionIndex)) then{ getArray(_textureSelectionIndex) } else { [0] };
_colors = getArray(_availableColorsConfig);
_textures = _colors select 0;

View File

@ -1164,11 +1164,11 @@ call compile ("'"+_skn_doAdminRequest+"' addPublicVariableEventHandler {
_vehLockHiveKey = format['%1:%2', (call EPOCH_fn_InstanceID), _slot];
['VehicleLock', _vehLockHiveKey, EPOCH_vehicleLockTime, [_lockOwner]] call EPOCH_fnc_server_hiveSETEX;
_cfgBaseBuilding = 'CfgBaseBuilding' call EPOCH_returnConfig;
_availableColorsConfig = (_cfgBaseBuilding >> _item >> 'availableColors');
_cfgEpochVehicles = 'CfgEpochVehicles' call EPOCH_returnConfig;
_availableColorsConfig = (_cfgEpochVehicles >> _item >> 'availableColors');
if (isArray(_availableColorsConfig)) then {
_textureSelectionIndex = (_cfgBaseBuilding >> _item >> 'textureSelectionIndex');
_textureSelectionIndex = (_cfgEpochVehicles >> _item >> 'textureSelectionIndex');
_selections = if (isArray(_textureSelectionIndex)) then {getArray(_textureSelectionIndex)} else {[0]};
_colors = getArray(_availableColorsConfig);
_textures = _colors select 0;

View File

@ -30,6 +30,8 @@ class CfgPatches {
#include "configs\CfgMainTable.h"
#include "configs\CfgLootTable.h"
#include "configs\CfgLootTable_CUP.h"
// vehicle textures
#include "configs\CfgEpochVehicles.h"
// security checks
#include "configs\security\security_checks.h"
// props template

View File

@ -1,17 +1,18 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors:
Description:
Main Client side configs for the Epoch gamemode
Epoch Server side config to persist vehicle colors, these are also used to randomly colorize new spawns.
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_config/Configs/CfgEpochVehicles.hpp
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server_settngs/configs/CfgEpochVehicles.h
*/
class CfgPersistentVehicles
class CfgEpochVehicles
{
class C_Hatchback_01_EPOCH {
textureSelectionIndex[] = {0};