JustPaste.it

// -----------------------------------------------------------------------------------------------------------------------------------------------
// Changes to exile.ini

[loadTerritory]
SQL1_1 = SET @connector = ?;
SQL2_1 = SELECT id,owner_uid,name,position_x,position_y,position_z,radius, level,flag_texture,flag_stolen,flag_stolen_by_uid,last_paid_at,build_rights,moderators,deleted_at,created_at,(SELECT COUNT(*)FROM construction c WHERE c.territory_id = @connector) FROM territory WHERE id = @connector
Number Of Inputs = 1
SQL1_INPUTS = 1
OUTPUT = 1,2-STRING,3-STRING,4,5,6,7,8,9-STRING,10,11-STRING,12-DateTime_ISO8601,13,14,15,16,17

// -----------------------------------------------------------------------------------------------------------------------------------------------
// Changes to ExileServer_system_territory_database_load.sqf

/**
* ExileServer_system_territory_database_load
*
* 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["_territoryID", "_data", "_id", "_owner", "_position", "_radius", "_level", "_flagTexture", "_flagStolen", "_flagStolenBy", "_lastPayed", "_buildRights", "_moderators", "_createdAt", "_flagObject"];
_territoryID = _this;
_data = format ["loadTerritory:%1", _territoryID] call ExileServer_system_database_query_selectSingle;
_id = _data select 0;
_owner = _data select 1;
_name = _data select 2;
_position =
[
_data select 3,
_data select 4,
_data select 5
];
_radius = _data select 6;
_level = _data select 7;
_flagTexture = _data select 8;
_flagStolen = _data select 9;
_flagStolenBy = _data select 10;
_lastPayed = _data select 11;
_buildRights = _data select 12;
_moderators = _data select 13;
_createdAt = _data select 15;
_flagObject = createVehicle ["Exile_Construction_Flag_Static",_position, [], 0, "CAN_COLLIDE"];
if (_flagStolen isEqualTo 0) then
{
_flagObject setFlagTexture _flagTexture;
};
ExileLocations pushBack _flagObject;
_flagObject setVariable ["ExileTerritoryName", _name, true];
_flagObject setVariable ["ExileDatabaseID", _id];
_flagObject setVariable ["ExileOwnerUID", _owner, true];
_flagObject setVariable ["ExileTerritorySize", _radius, true];
_flagObject setVariable ["ExileTerritoryBuildRights", _buildRights, true];
_flagObject setVariable ["ExileTerritoryModerators", _moderators, true];
_flagObject setVariable ["ExileTerritoryLevel", _level, true];
_flagObject setVariable ["ExileTerritoryLastPayed", _lastPayed];
_flagObject call ExileServer_system_territory_maintenance_recalculateDueDate;
_flagObject setVariable ["ExileTerritoryNumberOfConstructions", _data select 16, true];
_flagObject setVariable ["ExileTerritoryCreatedAt", _createdAt];
_flagObject setVariable ["ExileRadiusShown", false, true];
_flagObject setVariable ["ExileFlagStolen",_flagStolen,true];
_flagObject setVariable ["ExileFlagTexture",_flagTexture];
if (getNumber(missionConfigFile >> "CfgVirtualGarage" >> "enableVirtualGarage") isEqualTo 1) then
{
_data = format["loadTerritoryVirtualGarage:%1", _territoryID] call ExileServer_system_database_query_selectFull;
_flagObject setVariable ["ExileTerritoryStoredVehicles", _data, true];
};
true

// -----------------------------------------------------------------------------------------------------------------------------------------------
// Changes to ExileClient_action_stealFlag_condition.sqf

/**
* ExileClient_action_stealFlag_condition
*
* 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["_flagObject","_result","_buildRights","_saveTheBambis","_protectionMessage","_noMoreProtectionNow","_territory"];
_flagObject = _this;
_result = "";
try
{
if (isNull _flagObject) then
{
throw "Invalid flag object";
};
if ((_flagObject getvariable ["ExileFlagStolen", 0]) isEqualTo 1) then
{
throw "Cannot steal a flag twice!";
};
if ((_flagObject distance2D player) > 2) then
{
throw "You are too far away!";
};
if (((getPosASL player) select 2) > (((getPosASL _flagObject) select 2) + 4)) then
{
throw "You cannot steal flags at the top of the pole!";
};
_buildRights = _flagObject getVariable ["ExileTerritoryBuildRights",[]];
if ((getPlayerUID player) in _buildRights) then
{
throw "You cannot steal your own flag!";
};
// Prevent Low Level Raiding
_saveTheBambis = getNumber (missionConfigFile >> "CfgSaveTheBambis" >> "enabled");
_protectionMessage = getText (missionConfigFile >> "CfgSaveTheBambis" >> "protectionMessage");
_noMoreProtectionNow = getNumber (missionConfigFile >> "CfgSaveTheBambis" >> "stopProtectionLevel");
_territory = _flagObject call ExileClient_util_world_getTerritoryAtPosition;
_createdAt = _flagObject getVariable ["ExileTerritoryCreatedAt", "blank!"];
if !(isNull _territory) then
{
if ((_saveTheBambis > 0) && (_territory getVariable ["ExileTerritoryLevel", 1]) < _noMoreProtectionNow) then
{
//throw _protectionMessage;
throw format["Flag created at: %1", _createdAt];
};
};
}
catch
{
_result = _exception;
};
_result