WolfkillArcadia

Exile 1.0.4 Bugs Megathread !! READ THE RULES!!

178 posts in this topic

Fix for virtual garage

 

/**
 * ExileServer_object_vehicle_network_retrieveVehicleRequest
 *
 * 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["_sessionID", "_parameters", "_nickname", "_playerObject", "_flagObject", "_territoryID", "_vehicleInfo", "_buildRights", "_storedVehicles", "_index"];
_sessionID = _this select 0;
_parameters = _this select 1;
_nickname = _parameters select 0;
try
{
	_playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
	if (isNull _playerObject) then 
	{
		throw "Player is null";
	};
	if (_playerObject getVariable ["ExileMutex",false]) then
	{
		throw "Player is Mutex";
	};
	_playerObject setVariable ["ExileMutex", true];
	_flagObject = _playerObject call ExileClient_util_world_getTerritoryAtPosition;
	if (isNull _flagObject) then 
	{
		throw "Invalid Flag";
	};
	if (_flagObject getVariable [format["Exile%1Mutex", toLower(_nickname)], false]) then 
	{
		throw "Vehicle is being processed by another player.";
	};
	_flagObject setVariable [format["Exile%1Mutex", toLower(_nickname)], true];
	_territoryID = _flagObject getVariable ["ExileDatabaseID", -1];
	_vehicleInfo = format["confirmVehicleOwnership:%1:%2", _nickname,_territoryID] call ExileServer_system_database_query_selectSingle;
	if !((_vehicleInfo select 1) isEqualTo _territoryID) then 
	{
		throw "Vehicle does not belong to this territory!";
	};
	_buildRights = _flagObject getVariable ["ExileTerritoryBuildRights", []];
	if !((getPlayerUID _playerObject) in _buildRights) then 
	{
		throw "You do not have rights to access this Virtual Garage";
	};
	_storedVehicles = _flagObject getVariable ["ExileTerritoryStoredVehicles", []];
	_index = -1;
	{
		if (toLower(_x select 1) isEqualTo toLower(_nickname)) exitWith 
		{
			_index = _forEachIndex;	
		};
	}
	forEach _storedVehicles;
	if (_index isEqualTo -1) then 
	{
		throw "Unable to find vehicle in stored vehicles";
	};
	_storedVehicles deleteAt _index;
	_flagObject setVariable ["ExileTerritoryStoredVehicles", _storedVehicles, true];
	format["retrieveVehicle:%1", _vehicleInfo select 0] call ExileServer_system_database_query_fireAndForget;
	(_vehicleInfo select 0) call ExileServer_object_vehicle_database_load;
	[_sessionID, "retrieveVehicleResponse", [true]] call ExileServer_system_network_send_to;
}
catch
{
	[_sessionID, "retrieveVehicleResponse", [false]] call ExileServer_system_network_send_to;
	[_sessionID, "toastRequest", ["ErrorTitleAndText", ["Retrieve Vehicle Failed!", _exception]]] call ExileServer_system_network_send_to;
	_exception call ExileServer_util_log;	
};
_flagObject setVariable [format["Exile%1Mutex", toLower(_nickname)], nil];
_playerObject setVariable ["ExileMutex", false];
true
[confirmVehicleOwnership]
SQL1_1 = SELECT id, territory_id FROM vehicle WHERE nickname = ? AND territory_id = ?
Number of Inputs = 2
SQL1_INPUTS = 1,2
OUTPUT = 1,2

 

Edited by Alexis
  • Like 5

Share this post


Link to post
Share on other sites
Advertisement
7 hours ago, Alexis said:

Fix for virtual garage

 


[confirmVehicleOwnership]
SQL1_1 = SELECT id, territory_id FROM vehicle WHERE nickname = ? AND territory_id = ?
Number of Inputs = 2
SQL1_INPUTS = 2
OUTPUT = 1,2

 

@Alexis Thanks for this. Shouldn't the inputs look like this though?
 

SQL1_INPUTS = 1,2

 

Share this post


Link to post
Share on other sites

Someone running an Exile 1.0.4 Server on Linux? Getting unmotivated SegFault/CoreDumps with no further log entry. Sometimes after an hour hour uptime, sometimes after 4 hours... Sometimes the server ran 10 hours without any issue... RPT clear till CoreDump, extDB Log clear...

Old 1.0.3 Server is running and running and running...

Got it... Was an add on related issue... Fixed and working!

Edited by Capu

Share this post


Link to post
Share on other sites

Wurde was am CfgExileLootServer verändert ? auser das es 2 verschidende sind   den wen ich mein LootTables einfüge geht nix

also loot kommt nicht

ja ich habe es nur unter CfgExileLootServer mein loot eingetragen

Share this post


Link to post
Share on other sites

Is it right to delete vehicles in the VG by garbage collection??? I don´t think so...

[markDeleteOldVehicles]
SQL1_1 = UPDATE vehicle SET deleted_at = NOW() WHERE last_updated_at < DATE_SUB(NOW(), INTERVAL ? DAY) AND deleted_at IS NULL
Number Of Inputs = 1
SQL1_INPUTS = 1

Perhaps it´s better to exclude vehicles with a territory_id

SQL1_1 = UPDATE vehicle SET deleted_at = NOW() WHERE last_updated_at < DATE_SUB(NOW(), INTERVAL ? DAY) AND deleted_at IS NULL AND territory_id IS NULL

 

Edited by Capu
  • Like 3

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.