Jump to content

[UPGRADED DEC2017][scarCODE] Virtual Garage System by IT07


IT07

Recommended Posts

  • 4 weeks later...

Running Epoch on Centos 7, 1.66 0.4.0, does not work properly, problem somewhere in mission part, cant figure it out, as soon as i change something where it should start to work logikaly, it crashes server, with 100% cpu use...

I think i got the problem reason, part with  global.hpp was missing in download

Link to comment
Share on other sites

  • 1 month later...

I'm getting this error after restarting the server and trying to access the garage

 1:54:05 Error in expression <hen
{
if not isNull _dsp then
{
_vehs = EPOCH_vgsMyGarage;
if not isNil"_vehs" t>
 1:54:05   Error position: <EPOCH_vgsMyGarage;
if not isNil"_vehs" t>
 1:54:05   Error Undefined variable in expression: epoch_vgsmygarage
 1:54:05 File scarCODE\VGS\functions_VGS\fn_vgsTrash.sqf [SC_fnc_vgsTrash], line 20

Then the drop down in the dialog for vehicles in the garage is disabled.

Anyone else bumped into this and managed to fix it?

Thanks in advance.

 

EDIT: Prior to restarting the server, it was working ok. vehicles in, vehicles out. etc

Link to comment
Share on other sites

  • 2 weeks later...
On 8.5.2017 at 3:50 PM, ReDBaroN said:

Just to add to my question above, this only happens the first time you log in after a restart. If you relog, then it works ok.

Any ideas anyone?

 

You fixed it? Is VG working without other issues for you?

Link to comment
Share on other sites

  • 5 months later...

this script looks amazing, now i know there hasnt been any activity on this post since January, However I was wondering if it is still current and if so i noticed a server side and client side, so do my users have to install the client side for this to work for them or do i only have to install the server side?

Link to comment
Share on other sites

  • 4 weeks later...

Here is a start to some work on this system for you guys.

[FIXED]Global.hpp missing and caused hosts issues getting it up and running
[ADDED] Ships are now searched for and listed for storage in the garage
[FIXED] System searched for "Air", but listed only "Helicopters" (now planes and VTOL will show up).

Link to pull merge request:
https://github.com/IT07/Game_code/pull/3

Link to my forked branch:
https://github.com/ravmustang/Game_code/tree/updates/ArmA_3/A3_EPOCH_virtualGarage

Link to comment
Share on other sites

A little update here, a little tweak here and before I knew it I was reworking the entire script.
Here is a breakdown of whats changed and available on a branch and pull merge request.
 
Server Side
[REMOVED] PublicVariable Event Handler
[REMOVED] Spawn loop for generating keys for each 
[ADDED] 3 new functions to handle the removed PVEH(ReadFrom/WriteTo/TrashFrom)
[ADDED] 2 new functions to spit out client vgs key and client garage on join
[ADDED] Debug config option to log every use/request

Client Side
[FIXED] Global.hpp missing and caused hosts issues getting the script setup and running
[ADDED] Ships are now searched for and listed for storage in the garage
[FIXED] System searched for "Air", but listed only "Helicopters" (now planes and VTOL will show up).
[ADDED] Scroll Wheel config option to disable/enable
[ADDED] Dyna Menu self interaction
[ADDED] Jammer requirement config option along with max distance from jammer entry
[ADDED] Scroll Wheel will follow Jammer Requirements and Max Distance if enabled
[ADDED] Dyna Menu will follow Jammer Requirements and Max Distance if enabled
[ADDED] Debug config option to log each client vgs event
[ADDED] New Function to handle the receipt of data from VGS server
[FIXED] Refreshing of VGS GUI on Move IN and Move OUT was not refreshing both sides properly.

New Configs
// Settings here
debug = 0; // 1 = ON // 0 = OFF
range = 25; // Vehicles within this range of player can be moved into garage
useScrollWheel = 1; // Scroll Wheel VGS Menu
requireJammer = 0; // 1 = ON // 0 = OFF
maxDistanceFromJammer = 300; // meters, only applies if requireJammer = 1

With new readme
Branch here: https://github.com/ravmustang/Game_code/tree/VGS-Overhaul/ArmA_3/A3_EPOCH_virtualGarage

Merge Request here: https://github.com/IT07/Game_code/pull/4

Link to comment
Share on other sites

Again thx for working on it @DirtySanchez but still same issues as in older versions. Sometimes when eople try to restore the vehicles it stucks at loading vehicle message. When they close window and open up same problem. After reconnecting the vehicle is entirely gone... absolutely not your fault just wanted to let the people know that this still is not fixed

Link to comment
Share on other sites

This is the main purpose of my thorough rework.

Please look in your rpts for the epoch vgs error messages.

In this case you will want to enable debug on client and server for more info with those error messages.

 

Throughout my rework and testing there were no issues with pulling vehicles out and returning them in.

You can throw me them rpts in discord after the above changes to debug settings. THX

Link to comment
Share on other sites

@Drokz @natoed
Here is some more work I have just finished and sync'd to the Pull Merge Request #4 VGS Overhaul.
Still am not saying I have fixed your guys issue on MOVE OUT and stuck at "Requesting data from server..."
However there is some really good updates in this batch. 
ENJOY!

[FIXED] Upon MOVE IN, vehicle object was setDamage 1, which could at time blow up the vehicle
[ADDED] Debug config check for remove keys diag_log lines
[FIXED] Hitpoints were not saving / loading properly
[ADDED] usage of params to ReadFromGarage function for MOVE OUT
[ADDED] params for original vehicle data _toSpawn
[ADDED] params for original vehicle gear data _gear
[CHANGED] gear default values in WriteToGarage function
[ADDED] Upon MOVE OUT, find safe position for vehicle based on old save location as center
[ADDED] Upon MOVE OUT, check if vehicle is a "SHIP" and find safe position in water

 

Branch here: https://github.com/ravmustang/Game_code/tree/VGS-Overhaul/ArmA_3/A3_EPOCH_virtualGarage

Merge Request here: https://github.com/IT07/Game_code/pull/4

Link to comment
Share on other sites

I cant stop!!!!!

This is a big one gentlemen.
This will change the entire database routine and will mean your players will start fresh garages once you update.
However, I feel the benefits outweigh the cons here. COMP your players, they'll get over it!

[CHANGED] Vehicle save / loading now uses EPOCH_cargoFill and _cargoSave
[CHANGED] Database table is now "VirtualGarage" instead of each UID having its own table
[CHANGED] Client DB entry is now their UID only and is found within the "VirtualGarage" table
[ADDED] Virtual Garage DB entry expiration time

[UPGRADED] Saving vehicles as EPOCH saves current vehicles
[ADDED] Textures save / load
[ADDED] Turret Ammo and Mags save / load
[ADDED] Vehicle Upgrade compatibility save / load baseClass variable
[ADDED] Compatibilty with epoch settings for disableVehicleTIE/removevehweapons/removevehmagazinesturret

[CHANGED] Instead of setDamage 1, use Epoch vehicle killed handler
[UPGRADED] Add UID to vehicle killed log on MOVE IN

@natoed

Link to comment
Share on other sites

  • 2 weeks later...

Hey @Razor1977

Yes I saw how that is happening during my upgrade.
The readme does say that if you have a VG vehicle make sure to put it back into the garage before restart as it will be gone after restart.
This statement he makes means that the vehicle is no longer part of the persistent DB system of Epoch and is now a VGS vehicle only.
That also means its no longer a SLOT vehicle and cannot be sold.

I have some ideas moving forward on upgrading EPOCH vehicle DB saving for all vehicle types including vehicle transport with stored vehicles.
Once the new year is settled out I will be starting work on that and testing should begin on my end shortly thereafter.
Chat soon and have a Happy NEW YEAR!!

Link to comment
Share on other sites

Anyone who is using @DirtySanchez's excellent update to the Virtual Garage who also wants vehicle persistence through a restart added back when a vehicle is removed from a garage can do the following to the server side files.

First add the following line to  a3_epoch_virtualGarage/config.cpp:

	persistentVehicles = 1; // Are vehicles read from the garage made persistent on the server?

Replace a3_epoch_virtualGarage/functions_VGS/fn_vgsReadFromGarage.sqf with this:

Spoiler

/*
	Author: IT07

	Contributor: DirtySanchez from DonkeyPunch.INFO
	
	Description:
	Read from client Garage
	
	Returns:
	remoteExecCall to client garage contents
*/

private["_slots", "_debug", "_playerUID", "_response", "_vehsFriendly", "_vehsRaw", "_toSpawn", "_veh", "_safePOS", "_allHitpoints", "_actualHitpoints", "_dmg", "_response2"];
params [ 
	["_slot", -1, [0]],
	["_playerObj", objNull, [objNull]],
	["_playerKey", "", [""]] 
];
// debug start message
_debug = "debug" call SC_fnc_vgsGetClientSetting;
if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: ReadFromGarage _data = %1", [_slot, _playerObj, _playerKey]]};

if isNull _playerObj exitWith	{diag_log format["[EPOCH VGS]: ReadFromGarage Player isNull - data:%1", _playerObj]};

if !([_playerObj, _playerKey] in (uiNamespace getVariable "EPOCH_vgsKeys"))exitWith{diag_log format["[EPOCH VGS]: ReadFromGarage Bad Player and Key - data:%1", [_playerObj, _playerKey]]};

if (_slot isEqualTo -1) exitWith {diag_log format["[EPOCH VGS]: ReadFromGarage Error - slot number is -1 - data:%1", _slot]};

_persistentVics = "persistentVehicles" call VGS_fnc_vgsGetServerSetting;
_slots = "maxGarageSlots" call VGS_fnc_vgsGetServerSetting;
if !(_slot < _slots) exitWith {diag_log format["[EPOCH VGS]: ReadFromGarage Error - slot not less than max slots - data:%1", [_slot, _slots]]};

_playerUID = getPlayerUID _playerObj;
_response = ["VirtualGarage", _playerUID] call EPOCH_fnc_server_hiveGETRANGE;
if((_response select 1) isEqualTo []) exitWith {diag_log format["[EPOCH VGS]: WriteToGarage Client DB entry error - data:%1m", _response]};
if ((_response select 0) isEqualTo 1) then
{
	if (typeName (_response select 1) isEqualTo "ARRAY") then
	{
		_vehsFriendly = _response select 1 select 0;
		_vehsRaw = _response select 1 select 1;
		_toSpawn = _vehsRaw select _slot;
		_toSpawn params ["_vehClass","_position","_damage","_hitPoints","_fuel","_gear","_ammo","_texture","_baseClass"];		
		_position params [
			["_pos", [ [0,0,0],[0,0,0] ] ],
			["_vectorDir", [0,0,0]],
			["_vectorUp", [0,0,0]]
		];
		if (count _toSpawn > 0) then
		{
			_vehsFriendly set [_slot, []]; // Remove the vehicle from garage slot
			_vehsRaw set [_slot, []];
			_expiresVG = "expiresVirtualGarage" call VGS_fnc_vgsGetServerSetting;
			_return = ["VirtualGarage", _playerUID, _expiresVG, [_vehsFriendly, _vehsRaw]] call EPOCH_fnc_server_hiveSETEX;
			_veh = createVehicle [_vehClass, _pos select 0, [], 0, "CAN_COLLIDE"];
			//if(_veh isKindOf 'SHIP')then{
			//	_safePOS = [_pos select 0,1,80,10,1,20,1] call BIS_fnc_findSafePos;
			//};
			_veh allowDamage false;
			_veh setvectorDirAndUp [_vectorDir,_vectorUp];
			_veh call EPOCH_server_setVToken;
			_veh setFuel _fuel;
			_veh setVehicleLock "LOCKEDPLAYER";
			clearWeaponCargoGlobal _veh;
			clearMagazineCargoGlobal _veh;
			clearItemCargoGlobal _veh;
			clearBackpackCargoGlobal _veh;
			[_veh,_gear] call EPOCH_server_CargoFill;
			_veh setOwner (owner _playerObj);
			
			if (_persistentVics == 1) then {
				_veh call EPOCH_server_setVToken;
				_epochslot = if(EPOCH_VehicleSlots isEqualTo[])then{ str(count EPOCH_VehicleSlots) } else { EPOCH_VehicleSlots select 0 };
				EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_epochslot];
				missionNamespace setVariable ['EPOCH_VehicleSlotCount', count EPOCH_VehicleSlots, true];
				_veh setVariable['VEHICLE_SLOT',_epochslot,true];
			};
			
			_cfgEpochVehicles = 'CfgEpochVehicles' call EPOCH_returnConfig;
			_availableColorsConfig = (_cfgEpochVehicles >> _vehClass >> "availableColors");
			if (isArray(_availableColorsConfig)) then {
				_colors = getArray(_availableColorsConfig);
				_textureSelectionIndex = (_cfgEpochVehicles >> _vehClass >> "textureSelectionIndex");
				_selections = if (isArray(_textureSelectionIndex)) then { getArray(_textureSelectionIndex) } else { [0] };
				_count = (count _colors) - 1;
				{
					_textures = _colors select 0;
					if (_count >= _forEachIndex) then {
						_textures = _colors select _forEachIndex;
					};
					_veh setObjectTextureGlobal [_x, _textures  select _texture];
				} forEach _selections;
				_veh setVariable ["VEHICLE_TEXTURE", _texture];
			};
			
			if !(_baseClass isequalto "") then {
				_veh setvariable ["VEHICLE_BASECLASS",_baseClass];
			};
			_serverSettingsConfig = configFile >> "CfgEpochServer";
			_disableVehicleTIE = [_serverSettingsConfig, "disableVehicleTIE", true] call EPOCH_fnc_returnConfigEntry;
			// disable thermal imaging equipment
			if (_disableVehicleTIE) then {
				_veh disableTIEquipment true;
			};
			_removeweapons = [_serverSettingsConfig, "removevehweapons", []] call EPOCH_fnc_returnConfigEntry;
			if !(_removeweapons isequalto []) then {
				{
					_veh removeWeaponGlobal _x;
				} foreach _removeweapons;
			};
			_removemagazinesturret = [_serverSettingsConfig, "removevehmagazinesturret", []] call EPOCH_fnc_returnConfigEntry;
			if !(_removemagazinesturret isequalto []) then {
				{
					_veh removeMagazinesTurret _x;
				} foreach _removemagazinesturret;
			};
			// remove and add back magazines
			if !(_ammo isequalto []) then {
				if ((_ammo select 0) isequaltype true) then {
					{
						_veh removeMagazinesTurret [_x select 0, _x select 1];
					} foreach magazinesAllTurrets _veh;
					{
						if ((_x select 2) > 0) then {
							_veh addMagazineTurret [_x select 0,_x select 1,_x select 2];
						};
					} foreach (_ammo select 1);
				}
				else
				{
					{_veh removeMagazineGlobal _x}count (magazines _veh);
					{_veh addMagazine _x}count _ammo;
				};
			};
			
			_veh allowDamage true;
			_allHitpoints = getAllHitPointsDamage _veh;
			if !(_allHitpoints isEqualTo []) then{
				_actualHitpoints = _allHitpoints select 0;
				if ((count _actualHitpoints) == (count _hitpoints)) then{
					{
						_dmg = _hitpoints param [_forEachIndex,0];
						_veh setHitIndex [_forEachIndex, _dmg];
					} forEach _actualHitpoints;
				};
			};
		
			if (_persistentVics == 1) then {
				_veh call EPOCH_server_save_vehicle;
				_veh call EPOCH_server_vehicleInit;			// apply persistent textures
			};
			
			// Refetch the vehicles from db and send it to Client
			_response2 = ["VirtualGarage", _playerUID] call EPOCH_fnc_server_hiveGETRANGE;
			if ((_response2 select 0) isEqualTo 1) then
			{
				if (typeName (_response2 select 1) isEqualTo "ARRAY") then
				{
					if not(isNull _playerObj) then
					{
						["Garage", _response2 select 1 select 0] remoteExecCall ["SC_fnc_vgsRecvFromServer",owner _playerObj];
						// debug end message
						if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS] Client %1 took his/her %2 from garage", name _playerObj, _toSpawn select 0]};
					};
				};
			};
		};
	};
};

 

RePBO a3_epoch_virtualGarage.pbo and upload back to @epochhive/addons on your server.

Pull request submitted so hopefully this will be in his base repo. 

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

BEfilter:

remoteexec
 !="VGS_fnc_vgs(Request(Key|Garage)|(WriteTo|(Read|Trash)From)Garage) \[.+\]"

scripts
 !="createDialog 'SC_vgsDiag';" !="createDialog'SC_vgsDiag';" !="shadow='0'>VGS</t>\",{createDialog'SC_vgsDiag';},"
(fuck why there are so many way of coding same thing)

--
btw, I caught error while deleteng a non-key vehicle
I could not delete it from garage (23:28:04 lines), and the stored slot looks empty.
After relogging, I could pull it out (like I did not delete it)

Spoiler

23:27:07 "[EPOCH VGS]: WriteToGarage _data = [0,1d2bcf46040# 626570: hatchback_01_f.p3d REMOTE,B Alpha 1-1:1 (Schalldampfer) REMOTE,""EPOCH_vgsKey_6348jX18gY49oKhJyM3543lO""]"
23:27:07 "[EPOCH VGS]: WriteToGarage Client (Schalldampfer) put his/her C_Hatchback_01_EPOCH in garage"
23:27:20 "[EPOCH VGS]: ReadFromGarage _data = [0,B Alpha 1-1:1 (Schalldampfer) REMOTE,""EPOCH_vgsKey_6348jX18gY49oKhJyM3543lO""]"
23:27:20 "[EPOCH VGS] Client Schalldampfer took his/her C_Hatchback_01_EPOCH from garage"
23:28:00 Loading movesType CfgMovesGoat_F
23:28:00 Creating action map cache
23:28:00 MovesType CfgMovesGoat_F load time 11 ms
23:28:00 "[EPOCH VGS]: WriteToGarage _data = [0,1d2d9d68080# 627076: hatchback_01_f.p3d REMOTE,B Alpha 1-1:1 (Schalldampfer) REMOTE,""EPOCH_vgsKey_6348jX18gY49oKhJyM3543lO""]"
23:28:00 "[EPOCH VGS]: WriteToGarage Client (Schalldampfer) put his/her C_Hatchback_01_EPOCH in garage"
23:28:04 "[EPOCH VGS]: TrashFromGarage _data = [0,B Alpha 1-1:1 (Schalldampfer) REMOTE,""EPOCH_vgsKey_6348jX18gY49oKhJyM3543lO""]"
23:28:04 "[EPOCH VGS] Client Schalldampfer trashed slot 0 from garage"
23:28:04 Error in expression <ot(isNull _playerObj) then
{
["Garage", _vehsFriendly] remoteExecCall ["SC_fnc_v>
23:28:04   Error position: <_vehsFriendly] remoteExecCall ["SC_fnc_v>
23:28:04   Error Undefined variable in expression: _vehsfriendly
23:28:04 File \a3_epoch_virtualGarage\functions_VGS\fn_vgsTrashFromGarage.sqf [VGS_fnc_vgsTrashFromGarage], line 43
23:28:04 Error in expression <Friendly = _response select 1 select 0;
_vehsFriendly set [_slot, []];
_vehsRaw >
23:28:04   Error position: <_vehsFriendly set [_slot, []];
_vehsRaw >
23:28:04   Error Undefined variable in expression: _vehsfriendly
23:28:04 File \a3_epoch_virtualGarage\functions_VGS\fn_vgsTrashFromGarage.sqf [VGS_fnc_vgsTrashFromGarage], line 37

23:28:05 "[blckeagls] missionSpawner (17):: Initializing mission: _cords [7203.55,5898.04,0] : _markerClass OrangeMarker2 :  _aiDifficultyLevel orange _markerMissionName Resupply Camp"
23:29:00 Loading movesType CfgMovesRabbit_F
23:29:00 Creating action map cache
23:29:00 MovesType CfgMovesRabbit_F load time 11 ms
23:29:06 "[blckeagls] missionSpawner (17):: Initializing mission: _cords [8461.23,7847.01,0] : _markerClass GreenMarker1 :  _aiDifficultyLevel green _markerMissionName Medical Camp"
23:29:29 Error: Object(6 : 51) not found
23:29:29 Error: Object(6 : 49) not found
23:29:29 Error: Object(6 : 50) not found
23:29:36 Client: Remote object 6:0 not found
23:29:37 Warning: Cleanup player - person 2:1704 not found
23:29:44 Unaccessible
23:29:44 Scripting function 'bis_fnc_execvm' is not allowed to be remotely executed
23:29:44 No speaker given for 'Faisal Siddiqi'
23:29:45 Speaker Male02_F not found in CfgVoiceTypes
23:29:46 "[EPOCH VGS]: RequestKey _data = [B Alpha 1-1:1 (Schalldampfer) REMOTE,""cvsmkszgg""]"
23:29:46 "[EPOCH VGS] Client Schalldampfer requested his/her vgsKey. Result: EPOCH_vgsKey_1922xQrZeE69jRvSpNlY"
23:29:47 "[EPOCH VGS]: RequestGarage _data = [B Alpha 1-1:1 (Schalldampfer) REMOTE,""EPOCH_vgsKey_1922xQrZeE69jRvSpNlY""]"
23:29:47 "[EPOCH VGS] Client Schalldampfer requested his/her vehicles. Result: [[""C_Hatchback_01_EPOCH""],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]"

23:30:42 "[EPOCH VGS]: WriteToGarage _data = [1,1d2bbba8080# 626497: heli_light_01_civil_f.p3d REMOTE,B Alpha 1-1:1 (Schalldampfer) REMOTE,""EPOCH_vgsKey_1922xQrZeE69jRvSpNlY""]"
23:30:42 "[EPOCH VGS]: WriteToGarage Client (Schalldampfer) put his/her C_Heli_Light_01_civil_EPOCH in garage"
23:30:45 Loading movesType CfgMovesSnakes_F
23:30:45 Creating action map cache
23:30:45 MovesType CfgMovesSnakes_F load time 11 ms
23:30:46 "[EPOCH VGS]: ReadFromGarage _data = [0,B Alpha 1-1:1 (Schalldampfer) REMOTE,""EPOCH_vgsKey_1922xQrZeE69jRvSpNlY""]"
23:30:46 "[EPOCH VGS] Client Schalldampfer took his/her C_Hatchback_01_EPOCH from garage"

(after relogging,I tried overwriting the slot with C_Heli_Light_01_civil_EPOCH around 23:30:00, but it failed (with no log). I stored it in another slot successfully at 23:30:42.)

my db key after the try:

Spoiler

[[[],["C_Heli_Light_01_civil_EPOCH"],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],[[],["C_Heli_Light_01_civil_EPOCH",[[[8336,8945,0],[0.890625,0.895508,0.0372324]],[0.0414429,0.968298,0.246338],[0.0183054,-0.247244,0.96878]],0,[0.826772,0.216535,0.692913,0.779528,0.665354,0.0984252,0.5,0.0984252,0.0984252,0.358268,0.704724,0.905512,0.992126,0.917323,0.216535,0.0984252,0.42126,0.665354,0.677165,0.515748,0.905512,0.492126,0.929134,0.76378,0.692913,0.338583,0.744094,0.271654,0.724409,0.275591,0.968504,0.0984252,0.606299,0.523622,0.622047],0.171772,[[],[[],[]],[[],[]],[["U_I_C_Soldier_Para_3_F"],[1]],[]],[true,[]],17,""],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]]

 

one more issue (?) is that the vehicle spawns where it was, not where I am 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...