Added files without dynamic simulation
This commit is contained in:
parent
0fe904ba40
commit
d01fd03495
37
NoDynamicSimEdits/CfgExileCustomCode.cpp
Normal file
37
NoDynamicSimEdits/CfgExileCustomCode.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
ExileServer_system_database_connect = "Exile_Server_Overrides\ExileServer_system_database_connect.sqf";
|
||||
ExileServer_system_process_noobFilter = "Exile_Server_Overrides\ExileServer_system_process_noobFilter.sqf";
|
||||
ExileServer_world_initialize = "Exile_Server_Overrides\ExileServer_world_initialize.sqf";
|
||||
ExileServer_util_time_uptime = "Exile_Server_Overrides\ExileServer_util_time_uptime.sqf";
|
||||
ExileServer_util_time_currentTime = "Exile_Server_Overrides\ExileServer_util_time_currentTime.sqf";
|
||||
ExileServer_util_time_addTime = "Exile_Server_Overrides\ExileServer_util_time_addTime.sqf";
|
||||
ExileServer_system_trading_network_wasteDumpRequest = "Exile_Server_Overrides\ExileServer_system_trading_network_wasteDumpRequest.sqf";
|
||||
ExileServer_system_trading_network_sellItemRequest = "Exile_Server_Overrides\ExileServer_system_trading_network_sellItemRequest.sqf";
|
||||
ExileServer_system_trading_network_purchaseVehicleSkinRequest = "Exile_Server_Overrides\ExileServer_system_trading_network_purchaseVehicleSkinRequest.sqf";
|
||||
ExileServer_system_trading_network_purchaseVehicleRequest = "Exile_Server_Overrides\ExileServer_system_trading_network_purchaseVehicleRequest.sqf";
|
||||
ExileServer_system_trading_network_purchaseItemRequest = "Exile_Server_Overrides\ExileServer_system_trading_network_purchaseItemRequest.sqf";
|
||||
ExileServer_system_territory_network_territoryUpgradeRequest = "Exile_Server_Overrides\ExileServer_system_territory_network_territoryUpgradeRequest.sqf";
|
||||
ExileServer_system_territory_network_restoreFlagRequest = "Exile_Server_Overrides\ExileServer_system_territory_network_restoreFlagRequest.sqf";
|
||||
ExileServer_system_territory_network_purchaseTerritory = "Exile_Server_Overrides\ExileServer_system_territory_network_purchaseTerritory.sqf";
|
||||
ExileServer_system_territory_network_payTerritoryProtectionMoneyRequest = "Exile_Server_Overrides\ExileServer_system_territory_network_payTerritoryProtectionMoneyRequest.sqf";
|
||||
ExileServer_system_territory_network_payFlagRansomRequest = "Exile_Server_Overrides\ExileServer_system_territory_network_payFlagRansomRequest.sqf";
|
||||
ExileServer_system_territory_network_flagStolenRequest = "Exile_Server_Overrides\ExileServer_system_territory_network_flagStolenRequest.sqf";
|
||||
ExileServer_system_territory_maintenance_recalculateDueDate = "Exile_Server_Overrides\ExileServer_system_territory_maintenance_recalculateDueDate.sqf";
|
||||
ExileServer_system_territory_database_insert = "Exile_Server_Overrides\ExileServer_system_territory_database_insert.sqf";
|
||||
ExileServer_system_database_query_selectSingleField = "Exile_Server_Overrides\ExileServer_system_database_query_selectSingleField.sqf";
|
||||
ExileServer_system_database_query_selectSingle = "Exile_Server_Overrides\ExileServer_system_database_query_selectSingle.sqf";
|
||||
ExileServer_system_database_query_selectFull = "Exile_Server_Overrides\ExileServer_system_database_query_selectFull.sqf";
|
||||
ExileServer_system_database_query_insertSingle = "Exile_Server_Overrides\ExileServer_system_database_query_insertSingle.sqf";
|
||||
ExileServer_system_database_query_fireAndForget = "Exile_Server_Overrides\ExileServer_system_database_query_fireAndForget.sqf";
|
||||
ExileServer_system_database_handleBig = "Exile_Server_Overrides\ExileServer_system_database_handleBig.sqf";
|
||||
ExileServer_object_vehicle_database_load = "Exile_Server_Overrides\ExileServer_object_vehicle_database_load.sqf";
|
||||
ExileServer_object_vehicle_createPersistentVehicle = "Exile_Server_Overrides\ExileServer_object_vehicle_createPersistentVehicle.sqf";
|
||||
ExileServer_object_vehicle_createNonPersistentVehicle = "Exile_Server_Overrides\ExileServer_object_vehicle_createNonPersistentVehicle.sqf";
|
||||
ExileServer_object_player_event_onMpKilled = "Exile_Server_Overrides\ExileServer_object_player_event_onMpKilled.sqf";
|
||||
ExileServer_object_player_database_load = "Exile_Server_Overrides\ExileServer_object_player_database_load.sqf";
|
||||
ExileServer_object_player_createBambi = "Exile_Server_Overrides\ExileServer_object_player_createBambi.sqf";
|
||||
ExileServer_object_container_database_update = "Exile_Server_Overrides\ExileServer_object_container_database_update.sqf";
|
||||
ExileServer_object_container_database_load = "Exile_Server_Overrides\ExileServer_object_container_database_load.sqf";
|
||||
ExileServer_object_container_database_insert = "Exile_Server_Overrides\ExileServer_object_container_database_insert.sqf";
|
||||
ExileServer_object_container_createContainer = "Exile_Server_Overrides\ExileServer_object_container_createContainer.sqf";
|
||||
ExileServer_object_construction_database_load = "Exile_Server_Overrides\ExileServer_object_construction_database_load.sqf";
|
||||
ExileServer_object_construction_database_insert = "Exile_Server_Overrides\ExileServer_object_construction_database_insert.sqf";
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* ExileServer_object_construction_database_insert
|
||||
*
|
||||
* 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["_constructionObject","_position","_vectorDirection","_vectorUp","_territoryFlag","_territoryID","_data","_extDB2Message","_constructionID"];
|
||||
_constructionObject = _this;
|
||||
_position = getPosATL _constructionObject;
|
||||
_vectorDirection = vectorDir _constructionObject;
|
||||
_vectorUp = vectorUp _constructionObject;
|
||||
_territoryFlag = _constructionObject call ExileClient_util_world_getTerritoryAtPosition;
|
||||
_territoryID = if (isNull _territoryFlag) then { '' } else { _territoryFlag getVariable ["ExileDatabaseID", '']};
|
||||
_data =
|
||||
[
|
||||
typeOf _constructionObject,
|
||||
_constructionObject getVariable ["ExileOwnerUID", ""],
|
||||
_position select 0,
|
||||
_position select 1,
|
||||
_position select 2,
|
||||
_vectorDirection select 0,
|
||||
_vectorDirection select 1,
|
||||
_vectorDirection select 2,
|
||||
_vectorUp select 0,
|
||||
_vectorUp select 1,
|
||||
_vectorUp select 2,
|
||||
_territoryID
|
||||
];
|
||||
_extDB2Message = ["insertConstruction", _data] call ExileServer_util_extDB2_createMessage;
|
||||
_constructionID = _extDB2Message call ExileServer_system_database_query_insertSingle;
|
||||
_constructionObject setVariable ["ExileDatabaseID", _constructionID];
|
||||
_constructionObject setVariable ["ExileTerritoryID", _territoryID];
|
||||
_constructionObject call ExileServer_system_simulationMonitor_addVehicle;
|
||||
_constructionID
|
@ -0,0 +1,52 @@
|
||||
/**
|
||||
* ExileServer_object_construction_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["_constructionID","_data","_position","_vectorDirection","_vectorUp","_constructionObject","_damageLevel","_public","_pinCode"];
|
||||
_constructionID = _this;
|
||||
_data = format ["loadConstruction:%1", _constructionID] call ExileServer_system_database_query_selectSingle;
|
||||
_position = [_data select 4, _data select 5, _data select 6];
|
||||
_vectorDirection = [_data select 7, _data select 8, _data select 9];
|
||||
_vectorUp = [_data select 10, _data select 11, _data select 12];
|
||||
_constructionObject = createVehicle [(_data select 1), _position, [], 0, "CAN_COLLIDE"];
|
||||
_constructionObject setPosATL _position;
|
||||
_constructionObject setVectorDirAndUp [_vectorDirection, _vectorUp];
|
||||
_constructionObject setVariable ["ExileDatabaseID", _data select 0];
|
||||
_constructionObject setVariable ["ExileOwnerUID", (_data select 2)];
|
||||
_constructionObject setVariable ["ExileIsPersistent", true];
|
||||
_constructionObject setVariable ["ExileTerritoryID", (_data select 15)];
|
||||
_damageLevel = (_data select 17);
|
||||
_public = _damageLevel > 0;
|
||||
_constructionObject setVariable ["ExileConstructionDamage",_damageLevel,_public];
|
||||
if(_public)then
|
||||
{
|
||||
_constructionObject call ExileServer_util_setDamageTexture;
|
||||
};
|
||||
_pinCode = _data select 14;
|
||||
if !(_pinCode isEqualTo "000000") then
|
||||
{
|
||||
_constructionObject setVariable ["ExileAccessCode", _pinCode];
|
||||
_constructionObject setVariable ["ExileIsLocked", (_data select 13), true];
|
||||
};
|
||||
if (getNumber(configFile >> "CfgVehicles" >> (_data select 1) >> "exileRequiresSimulation") isEqualTo 1) then
|
||||
{
|
||||
_constructionObject enableSimulationGlobal true;
|
||||
_constructionObject call ExileServer_system_simulationMonitor_addVehicle;
|
||||
}
|
||||
else
|
||||
{
|
||||
_constructionObject enableSimulationGlobal false;
|
||||
};
|
||||
_constructionObject setVelocity [0, 0, 0];
|
||||
_constructionObject setPosATL _position;
|
||||
_constructionObject setVelocity [0, 0, 0];
|
||||
_constructionObject setVectorDirAndUp [_vectorDirection, _vectorUp];
|
||||
_constructionObject setVelocity [0, 0, 0];
|
||||
_constructionObject
|
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* ExileServer_object_container_createContainer
|
||||
*
|
||||
* 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["_className", "_position", "_direction", "_containerObject"];
|
||||
_className = _this select 0;
|
||||
_position = _this select 1;
|
||||
_direction = _this select 2;
|
||||
_containerObject = createVehicle [_className, _position, [], 0, "CAN_COLLIDE"];
|
||||
clearBackpackCargoGlobal _containerObject;
|
||||
clearItemCargoGlobal _containerObject;
|
||||
clearMagazineCargoGlobal _containerObject;
|
||||
clearWeaponCargoGlobal _containerObject;
|
||||
_containerObject setDir _direction;
|
||||
_containerObject setPosATL _position;
|
||||
_containerObject setVariable ["ExileIsPersistent", true];
|
||||
_containerObject setVariable ["ExileIsContainer", true];
|
||||
if(getNumber(configFile >> "CfgVehicles" >> typeOf _containerObject >> "exileIsLockable") isEqualTo 1)then
|
||||
{
|
||||
_containerObject setVariable ["ExileIsLocked", -1,true];
|
||||
};
|
||||
_containerObject call ExileServer_system_simulationMonitor_addVehicle;
|
||||
_containerObject
|
@ -0,0 +1,91 @@
|
||||
/**
|
||||
* ExileServer_object_container_database_insert
|
||||
*
|
||||
* 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["_containerObject", "_position", "_vectorDirection", "_vectorUp", "_territoryFlag", "_territoryID", "_data", "_extDB2Message", "_containerID", "_cargoContainers"];
|
||||
_containerObject = _this;
|
||||
_position = getPosATL _containerObject;
|
||||
_vectorDirection = vectorDir _containerObject;
|
||||
_vectorUp = vectorUp _containerObject;
|
||||
_territoryFlag = _containerObject call ExileClient_util_world_getTerritoryAtPosition;
|
||||
_territoryID = if (isNull _territoryFlag) then { '' } else { _territoryFlag getVariable ["ExileDatabaseID", '']};
|
||||
if !(ExileContainerCargo isEqualTo []) then
|
||||
{
|
||||
_data =
|
||||
[
|
||||
typeOf _containerObject,
|
||||
_containerObject getVariable ["ExileOwnerUID", ""],
|
||||
_position select 0,
|
||||
_position select 1,
|
||||
_position select 2,
|
||||
_vectorDirection select 0,
|
||||
_vectorDirection select 1,
|
||||
_vectorDirection select 2,
|
||||
_vectorUp select 0,
|
||||
_vectorUp select 1,
|
||||
_vectorUp select 2,
|
||||
ExileContainerCargo select 0,
|
||||
ExileContainerCargo select 1,
|
||||
ExileContainerCargo select 2,
|
||||
ExileContainerCargo select 3,
|
||||
ExileContainerCargo select 4,
|
||||
"0000",
|
||||
_territoryID
|
||||
];
|
||||
} else
|
||||
{
|
||||
_data =
|
||||
[
|
||||
typeOf _containerObject,
|
||||
_containerObject getVariable ["ExileOwnerUID", ""],
|
||||
_position select 0,
|
||||
_position select 1,
|
||||
_position select 2,
|
||||
_vectorDirection select 0,
|
||||
_vectorDirection select 1,
|
||||
_vectorDirection select 2,
|
||||
_vectorUp select 0,
|
||||
_vectorUp select 1,
|
||||
_vectorUp select 2,
|
||||
[],
|
||||
[],
|
||||
[],
|
||||
[],
|
||||
0,
|
||||
"0000",
|
||||
_territoryID
|
||||
];
|
||||
};
|
||||
_extDB2Message = ["insertContainer", _data] call ExileServer_util_extDB2_createMessage;
|
||||
_containerID = _extDB2Message call ExileServer_system_database_query_insertSingle;
|
||||
if !(ExileContainerCargo isEqualTo []) then
|
||||
{
|
||||
[_containerObject, (_data select 11)] call ExileServer_util_fill_fillItems;
|
||||
[_containerObject, (_data select 12)] call ExileServer_util_fill_fillMagazines;
|
||||
[_containerObject, (_data select 13)] call ExileServer_util_fill_fillWeapons;
|
||||
_cargoContainers = format ["loadContainerCargo:%1", _containerID] call ExileServer_system_database_query_selectSingle;
|
||||
if !(_cargoContainers isEqualTo []) then
|
||||
{
|
||||
[_containerObject, (_cargoContainers select 0)] call ExileServer_util_fill_fillContainers;
|
||||
};
|
||||
ExileContainerCargo = [];
|
||||
};
|
||||
_containerObject setVariable ["ExileDatabaseID", _containerID];
|
||||
_containerObject setVariable ["ExileIsPersistent", true];
|
||||
_containerObject setVariable ["ExileIsContainer", true];
|
||||
_containerObject setVariable ["ExileAccessCode","0000"];
|
||||
_containerObject setVariable ["ExileTerritoryID", _territoryID];
|
||||
_containerObject setVariable ["ExileMoney", parseNumber (_data select 15), true];
|
||||
_containerObject addMPEventHandler ["MPKilled", { if !(isServer) exitWith {}; (_this select 0) call ExileServer_object_container_event_onMpKilled; }];
|
||||
if(getNumber(configFile >> "CfgVehicles" >> typeOf _containerObject >> "exileIsLockable") isEqualTo 1)then
|
||||
{
|
||||
_containerObject setVariable ["ExileIsLocked",-1,true];
|
||||
};
|
||||
_containerID
|
@ -0,0 +1,69 @@
|
||||
/**
|
||||
* ExileServer_object_container_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["_containerID", "_data", "_position", "_vectorDirection", "_vectorUp", "_abandoned", "_containerObject", "_cargoContainers"];
|
||||
_containerID = _this;
|
||||
_data = format ["loadContainer:%1", _containerID] call ExileServer_system_database_query_selectSingle;
|
||||
_position = [_data select 4, _data select 5, _data select 6];
|
||||
_vectorDirection = [_data select 7, _data select 8, _data select 9];
|
||||
_vectorUp = [_data select 10, _data select 11, _data select 12];
|
||||
_abandoned = _data select 18;
|
||||
try
|
||||
{
|
||||
if !((vectorMagnitude _vectorUp) isEqualTo 1) then
|
||||
{
|
||||
throw true;
|
||||
};
|
||||
if ((_vectorUp select 0) > 0.95) then
|
||||
{
|
||||
throw true;
|
||||
};
|
||||
if ((_vectorUp select 1) > 0.95) then
|
||||
{
|
||||
throw true;
|
||||
};
|
||||
if ((_vectorUp select 2) isEqualTo 0) then
|
||||
{
|
||||
throw true;
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
_vectorUp = [0, 0, 1];
|
||||
};
|
||||
_containerObject = [(_data select 1), _position, 0] call ExileServer_object_container_createContainer;
|
||||
_containerObject setVectorDirAndUp [_vectorDirection, _vectorUp];
|
||||
_containerObject setVariable ["ExileDatabaseID", _containerID];
|
||||
_containerObject setVariable ["ExileOwnerUID", (_data select 2),true];
|
||||
_containerObject setVariable ["ExileAccessCode",(_data select 16)];
|
||||
_containerObject setVariable ["ExileTerritoryID", (_data select 17)];
|
||||
_containerObject setVariable ["ExileMoney", (_data select 20), true];
|
||||
if(getNumber(configFile >> "CfgVehicles" >> typeOf _containerObject >> "exileIsLockable") isEqualTo 1)then
|
||||
{
|
||||
_containerObject setVariable ["ExileIsLocked",(_data select 3),true];
|
||||
};
|
||||
[_containerObject, (_data select 13)] call ExileServer_util_fill_fillItems;
|
||||
[_containerObject, (_data select 14)] call ExileServer_util_fill_fillMagazines;
|
||||
[_containerObject, (_data select 15)] call ExileServer_util_fill_fillWeapons;
|
||||
_cargoContainers = format ["loadContainerCargo:%1", _containerID] call ExileServer_system_database_query_selectSingle;
|
||||
if !(_cargoContainers isEqualTo []) then
|
||||
{
|
||||
[_containerObject, (_cargoContainers select 0)] call ExileServer_util_fill_fillContainers;
|
||||
};
|
||||
if !(_abandoned isEqualTo "") then
|
||||
{
|
||||
format ["ExileServer - Adding Container %1 to Abandonded Safes", _containerID] call ExileClient_util_log;
|
||||
ExileAbandondedSafes pushBack _containerObject;
|
||||
};
|
||||
_containerObject enableSimulationGlobal false;
|
||||
_containerObject call ExileServer_system_simulationMonitor_addVehicle;
|
||||
_containerObject addMPEventHandler ["MPKilled", { if !(isServer) exitWith {}; (_this select 0) call ExileServer_object_container_event_onMpKilled; }];
|
||||
_containerObject
|
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* ExileServer_object_container_database_update
|
||||
*
|
||||
* 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["_containerObject", "_containerID", "_position", "_vectorDirection", "_vectorUp", "_territoryFlag", "_territoryID", "_data", "_extDB2Message"];
|
||||
_containerObject= _this;
|
||||
_containerID = _containerObject getVariable ["ExileDatabaseID", -1];
|
||||
if (_containerID > -1) then
|
||||
{
|
||||
_position = getPosATL _containerObject;
|
||||
_vectorDirection = vectorDir _containerObject;
|
||||
_vectorUp = vectorUp _containerObject;
|
||||
_territoryFlag = _containerObject call ExileClient_util_world_getTerritoryAtPosition;
|
||||
_territoryID = if (isNull _territoryFlag) then { '' } else { _territoryFlag getVariable ["ExileDatabaseID", '']};
|
||||
_containerObject setVariable ["ExileTerritoryID", _territoryID];
|
||||
_data =
|
||||
[
|
||||
_containerObject getVariable ["ExileIsLocked",-1],
|
||||
_position select 0,
|
||||
_position select 1,
|
||||
_position select 2,
|
||||
_vectorDirection select 0,
|
||||
_vectorDirection select 1,
|
||||
_vectorDirection select 2,
|
||||
_vectorUp select 0,
|
||||
_vectorUp select 1,
|
||||
_vectorUp select 2,
|
||||
_containerObject call ExileServer_util_getItemCargo,
|
||||
magazinesAmmoCargo _containerObject,
|
||||
weaponsItemsCargo _containerObject,
|
||||
_containerObject call ExileServer_util_getObjectContainerCargo,
|
||||
_territoryID,
|
||||
_containerObject getVariable ["ExileMoney", 0],
|
||||
_containerID
|
||||
];
|
||||
_extDB2Message = ["updateContainer", _data] call ExileServer_util_extDB2_createMessage;
|
||||
_extDB2Message call ExileServer_system_database_query_fireAndForget;
|
||||
};
|
||||
true
|
@ -0,0 +1,153 @@
|
||||
/**
|
||||
* ExileServer_object_player_createBambi
|
||||
*
|
||||
* 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", "_requestingPlayer", "_spawnLocationMarkerName", "_bambiPlayer", "_accountData", "_direction", "_position", "_spawnAreaPosition", "_spawnAreaRadius", "_clanID", "_clanData", "_clanGroup", "_player", "_devFriendlyMode", "_devs", "_parachuteNetID", "_spawnType", "_parachuteObject"];
|
||||
_sessionID = _this select 0;
|
||||
_requestingPlayer = _this select 1;
|
||||
_spawnLocationMarkerName = _this select 2;
|
||||
_bambiPlayer = _this select 3;
|
||||
_accountData = _this select 4;
|
||||
_direction = random 360;
|
||||
if ((count ExileSpawnZoneMarkerPositions) isEqualTo 0) then
|
||||
{
|
||||
_position = call ExileClient_util_world_findCoastPosition;
|
||||
if ((toLower worldName) isEqualTo "namalsk") then
|
||||
{
|
||||
while {(_position distance2D [76.4239, 107.141, 0]) < 100} do
|
||||
{
|
||||
_position = call ExileClient_util_world_findCoastPosition;
|
||||
};
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_spawnAreaPosition = getMarkerPos _spawnLocationMarkerName;
|
||||
_spawnAreaRadius = getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "spawnZoneRadius");
|
||||
_position = [_spawnAreaPosition, _spawnAreaRadius] call ExileClient_util_math_getRandomPositionInCircle;
|
||||
while {surfaceIsWater _position} do
|
||||
{
|
||||
_position = [_spawnAreaPosition, _spawnAreaRadius] call ExileClient_util_math_getRandomPositionInCircle;
|
||||
};
|
||||
};
|
||||
_name = name _requestingPlayer;
|
||||
_clanID = (_accountData select 3);
|
||||
if !((typeName _clanID) isEqualTo "SCALAR") then
|
||||
{
|
||||
_clanID = -1;
|
||||
_clanData = [];
|
||||
}
|
||||
else
|
||||
{
|
||||
_clanData = missionNamespace getVariable [format ["ExileServer_clan_%1",_clanID],[]];
|
||||
if(isNull (_clanData select 5))then
|
||||
{
|
||||
_clanGroup = createGroup independent;
|
||||
_clanData set [5,_clanGroup];
|
||||
_clanGroup setGroupIdGlobal [_clanData select 0];
|
||||
missionNameSpace setVariable [format ["ExileServer_clan_%1",_clanID],_clanData];
|
||||
}
|
||||
else
|
||||
{
|
||||
_clanGroup = (_clanData select 5);
|
||||
};
|
||||
[_player] joinSilent _clanGroup;
|
||||
};
|
||||
_bambiPlayer setPosATL [_position select 0,_position select 1,0];
|
||||
_bambiPlayer disableAI "FSM";
|
||||
_bambiPlayer disableAI "MOVE";
|
||||
_bambiPlayer disableAI "AUTOTARGET";
|
||||
_bambiPlayer disableAI "TARGET";
|
||||
_bambiPlayer disableAI "CHECKVISIBLE";
|
||||
_bambiPlayer setDir _direction;
|
||||
_bambiPlayer setName _name;
|
||||
_bambiPlayer setVariable ["ExileMoney", 0, true];
|
||||
_bambiPlayer setVariable ["ExileScore", (_accountData select 0)];
|
||||
_bambiPlayer setVariable ["ExileKills", (_accountData select 1)];
|
||||
_bambiPlayer setVariable ["ExileDeaths", (_accountData select 2)];
|
||||
_bambiPlayer setVariable ["ExileClanID", _clanID];
|
||||
_bambiPlayer setVariable ["ExileClanData", _clanData];
|
||||
_bambiPlayer setVariable ["ExileHunger", 100];
|
||||
_bambiPlayer setVariable ["ExileThirst", 100];
|
||||
_bambiPlayer setVariable ["ExileTemperature", 37];
|
||||
_bambiPlayer setVariable ["ExileWetness", 0];
|
||||
_bambiPlayer setVariable ["ExileAlcohol", 0];
|
||||
_bambiPlayer setVariable ["ExileName", _name];
|
||||
_bambiPlayer setVariable ["ExileOwnerUID", getPlayerUID _requestingPlayer];
|
||||
_bambiPlayer setVariable ["ExileIsBambi", true];
|
||||
_bambiPlayer setVariable ["ExileXM8IsOnline", false, true];
|
||||
_bambiPlayer setVariable ["ExileLocker", (_accountData select 4), true];
|
||||
_devFriendlyMode = getNumber (configFile >> "CfgSettings" >> "ServerSettings" >> "devFriendyMode");
|
||||
if (_devFriendlyMode isEqualTo 1) then
|
||||
{
|
||||
_devs = getArray (configFile >> "CfgSettings" >> "ServerSettings" >> "devs");
|
||||
{
|
||||
if ((getPlayerUID _requestingPlayer) isEqualTo (_x select 0))exitWith
|
||||
{
|
||||
if ((name _requestingPlayer) isEqualTo (_x select 1))then
|
||||
{
|
||||
_bambiPlayer setVariable ["ExileMoney", 500000, true];
|
||||
_bambiPlayer setVariable ["ExileScore", 100000];
|
||||
};
|
||||
};
|
||||
}
|
||||
forEach _devs;
|
||||
};
|
||||
_parachuteNetID = "";
|
||||
if ((getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "parachuteSpawning")) isEqualTo 1) then
|
||||
{
|
||||
_position set [2, getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "parachuteDropHeight")];
|
||||
if ((getNumber(configFile >> "CfgSettings" >> "BambiSettings" >> "haloJump")) isEqualTo 1) then
|
||||
{
|
||||
_bambiPlayer addBackpackGlobal "B_Parachute";
|
||||
_bambiPlayer setPosATL _position;
|
||||
_spawnType = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
_parachuteObject = createVehicle ["Steerable_Parachute_F", _position, [], 0, "CAN_COLLIDE"];
|
||||
_parachuteObject setDir _direction;
|
||||
_parachuteObject setPosATL _position;
|
||||
_parachuteObject enableSimulationGlobal true;
|
||||
_parachuteNetID = netId _parachuteObject;
|
||||
_spawnType = 1;
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
_spawnType = 0;
|
||||
};
|
||||
if((canTriggerDynamicSimulation _bambiPlayer) isEqualTo false) then
|
||||
{
|
||||
_bambiPlayer triggerDynamicSimulation true;
|
||||
};
|
||||
_bambiPlayer addMPEventHandler ["MPKilled", {_this call ExileServer_object_player_event_onMpKilled}];
|
||||
_bambiPlayer call ExileServer_object_player_database_insert;
|
||||
_bambiPlayer call ExileServer_object_player_database_update;
|
||||
[
|
||||
_sessionID,
|
||||
"createPlayerResponse",
|
||||
[
|
||||
_bambiPlayer,
|
||||
_parachuteNetID,
|
||||
str (_accountData select 0),
|
||||
(_accountData select 1),
|
||||
(_accountData select 2),
|
||||
100,
|
||||
100,
|
||||
0,
|
||||
(getNumber (configFile >> "CfgSettings" >> "BambiSettings" >> "protectionDuration")) * 60,
|
||||
_clanData,
|
||||
_spawnType
|
||||
]
|
||||
]
|
||||
call ExileServer_system_network_send_to;
|
||||
[_sessionID, _bambiPlayer] call ExileServer_system_session_update;
|
||||
true
|
@ -0,0 +1,250 @@
|
||||
/**
|
||||
* ExileServer_object_player_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["_data", "_oldPlayerObject", "_playerUID", "_sessionID", "_position", "_direction", "_player", "_clanID", "_clanName", "_clanData", "_clanGroup", "_devFriendlyMode", "_devs", "_headgear", "_goggles", "_binocular", "_primaryWeapon", "_handgunWeapon", "_secondaryWeapon", "_currentWeapon", "_uniform", "_vest", "_backpack", "_uniformContainer", "_vestContainer", "_backpackContainer", "_assignedItems"];
|
||||
_data = _this select 0;
|
||||
_oldPlayerObject = _this select 1;
|
||||
_playerUID = _this select 2;
|
||||
_sessionID = _this select 3;
|
||||
_name = name _oldPlayerObject;
|
||||
_position = [_data select 11, _data select 12, _data select 13];
|
||||
_direction = _data select 10;
|
||||
_player = (createGroup independent) createUnit ["Exile_Unit_Player", _position, [], 0, "CAN_COLLIDE"];
|
||||
_player setDir _direction;
|
||||
_player setPosATL _position;
|
||||
_player disableAI "FSM";
|
||||
_player disableAI "MOVE";
|
||||
_player disableAI "AUTOTARGET";
|
||||
_player disableAI "TARGET";
|
||||
_player disableAI "CHECKVISIBLE";
|
||||
_clanID = (_data select 42);
|
||||
_clanName = (_data select 43);
|
||||
if !((typeName _clanID) isEqualTo "SCALAR") then
|
||||
{
|
||||
_clanID = -1;
|
||||
_clanData = [];
|
||||
}
|
||||
else
|
||||
{
|
||||
_clanData = missionnamespace getVariable [format ["ExileServer_clan_%1",_clanID],[]];
|
||||
if(isNull (_clanData select 5))then
|
||||
{
|
||||
_clanGroup = createGroup independent;
|
||||
_clanData set [5,_clanGroup];
|
||||
_clanGroup setGroupIdGlobal [_clanData select 0];
|
||||
missionNameSpace setVariable [format ["ExileServer_clan_%1",_clanID],_clanData];
|
||||
}
|
||||
else
|
||||
{
|
||||
_clanGroup = (_clanData select 5);
|
||||
};
|
||||
[_player] joinSilent _clanGroup;
|
||||
};
|
||||
_player setDamage (_data select 3);
|
||||
_player setName _name;
|
||||
_player setVariable ["ExileMoney", (_data select 38), true];
|
||||
_player setVariable ["ExileScore", (_data select 39)];
|
||||
_player setVariable ["ExileKills", (_data select 40)];
|
||||
_player setVariable ["ExileDeaths", (_data select 41)];
|
||||
_player setVariable ["ExileClanID", _clanID];
|
||||
_player setVariable ["ExileClanData", _clanData];
|
||||
_player setVariable ["ExileName", _name];
|
||||
_player setVariable ["ExileOwnerUID", _playerUID];
|
||||
_player setVariable ["ExileDatabaseID", _data select 0];
|
||||
_player setVariable ["ExileHunger", _data select 4];
|
||||
_player setVariable ["ExileThirst", _data select 5];
|
||||
_player setVariable ["ExileAlcohol", _data select 6];
|
||||
_player setVariable ["ExileTemperature", _data select 44];
|
||||
_player setVariable ["ExileWetness", _data select 45];
|
||||
_player setVariable ["ExileIsBambi", false];
|
||||
_player setVariable ["ExileXM8IsOnline", false, true];
|
||||
_player setOxygenRemaining (_data select 7);
|
||||
_player setBleedingRemaining (_data select 8);
|
||||
_player setVariable ["ExileLocker", (_data select 46), true];
|
||||
[_player, _data select 9] call ExileClient_util_player_applyHitPointMap;
|
||||
_devFriendlyMode = getNumber (configFile >> "CfgSettings" >> "ServerSettings" >> "devFriendyMode");
|
||||
if (_devFriendlyMode isEqualTo 1) then
|
||||
{
|
||||
_devs = getArray (configFile >> "CfgSettings" >> "ServerSettings" >> "devs");
|
||||
{
|
||||
if (_playerUID isEqualTo (_x select 0)) exitWith
|
||||
{
|
||||
if (_name isEqualTo (_x select 1)) then
|
||||
{
|
||||
_player setVariable ["ExileMoney", 500000, true];
|
||||
_player setVariable ["ExileScore", 100000];
|
||||
};
|
||||
};
|
||||
}
|
||||
forEach _devs;
|
||||
};
|
||||
_player call ExileClient_util_playerCargo_clear;
|
||||
_headgear = _data select 23;
|
||||
if (_headgear != "") then
|
||||
{
|
||||
_player addHeadgear _headgear;
|
||||
};
|
||||
_goggles = _data select 20;
|
||||
if (_goggles != "") then
|
||||
{
|
||||
_player addGoggles _goggles;
|
||||
};
|
||||
_binocular = _data select 24;
|
||||
if (_binocular != "") then
|
||||
{
|
||||
_player addWeaponGlobal _binocular;
|
||||
};
|
||||
_primaryWeapon = _data select 26;
|
||||
if (_primaryWeapon != "") then
|
||||
{
|
||||
_player addWeaponGlobal _primaryWeapon;
|
||||
removeAllPrimaryWeaponItems _player;
|
||||
{
|
||||
if (_x != "") then
|
||||
{
|
||||
_player addPrimaryWeaponItem _x;
|
||||
};
|
||||
}
|
||||
forEach (_data select 27);
|
||||
};
|
||||
_handgunWeapon = _data select 22;
|
||||
if (_handgunWeapon != "") then
|
||||
{
|
||||
_player addWeaponGlobal _handgunWeapon;
|
||||
removeAllHandgunItems _player;
|
||||
{
|
||||
if (_x != "") then
|
||||
{
|
||||
_player addHandgunItem _x;
|
||||
};
|
||||
}
|
||||
forEach (_data select 21);
|
||||
};
|
||||
_secondaryWeapon = _data select 28;
|
||||
if (_secondaryWeapon != "") then
|
||||
{
|
||||
_player addWeaponGlobal _secondaryWeapon;
|
||||
{
|
||||
if (_x != "") then
|
||||
{
|
||||
_player addSecondaryWeaponItem _x;
|
||||
};
|
||||
}
|
||||
forEach (_data select 29);
|
||||
};
|
||||
_currentWeapon = _data select 19;
|
||||
if (_currentWeapon != "") then
|
||||
{
|
||||
_player selectWeapon _currentWeapon;
|
||||
};
|
||||
{
|
||||
_player addWeaponItem [_x select 0, [_x select 1, _x select 2, _x select 3]];
|
||||
}
|
||||
forEach (_data select 25);
|
||||
_uniform = _data select 30;
|
||||
_vest = _data select 34;
|
||||
_backpack = _data select 15;
|
||||
if (_uniform != "") then
|
||||
{
|
||||
_player forceAddUniform _uniform;
|
||||
};
|
||||
if (_vest != "") then
|
||||
{
|
||||
_player addVest _vest;
|
||||
};
|
||||
if (_backpack != "") then
|
||||
{
|
||||
_player addBackpackGlobal _backpack;
|
||||
};
|
||||
_uniformContainer = uniformContainer _player;
|
||||
if !(isNil "_uniformContainer") then
|
||||
{
|
||||
{
|
||||
_uniformContainer addWeaponCargoGlobal _x;
|
||||
}
|
||||
forEach (_data select 33);
|
||||
{
|
||||
_uniformContainer addMagazineAmmoCargo [_x select 0, 1, _x select 1];
|
||||
}
|
||||
forEach (_data select 32);
|
||||
{
|
||||
_uniformContainer addItemCargoGlobal _x;
|
||||
}
|
||||
forEach (_data select 31);
|
||||
};
|
||||
_vestContainer = vestContainer _player;
|
||||
if !(isNil "_vestContainer") then
|
||||
{
|
||||
{
|
||||
_vestContainer addWeaponCargoGlobal _x;
|
||||
}
|
||||
forEach (_data select 37);
|
||||
{
|
||||
_vestContainer addMagazineAmmoCargo [_x select 0, 1, _x select 1];
|
||||
}
|
||||
forEach (_data select 36);
|
||||
{
|
||||
_vestContainer addItemCargoGlobal _x;
|
||||
}
|
||||
forEach (_data select 35);
|
||||
};
|
||||
_backpackContainer = backpackContainer _player;
|
||||
if !(isNil "_backpackContainer") then
|
||||
{
|
||||
{
|
||||
_backpackContainer addWeaponCargoGlobal _x;
|
||||
}
|
||||
forEach (_data select 18);
|
||||
{
|
||||
_backpackContainer addMagazineAmmoCargo [_x select 0, 1, _x select 1];
|
||||
}
|
||||
forEach (_data select 17);
|
||||
{
|
||||
_backpackContainer addItemCargoGlobal _x;
|
||||
}
|
||||
forEach (_data select 16);
|
||||
};
|
||||
_assignedItems = _data select 14;
|
||||
if !(_assignedItems isEqualTo []) then
|
||||
{
|
||||
{
|
||||
_player linkItem _x;
|
||||
}
|
||||
forEach _assignedItems;
|
||||
};
|
||||
_player addMPEventHandler ["MPKilled", {_this call ExileServer_object_player_event_onMpKilled}];
|
||||
if((canTriggerDynamicSimulation _player) isEqualTo false) then
|
||||
{
|
||||
_player triggerDynamicSimulation true;
|
||||
};
|
||||
if (getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "thermalVision") isEqualTo 0) then
|
||||
{
|
||||
_player addEventHandler ["WeaponAssembled", {(_this select 1) disableTIEquipment true;}];
|
||||
};
|
||||
[
|
||||
_sessionID,
|
||||
"loadPlayerResponse",
|
||||
[
|
||||
(netId _player),
|
||||
str (_player getVariable ["ExileScore", 0]),
|
||||
(_player getVariable ["ExileKills", 0]),
|
||||
(_player getVariable ["ExileDeaths", 0]),
|
||||
(_player getVariable ["ExileHunger", 100]),
|
||||
(_player getVariable ["ExileThirst", 100]),
|
||||
(_player getVariable ["ExileAlcohol", 0]),
|
||||
(_player getVariable ["ExileClanData", []]),
|
||||
(_player getVariable ["ExileTemperature", 0]),
|
||||
(_player getVariable ["ExileWetness", 0])
|
||||
]
|
||||
]
|
||||
call ExileServer_system_network_send_to;
|
||||
[_sessionID, _player] call ExileServer_system_session_update;
|
||||
true
|
@ -0,0 +1,207 @@
|
||||
/**
|
||||
* ExileServer_object_player_event_onMpKilled
|
||||
*
|
||||
* 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["_victim", "_killer", "_instigator", "_countDeath", "_countKill", "_killSummary", "_killingPlayer", "_killType", "_oldVictimRespect", "_newVictimRespect", "_oldKillerRespect", "_newKillerRespect", "_unknownReasons", "_systemChat", "_modifyVictimRespect", "_respectLoss", "_perks", "_minRespectTransfer", "_respectTransfer", "_perkNames", "_killerStatsNeedUpdate", "_newKillerFrags", "_victimStatsNeedUpdate", "_newVictimDeaths", "_victimPosition"];
|
||||
_victim = _this select 0;
|
||||
_killer = _this select 1;
|
||||
_instigator = _this select 2;
|
||||
if (!isServer || hasInterface || isNull _victim) exitWith {};
|
||||
_victim setVariable ["ExileDiedAt", time];
|
||||
if !(isPlayer _victim) exitWith {};
|
||||
_victim setVariable ["ExileIsDead", true];
|
||||
_victim setVariable ["ExileName", name _victim, true];
|
||||
_countDeath = false;
|
||||
_countKill = false;
|
||||
_killSummary = [];
|
||||
_killingPlayer = _killer call ExileServer_util_getFragKiller;
|
||||
_killType = [_victim, _killer, _killingPlayer, _instigator] call ExileServer_util_getFragType;
|
||||
_oldVictimRespect = _victim getVariable ["ExileScore", 0];
|
||||
_newVictimRespect = _oldVictimRespect;
|
||||
_oldKillerRespect = 0;
|
||||
if !(isNull _killingPlayer) then
|
||||
{
|
||||
_oldKillerRespect = _killingPlayer getVariable ["ExileScore", 0];
|
||||
};
|
||||
_newKillerRespect = _oldKillerRespect;
|
||||
switch (_killType) do
|
||||
{
|
||||
default
|
||||
{
|
||||
_unknownReasons =
|
||||
[
|
||||
"%1 died because... Arma.",
|
||||
"%1 died because the universe hates him.",
|
||||
"%1 died a mysterious death.",
|
||||
"%1 died and nobody knows why.",
|
||||
"%1 died because that's why.",
|
||||
"%1 died because %1 was very unlucky.",
|
||||
"%1 died due to Arma bugs and is probably very salty right now.",
|
||||
"%1 died an awkward death.",
|
||||
"%1 died. Yes, %1 is dead. Like really dead-dead."
|
||||
];
|
||||
_countDeath = true;
|
||||
_systemChat = format [selectRandom _unknownReasons, name _victim];
|
||||
_newVictimRespect = _oldVictimRespect - round ((abs _oldVictimRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "unlucky")));
|
||||
};
|
||||
case 1:
|
||||
{
|
||||
_countDeath = true;
|
||||
_modifyVictimRespect = true;
|
||||
_systemChat = format ["%1 commited suicide!", name _victim];
|
||||
_newVictimRespect = _oldVictimRespect - round ((abs _oldVictimRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "suicide")));
|
||||
};
|
||||
case 2:
|
||||
{
|
||||
_countDeath = true;
|
||||
_countKill = false;
|
||||
_systemChat = format ["%1 died while playing Russian Roulette!", name _victim];
|
||||
_newVictimRespect = _oldVictimRespect;
|
||||
_victim call ExileServer_system_russianRoulette_event_onPlayerDied;
|
||||
};
|
||||
case 3:
|
||||
{
|
||||
_countDeath = true;
|
||||
_countKill = false;
|
||||
_systemChat = format ["%1 crashed to death!", name _victim];
|
||||
_newVictimRespect = _oldVictimRespect - round ((abs _oldVictimRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "crash")));
|
||||
};
|
||||
case 4:
|
||||
{
|
||||
_countDeath = true;
|
||||
_countKill = false;
|
||||
_systemChat = format ["%1 was killed by an NPC!", name _victim];
|
||||
_newVictimRespect = _oldVictimRespect - round ((abs _oldVictimRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "npc")));
|
||||
};
|
||||
case 5:
|
||||
{
|
||||
_countDeath = false;
|
||||
_countKill = false;
|
||||
_systemChat = format ["%1 was team-killed by %2!", name _victim, name _killingPlayer];
|
||||
_respectLoss = round ((abs _oldKillerRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "friendyFire")));
|
||||
_newKillerRespect = _oldKillerRespect - _respectLoss;
|
||||
_killSummary pushBack ["FRIENDLY FIRE", -1 * _respectLoss];
|
||||
};
|
||||
case 6:
|
||||
{
|
||||
_countDeath = false;
|
||||
_countKill = false;
|
||||
_systemChat = format ["%1 was killed by %2! (BAMBI SLAYER)", name _victim, name _killingPlayer];
|
||||
_respectLoss = round ((abs _oldKillerRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "bambiKill")));
|
||||
_newKillerRespect = _oldKillerRespect - _respectLoss;
|
||||
_killSummary pushBack ["BAMBI SLAYER", -1 * _respectLoss];
|
||||
};
|
||||
case 7:
|
||||
{
|
||||
_countDeath = true;
|
||||
_countKill = true;
|
||||
_perks = [_victim, _killer, _killingPlayer] call ExileServer_util_getFragPerks;
|
||||
_minRespectTransfer = getNumber (configFile >> "CfgSettings" >> "Respect" >> "minRespectTransfer");
|
||||
_respectTransfer = round ((abs _oldVictimRespect) / 100 * (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Percentages" >> "frag")));
|
||||
if (_respectTransfer < _minRespectTransfer) then
|
||||
{
|
||||
_respectTransfer = _minRespectTransfer;
|
||||
};
|
||||
_newVictimRespect = _oldVictimRespect - _respectTransfer;
|
||||
_newKillerRespect = _oldKillerRespect + _respectTransfer;
|
||||
_killSummary pushBack ["ENEMY FRAGGED", _respectTransfer];
|
||||
if (_perks isEqualTo []) then
|
||||
{
|
||||
_systemChat = format ["%1 was killed by %2!", name _victim, name _killingPlayer];
|
||||
}
|
||||
else
|
||||
{
|
||||
_perkNames = [];
|
||||
{
|
||||
_perkNames pushBack (_x select 0);
|
||||
_killSummary pushBack _x;
|
||||
_newKillerRespect = _newKillerRespect + (_x select 1);
|
||||
}
|
||||
forEach _perks;
|
||||
_systemChat = format ["%1 was killed by %2! (%3)", name _victim, name _killingPlayer, _perkNames joinString ", "];
|
||||
};
|
||||
};
|
||||
};
|
||||
if !(isNull _killingPlayer) then
|
||||
{
|
||||
if !(_killSummary isEqualTo []) then
|
||||
{
|
||||
[_killingPlayer, "showFragRequest", [_killSummary]] call ExileServer_system_network_send_to;
|
||||
};
|
||||
};
|
||||
if !(isNull _killingPlayer) then
|
||||
{
|
||||
_killerStatsNeedUpdate = false;
|
||||
if (_countKill) then
|
||||
{
|
||||
_newKillerFrags = _killingPlayer getVariable ["ExileKills", 0];
|
||||
_newKillerFrags = _newKillerFrags + 1;
|
||||
_killerStatsNeedUpdate = true;
|
||||
_killingPlayer setVariable ["ExileKills", _newKillerFrags];
|
||||
format["addAccountKill:%1", getPlayerUID _killingPlayer] call ExileServer_system_database_query_fireAndForget;
|
||||
};
|
||||
if !(_newKillerRespect isEqualTo _oldKillerRespect) then
|
||||
{
|
||||
_killingPlayer setVariable ["ExileScore", _newKillerRespect];
|
||||
_killerStatsNeedUpdate = true;
|
||||
format["setAccountScore:%1:%2", _newKillerRespect, getPlayerUID _killingPlayer] call ExileServer_system_database_query_fireAndForget;
|
||||
};
|
||||
if (_killerStatsNeedUpdate) then
|
||||
{
|
||||
_killingPlayer call ExileServer_object_player_sendStatsUpdate;
|
||||
};
|
||||
};
|
||||
_victimStatsNeedUpdate = false;
|
||||
if (_countDeath) then
|
||||
{
|
||||
_newVictimDeaths = _victim getVariable ["ExileDeaths", 0];
|
||||
_newVictimDeaths = _newVictimDeaths + 1;
|
||||
_victim setVariable ["ExileDeaths", _newVictimDeaths];
|
||||
_victimStatsNeedUpdate = true;
|
||||
format["addAccountDeath:%1", getPlayerUID _victim] call ExileServer_system_database_query_fireAndForget;
|
||||
};
|
||||
if !(_newVictimRespect isEqualTo _oldVictimRespect) then
|
||||
{
|
||||
_victim setVariable ["ExileScore", _newVictimRespect];
|
||||
_victimStatsNeedUpdate = true;
|
||||
format["setAccountScore:%1:%2", _newVictimRespect, getPlayerUID _victim] call ExileServer_system_database_query_fireAndForget;
|
||||
};
|
||||
if (_victimStatsNeedUpdate) then
|
||||
{
|
||||
_victim call ExileServer_object_player_sendStatsUpdate;
|
||||
};
|
||||
if ((vehicle _victim) isEqualTo _victim) then
|
||||
{
|
||||
if !(underwater _victim) then
|
||||
{
|
||||
if !(_victim call ExileClient_util_world_isInTraderZone) then
|
||||
{
|
||||
_victim call ExileServer_object_flies_spawn;
|
||||
};
|
||||
};
|
||||
};
|
||||
if !(_systemChat isEqualTo "") then
|
||||
{
|
||||
if ((getNumber (configFile >> "CfgSettings" >> "KillFeed" >> "showKillFeed")) isEqualTo 1) then
|
||||
{
|
||||
["systemChatRequest", [_systemChat]] call ExileServer_system_network_send_broadcast;
|
||||
};
|
||||
};
|
||||
if !(_systemChat isEqualTo "") then
|
||||
{
|
||||
if ((getNumber (configFile >> "CfgSettings" >> "Logging" >> "deathLogging")) isEqualTo 1) then
|
||||
{
|
||||
"extDB3" callExtension format["1:DEATH:%1", _systemChat];
|
||||
};
|
||||
};
|
||||
_victimPosition = getPos _victim;
|
||||
format["insertPlayerHistory:%1:%2:%3:%4:%5", getPlayerUID _victim, name _victim, _victimPosition select 0, _victimPosition select 1, _victimPosition select 2] call ExileServer_system_database_query_fireAndForget;
|
||||
format["deletePlayer:%1", _victim getVariable ["ExileDatabaseId", -1]] call ExileServer_system_database_query_fireAndForget;
|
||||
true
|
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* ExileServer_object_vehicle_createNonPersistentVehicle
|
||||
*
|
||||
* 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["_className", "_position", "_direction", "_usePositionATL", "_vehicleObject"];
|
||||
_className = _this select 0;
|
||||
_position = _this select 1;
|
||||
_direction = _this select 2;
|
||||
_usePositionATL = _this select 3;
|
||||
_vehicleObject = [_className, _position, _direction, _usePositionATL] call ExileServer_object_vehicle_carefulCreateVehicle;
|
||||
_vehicleObject setVariable ["ExileIsPersistent", false];
|
||||
_vehicleObject addEventHandler ["GetIn", {_this call ExileServer_object_vehicle_event_onGetIn}];
|
||||
_vehicleObject addMPEventHandler ["MPKilled", { if !(isServer) exitWith {}; _this call ExileServer_object_vehicle_event_onMPKilled;}];
|
||||
_vehicleObject call ExileServer_system_simulationMonitor_addVehicle;
|
||||
_vehicleObject
|
@ -0,0 +1,25 @@
|
||||
/**
|
||||
* ExileServer_object_vehicle_createPersistentVehicle
|
||||
*
|
||||
* 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["_className", "_position", "_direction", "_usePositionATL", "_pinCode", "_vehicleObject"];
|
||||
_className = _this select 0;
|
||||
_position = _this select 1;
|
||||
_direction = _this select 2;
|
||||
_usePositionATL = _this select 3;
|
||||
_pinCode = _this select 4;
|
||||
_vehicleObject = [_className, _position, _direction, _usePositionATL] call ExileServer_object_vehicle_carefulCreateVehicle;
|
||||
_vehicleObject setVariable ["ExileIsPersistent", true];
|
||||
_vehicleObject setVariable ["ExileAccessCode", _pinCode];
|
||||
_vehicleObject addEventHandler ["GetOut", {_this call ExileServer_object_vehicle_event_onGetOut}];
|
||||
_vehicleObject addEventHandler ["GetIn", {_this call ExileServer_object_vehicle_event_onGetIn}];
|
||||
_vehicleObject addMPEventHandler ["MPKilled", { if !(isServer) exitWith {}; _this call ExileServer_object_vehicle_event_onMPKilled;}];
|
||||
_vehicleObject call ExileServer_system_simulationMonitor_addVehicle;
|
||||
_vehicleObject
|
@ -0,0 +1,106 @@
|
||||
/**
|
||||
* ExileServer_object_vehicle_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["_vehicleID", "_data", "_position", "_vectorDirection", "_vectorUp", "_pinCode", "_texture", "_vehicleObject", "_lock", "_unlockInSafeZonesAfterRestart", "_isLocked", "_hitpoints", "_cargoContainers"];
|
||||
_vehicleID = _this;
|
||||
_data = format ["loadVehicle:%1", _vehicleID] call ExileServer_system_database_query_selectSingle;
|
||||
_position = [_data select 8, _data select 9, _data select 10];
|
||||
_vectorDirection = [_data select 11, _data select 12, _data select 13];
|
||||
_vectorUp = [_data select 14, _data select 15, _data select 16];
|
||||
_pinCode = _data select 20;
|
||||
_texture = _data select 21;
|
||||
try
|
||||
{
|
||||
if !((vectorMagnitude _vectorUp) isEqualTo 1) then
|
||||
{
|
||||
throw true;
|
||||
};
|
||||
if ((_vectorUp select 0) > 0.95) then
|
||||
{
|
||||
throw true;
|
||||
};
|
||||
if ((_vectorUp select 1) > 0.95) then
|
||||
{
|
||||
throw true;
|
||||
};
|
||||
if ((_vectorUp select 2) isEqualTo 0) then
|
||||
{
|
||||
throw true;
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
_vectorUp = [0, 0, 1];
|
||||
};
|
||||
_vehicleObject = [(_data select 1), _position, [_vectorDirection, _vectorUp], true,_pinCode] call ExileServer_object_vehicle_createPersistentVehicle;
|
||||
_vehicleObject setVariable ["ExileDatabaseID", _vehicleID];
|
||||
_vehicleObject setVariable ["ExileOwnerUID", (_data select 3)];
|
||||
_vehicleObject setVariable ["ExileMoney", (_data select 23), true];
|
||||
_lock = (_data select 4);
|
||||
_unlockInSafeZonesAfterRestart = (getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "unlockInSafeZonesAfterRestart")) isEqualTo 1;
|
||||
_isLocked = (_lock isEqualTo -1);
|
||||
if (_isLocked) then
|
||||
{
|
||||
if (_unlockInSafeZonesAfterRestart) then
|
||||
{
|
||||
if (_position call ExileClient_util_world_isInTraderZone) then
|
||||
{
|
||||
_isLocked = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
if (_isLocked) then
|
||||
{
|
||||
_vehicleObject setVariable ["ExileIsLocked", -1];
|
||||
_vehicleObject lock 2;
|
||||
_vehicleObject enableRopeAttach false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_vehicleObject setVariable ["ExileIsLocked", 0];
|
||||
_vehicleObject lock 0;
|
||||
_vehicleObject enableRopeAttach true;
|
||||
};
|
||||
_vehicleObject setFuel (_data select 5);
|
||||
_vehicleObject setDamage (_data select 6);
|
||||
_hitpoints = _data select 7;
|
||||
if ((typeName _hitpoints) isEqualTo "ARRAY") then
|
||||
{
|
||||
{
|
||||
_vehicleObject setHitPointDamage [_x select 0, _x select 1];
|
||||
}
|
||||
forEach _hitpoints;
|
||||
};
|
||||
[_vehicleObject, (_data select 17)] call ExileServer_util_fill_fillItems;
|
||||
[_vehicleObject, (_data select 18)] call ExileServer_util_fill_fillMagazines;
|
||||
[_vehicleObject, (_data select 19)] call ExileServer_util_fill_fillWeapons;
|
||||
_cargoContainers = format ["loadVehicleContainer:%1", _vehicleID] call ExileServer_system_database_query_selectSingle;
|
||||
if ((typeName _cargoContainers) isEqualTo "ARRAY") then
|
||||
{
|
||||
if !(_cargoContainers isEqualTo []) then
|
||||
{
|
||||
[_vehicleObject, (_cargoContainers select 0)] call ExileServer_util_fill_fillContainers;
|
||||
};
|
||||
};
|
||||
if !(_texture isEqualTo "") then
|
||||
{
|
||||
{
|
||||
_vehicleObject setObjectTextureGlobal [_forEachIndex, _texture select _forEachIndex];
|
||||
}
|
||||
forEach _texture;
|
||||
};
|
||||
_vehicleObject enableSimulationGlobal false;
|
||||
_vehicleObject call ExileServer_system_simulationMonitor_addVehicle;
|
||||
if (_vehicleObject call ExileClient_util_world_isInTraderZone) then
|
||||
{
|
||||
_vehicleObject allowDamage false;
|
||||
};
|
||||
_vehicleObject
|
@ -0,0 +1,63 @@
|
||||
/**
|
||||
* ExileServer_system_database_connect
|
||||
*
|
||||
* 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["_isConnected","_error","_result"];
|
||||
_isConnected = false;
|
||||
_error_locked = false;
|
||||
ExileServerDatabaseSessionId = "";
|
||||
ExileServerRconSessionID = "";
|
||||
try
|
||||
{
|
||||
_result = "extDB3" callExtension "9:VERSION";
|
||||
format ["Installed extDB3 version: %1", _result] call ExileServer_util_log;
|
||||
if ((parseNumber _result) < 1.027) then
|
||||
{
|
||||
throw format ["Error Required extDB3 Version 1.027 or higher: %1", _result];
|
||||
};
|
||||
_result = parseSimpleArray ("extDB3" callExtension "9:ADD_DATABASE:exile");
|
||||
if (_result select 0 isEqualTo 0) then
|
||||
{
|
||||
throw format ["Could not add database: %1", _result];
|
||||
};
|
||||
"Connected to database!" call ExileServer_util_log;
|
||||
ExileServerDatabaseSessionId = "SQL"; //str(round(random(999999)));
|
||||
_result = parseSimpleArray ("extDB3" callExtension "9:ADD_DATABASE_PROTOCOL:exile:SQL_CUSTOM:SQL:exile.ini");
|
||||
if ((_result select 0) isEqualTo 0) then
|
||||
{
|
||||
throw format ["Failed to initialize database protocol: %1", _result];
|
||||
};
|
||||
ExileServerStartTime = (parseSimpleArray ("extDB3" callExtension "9:LOCAL_TIME")) select 1;
|
||||
"Database protocol initialized!" call ExileServer_util_log;
|
||||
"extDB3" callExtension "9:ADD_PROTOCOL:LOG:TRADING:Exile_TradingLog";
|
||||
"extDB3" callExtension "9:ADD_PROTOCOL:LOG:DEATH:Exile_DeathLog";
|
||||
"extDB3" callExtension "9:ADD_PROTOCOL:LOG:TERRITORY:Exile_TerritoryLog";
|
||||
"extDB3" callExtension "9:LOCK";
|
||||
_isConnected = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (!_error_locked) then
|
||||
{
|
||||
"MySQL connection error!" call ExileServer_util_log;
|
||||
"Make sure [Database] in the extdb3-conf.ini is set to [exile] unless you have a different database setup!!!!!" call ExileServer_util_log;
|
||||
"Please have a look at @extDB3/logs/ to find out what went wrong." call ExileServer_util_log;
|
||||
format ["MySQL Error: %1", _exception] call ExileServer_util_log;
|
||||
"Server will shutdown now :(" call ExileServer_util_log;
|
||||
'#shutdown' call ExileServer_system_rcon_event_sendCommand;
|
||||
//"extDB3" callExtension "9:SHUTDOWN"; Not implemented in extDB3
|
||||
}
|
||||
else
|
||||
{
|
||||
format ["extDB3: %1", _exception] call ExileServer_util_log;
|
||||
"Check your server rpt for errors, your mission might be stuck a loop restarting" call ExileServer_util_log;
|
||||
};
|
||||
};
|
||||
_isConnected
|
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* ExileServer_system_database_handleBig
|
||||
*
|
||||
* 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["_key", "_result", "_pipe"];
|
||||
_key = _this;
|
||||
_result = "";
|
||||
while{true} do
|
||||
{
|
||||
_pipe = "extDB3" callExtension format["5:%1", _key];
|
||||
if(_pipe isEqualTo "") exitWith {};
|
||||
_result = _result + _pipe;
|
||||
};
|
||||
call (compile _result)
|
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* ExileServer_system_database_query_fireAndForget
|
||||
*
|
||||
* 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["_parameters","_query"];
|
||||
_parameters = _this;
|
||||
_query = [1, "SQL",_parameters] joinString ":";
|
||||
"extDB3" callExtension _query;
|
||||
true
|
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* ExileServer_system_database_query_insertSingle
|
||||
*
|
||||
* 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["_parameters","_query","_result"];
|
||||
_parameters = _this;
|
||||
_query = [0, "SQL",_parameters] joinString ":";
|
||||
_result = parseSimpleArray ("extDB3" callExtension _query);
|
||||
(_result select 1) select 0
|
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* ExileServer_system_database_query_selectFull
|
||||
*
|
||||
* 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["_parameters","_query","_result"];
|
||||
_parameters = _this;
|
||||
_query = [0, "SQL",_parameters] joinString ":";
|
||||
_result = parseSimpleArray ("extDB3" callExtension _query);
|
||||
switch (_result select 0) do
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
(format["Database Error: %1", (_result select 1)]) call ExileServer_util_log;
|
||||
};
|
||||
case 2:
|
||||
{
|
||||
_result = (_result select 1) call ExileServer_system_database_handleBig;
|
||||
};
|
||||
};
|
||||
_result select 1
|
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* ExileServer_system_database_query_selectSingle
|
||||
*
|
||||
* 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["_parameters","_query","_result"];
|
||||
_parameters = _this;
|
||||
_query = [0, "SQL",_parameters] joinString ":";
|
||||
_result = parseSimpleArray ("extDB3" callExtension _query);
|
||||
switch (_result select 0) do
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
(format["Database Error: %1", (_result select 1)]) call ExileServer_util_log;
|
||||
};
|
||||
case 2:
|
||||
{
|
||||
_result = (_result select 1) call ExileServer_system_database_handleBig;
|
||||
};
|
||||
};
|
||||
(_result select 1) select 0
|
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* ExileServer_system_database_query_selectSingleField
|
||||
*
|
||||
* 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["_parameters","_query","_result"];
|
||||
_parameters = _this;
|
||||
_query = [0,"SQL",_parameters] joinString ":";
|
||||
_result = parseSimpleArray ("extDB3" callExtension _query);
|
||||
switch (_result select 0) do
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
(format["Database Error: %1", (_result select 1)]) call ExileServer_util_log;
|
||||
};
|
||||
case 2:
|
||||
{
|
||||
_result = (_result select 1) call ExileServer_system_database_handleBig;
|
||||
};
|
||||
};
|
||||
((_result select 1) select 0) select 0
|
@ -0,0 +1,47 @@
|
||||
/**
|
||||
* ExileServer_system_process_noobFilter
|
||||
*
|
||||
* 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["_arsenal","_weaponClassNames","_className","_linkedItems","_i"];
|
||||
_arsenal = "true" configClasses (missionConfigFile >> "CfgExileArsenal");
|
||||
_weaponClassNames = [];
|
||||
{
|
||||
_className = configName _x;
|
||||
try
|
||||
{
|
||||
if (isClass (configFile >> "CfgWeapons" >> _className >> "LinkedItems")) then
|
||||
{
|
||||
_linkedItems = "true" configClasses (configFile >> "CfgWeapons" >> _className >> "LinkedItems");
|
||||
{
|
||||
if (isText(_x >> "item")) then
|
||||
{
|
||||
if !((getText (_x >> "item")) isEqualTo "") then
|
||||
{
|
||||
throw true;
|
||||
};
|
||||
};
|
||||
}
|
||||
forEach _linkedItems;
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
_weaponClassNames pushBack _className;
|
||||
};
|
||||
}
|
||||
forEach _arsenal;
|
||||
if ((count _weaponClassNames) > 0) then
|
||||
{
|
||||
"Exile Trader/Loottable Config Warning!" call ExileServer_util_log;
|
||||
"You have weapons in your loot tables that spawn with attachments!" call ExileServer_util_log;
|
||||
"This will allow duping and money farming!" call ExileServer_util_log;
|
||||
"To solve this, please remove the following weapons from your loot tables and trader config OR replace them with their non-attachment equivalent:" call ExileServer_util_log;
|
||||
format ["%1", _weaponClassNames] call ExileServer_util_log;
|
||||
};
|
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* ExileServer_system_territory_database_insert
|
||||
*
|
||||
* 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","_territoryName","_flagTexture","_territorySize","_owner","_position","_build","_moderators","_data","_extDB2Message","_territoryID"];
|
||||
_flagObject = _this select 0;
|
||||
_territoryName = _this select 1;
|
||||
_flagTexture = _this select 2;
|
||||
_territorySize = ((getArray(missionConfigFile >> "CfgTerritories" >> "prices")) select 0)select 1;
|
||||
_owner = _flagObject getVariable ["ExileOwnerUID",""];
|
||||
_position = getPosATL _flagObject;
|
||||
_build_rights = _flagObject getVariable ["ExileTerritoryBuildRights",[]];
|
||||
_moderators = _flagObject getVariable ["ExileTerritoryModerators",[]];
|
||||
_data =
|
||||
[
|
||||
_owner,
|
||||
_territoryName,
|
||||
_position select 0,
|
||||
_position select 1,
|
||||
_position select 2,
|
||||
_territorySize,
|
||||
1,
|
||||
_flagTexture,
|
||||
0,
|
||||
_build_rights,
|
||||
_moderators,
|
||||
""
|
||||
];
|
||||
_extDB2Message = ["createTerritory", _data] call ExileServer_util_extDB2_createMessage;
|
||||
_territoryID = _extDB2Message call ExileServer_system_database_query_insertSingle;
|
||||
_flagObject setVariable ["ExileDatabaseID",_territoryID];
|
||||
_flagObject setVariable ["ExileFlagTexture",_flagTexture];
|
||||
true
|
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* ExileServer_system_territory_maintenance_recalculateDueDate
|
||||
*
|
||||
* 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["_flag", "_currentTimestamp", "_flagBuild", "_maintenancePeriod", "_maintenancePeriodDueDate"];
|
||||
_flag = _this;
|
||||
_currentTimestamp = call ExileServer_util_time_currentTime;
|
||||
_flagBuild = _flag getVariable ["ExileTerritoryLastPayed", _currentTimestamp];
|
||||
_maintenancePeriod = getNumber(configFile >> "CfgSettings" >> "GarbageCollector" >> "Database" >> "territoryLifeTime");
|
||||
_maintenancePeriodDueDate = parseSimpleArray ("extDB3" callExtension format["9:DATEADD:%1:[%2,0,0,0]",_flagBuild,_maintenancePeriod]);
|
||||
_flag setVariable ["ExileTerritoryMaintenanceDue", _maintenancePeriodDueDate select 1, true];
|
||||
true
|
@ -0,0 +1,54 @@
|
||||
/**
|
||||
* ExileServer_system_territory_network_flagStolenRequest
|
||||
*
|
||||
* 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","_flag","_playerObject","_databaseID","_level","_flagPosition","_spawnRadius","_weaponHolderPosition","_weaponHolder","_logging","_territoryLog"];
|
||||
_sessionID = _this select 0;
|
||||
_parameters = _this select 1;
|
||||
_flag = _parameters select 0;
|
||||
try
|
||||
{
|
||||
_playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
|
||||
if (isNull _playerObject) then
|
||||
{
|
||||
throw "Player Object NULL";
|
||||
};
|
||||
if ((_flag getVariable ["ExileFlagStolen", 0]) isEqualTo 1) then
|
||||
{
|
||||
throw "Flag already stolen!";
|
||||
};
|
||||
if ((_playerObject distance2D _flag) > 5) then
|
||||
{
|
||||
throw "You are too far away!";
|
||||
};
|
||||
_databaseID = _flag getVariable ["ExileDatabaseID",0];
|
||||
_level = _flag getVariable ["ExileTerritoryLevel",_level];
|
||||
_flagPosition = getPosATL _flag;
|
||||
_flagPosition set[2, 0];
|
||||
_spawnRadius = 3;
|
||||
_weaponHolderPosition = getPosATL _playerObject;
|
||||
_weaponHolder = createVehicle ["GroundWeaponHolder", _weaponHolderPosition, [], 0, "CAN_COLLIDE"];
|
||||
_weaponHolder setPosATL _weaponHolderPosition;
|
||||
_weaponHolder addMagazineCargoGlobal [format["Exile_Item_FlagStolen%1", _level], 1];
|
||||
_flag setVariable ["ExileFlagStolen", 1, true];
|
||||
format["flagStolen:%1:%2",getPlayerUID _playerObject,_databaseID] call ExileServer_system_database_query_fireAndForget;
|
||||
_logging = getNumber(configFile >> "CfgSettings" >> "Logging" >> "territoryLogging");
|
||||
if (_logging isEqualTo 1) then
|
||||
{
|
||||
_territoryLog = format ["PLAYER ( %1 ) %2 STOLE A LEVEL %3 FLAG FROM TERRITORY #%4",getPlayerUID _playerObject,_playerObject,_level,_databaseID];
|
||||
"extDB3" callExtension format["1:TERRITORY:%1",_territoryLog];
|
||||
};
|
||||
_flag call ExileServer_system_xm8_sendFlagStolen;
|
||||
}
|
||||
catch
|
||||
{
|
||||
[_sessionID, "toastRequest", ["ErrorTitleAndText", ["Failed to steal!", _exception]]] call ExileServer_system_network_send_to;
|
||||
};
|
||||
true
|
@ -0,0 +1,79 @@
|
||||
/**
|
||||
* ExileServer_system_territory_network_payFlagRansomRequest
|
||||
*
|
||||
* 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","_flagNetID","_flag","_playerObject","_buildRights","_playerUID","_level","_itemClassName","_flagFee","_playerMoney","_logging","_databaseID","_territoryLog"];
|
||||
_sessionID = _this select 0;
|
||||
_parameters = _this select 1;
|
||||
_flagNetID = _parameters select 0;
|
||||
try
|
||||
{
|
||||
_flag = objectFromNetid _flagNetID;
|
||||
if (isNull _flag) then
|
||||
{
|
||||
throw "Territory not found!";
|
||||
};
|
||||
if ((_flag getVariable ["ExileFlagStolen", 1]) isEqualTo 0) then
|
||||
{
|
||||
throw "Flag not stolen!";
|
||||
};
|
||||
_playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
|
||||
if (isNull _playerObject) then
|
||||
{
|
||||
throw "You do not exist!";
|
||||
};
|
||||
if !(alive _playerObject) then
|
||||
{
|
||||
throw "You are dead!";
|
||||
};
|
||||
_buildRights = _flag getVariable ["ExileTerritoryBuildRights", []];
|
||||
_playerUID = getPlayerUID _playerObject;
|
||||
if !(_playerUID in _buildRights) then
|
||||
{
|
||||
throw "Missing build rights!";
|
||||
};
|
||||
_level = _flag getVariable ["ExileTerritoryLevel", 0];
|
||||
_itemClassName = format["Exile_Item_FlagStolen%1", _level];
|
||||
if !(isClass (missionConfigFile >> "CfgExileArsenal" >> _itemClassName) ) then
|
||||
{
|
||||
throw "Flag price not found!";
|
||||
};
|
||||
_flagFee = getNumber (missionConfigFile >> "CfgExileArsenal" >> _itemClassName >> "price");
|
||||
if (_flagFee <= 0) then
|
||||
{
|
||||
throw "Invalid flag price!";
|
||||
};
|
||||
_playerMoney = _playerObject getVariable ["ExileMoney", 0];
|
||||
if (_playerMoney < _flagFee) then
|
||||
{
|
||||
throw "You are too poor!";
|
||||
};
|
||||
if !(_playerObject canAdd _itemClassName) then
|
||||
{
|
||||
throw "Inventory is full!";
|
||||
};
|
||||
_playerMoney = _playerMoney - _flagFee;
|
||||
_playerObject setVariable ["ExileMoney", _playerMoney, true];
|
||||
format ["setPlayerMoney:%1:%2", _playerMoney, _playerObject getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
|
||||
_playerObject addItem _itemClassName;
|
||||
_logging = getNumber(configFile >> "CfgSettings" >> "Logging" >> "territoryLogging");
|
||||
if (_logging isEqualTo 1) then
|
||||
{
|
||||
_databaseID = _flag getVariable ["ExileDatabaseID",0];
|
||||
_territoryLog = format ["PLAYER ( %1 ) %2 PAID %3 POP TABS FOR THE RANSOM OF TERRITORY #%4 | PLAYER TOTAL POP TABS: %5", _playerUID, _playerObject, _flagFee, _databaseID, _playerMoney];
|
||||
"extDB3" callExtension format["1:TERRITORY:%1", _territoryLog];
|
||||
};
|
||||
[_sessionID, "toastRequest", ["SuccessTitleOnly", ["Random paid!"]]] call ExileServer_system_network_send_to;
|
||||
}
|
||||
catch
|
||||
{
|
||||
[_sessionID, "toastRequest", ["ErrorTitleAndText", ["Failed to pay!", _exception]]] call ExileServer_system_network_send_to;
|
||||
};
|
||||
true
|
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* ExileServer_system_territory_network_payTerritoryProtectionMoneyRequest
|
||||
*
|
||||
* 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","_flagNetID","_playerObject","_flagObject","_flagStolen","_territoryDatabaseID","_radius","_level","_objectsInTerritory","_popTabAmountPerObject","_totalPopTabAmount","_playerPopTabs","_currentTimestamp","_logging","_territoryLog"];
|
||||
_sessionID = _this select 0;
|
||||
_parameters = _this select 1;
|
||||
_flagNetID = _parameters select 0;
|
||||
try
|
||||
{
|
||||
_playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
|
||||
if (isNull _playerObject) then
|
||||
{
|
||||
throw "Invalid player object";
|
||||
};
|
||||
_flagObject = objectFromNetId _flagNetID;
|
||||
if (isNull _flagObject) then
|
||||
{
|
||||
throw "Invalid flag object";
|
||||
};
|
||||
_flagStolen = _flagObject getVariable ["ExileFlagStolen", 0];
|
||||
if (_flagStolen isEqualTo 1) then
|
||||
{
|
||||
throw "Flag stolen!";
|
||||
};
|
||||
_territoryDatabaseID = _flagObject getVariable ["ExileDatabaseID", 0];
|
||||
_radius = _flagObject getVariable ["ExileTerritorySize", 15];
|
||||
_level = _flagObject getVariable ["ExileTerritoryLevel", 1];
|
||||
_objectsInTerritory = _flagObject getVariable ["ExileTerritoryNumberOfConstructions", 0];
|
||||
_popTabAmountPerObject = getNumber (missionConfigFile >> "CfgTerritories" >> "popTabAmountPerObject");
|
||||
_totalPopTabAmount = _level * _popTabAmountPerObject * _objectsInTerritory;
|
||||
_playerPopTabs = _playerObject getVariable ["ExileMoney", 0];
|
||||
if (_playerPopTabs < _totalPopTabAmount) then
|
||||
{
|
||||
throw "You do not have enough pop tabs!";
|
||||
};
|
||||
_playerPopTabs = _playerPopTabs - _totalPopTabAmount;
|
||||
_playerObject setVariable ["ExileMoney", _playerPopTabs, true];
|
||||
format["setPlayerMoney:%1:%2", _playerPopTabs, _playerObject getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
|
||||
_currentTimestamp = call ExileServer_util_time_currentTime;
|
||||
_flagObject setVariable ["ExileTerritoryLastPayed", _currentTimestamp];
|
||||
_flagObject call ExileServer_system_territory_maintenance_recalculateDueDate;
|
||||
format["maintainTerritory:%1", _territoryDatabaseID] call ExileServer_system_database_query_fireAndForget;
|
||||
[_sessionID, "toastRequest", ["SuccessTitleOnly", ["Protection money paid!"]]] call ExileServer_system_network_send_to;
|
||||
_logging = getNumber(configFile >> "CfgSettings" >> "Logging" >> "territoryLogging");
|
||||
if (_logging isEqualTo 1) then
|
||||
{
|
||||
_territoryLog = format ["PLAYER ( %1 ) %2 PAID %3 POP TABS TO PROTECT TERRITORY #%4 | PLAYER TOTAL POP TABS: %5",getPlayerUID _playerObject,_playerObject,_totalPopTabAmount,_territoryDatabaseID,_playerPopTabs];
|
||||
"extDB3" callExtension format["1:TERRITORY:%1",_territoryLog];
|
||||
};
|
||||
_flagObject call ExileServer_system_xm8_sendProtectionMoneyPaid;
|
||||
}
|
||||
catch
|
||||
{
|
||||
[_sessionID, "toastRequest", ["ErrorTitleAndText", ["Failed to pay!", _exception]]] call ExileServer_system_network_send_to;
|
||||
_exception call ExileServer_util_log;
|
||||
};
|
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* ExileServer_system_territory_network_purchaseTerritory
|
||||
*
|
||||
* 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","_player","_price","_playerMoney","_logging","_territoryLog"];
|
||||
_sessionID = _this select 0;
|
||||
try
|
||||
{
|
||||
_player = _sessionID call ExileServer_system_session_getPlayerObject;
|
||||
if (isNull _player) then
|
||||
{
|
||||
throw 1;
|
||||
};
|
||||
if !(alive _player) then
|
||||
{
|
||||
throw 2;
|
||||
};
|
||||
_price = ((getArray(missionConfigFile >> "CfgTerritories" >> "prices")) select 0) select 0;
|
||||
_playerMoney = _player getVariable ["ExileMoney", 0];
|
||||
if (_price > _playerMoney) then
|
||||
{
|
||||
throw 3;
|
||||
};
|
||||
_playerMoney = _playerMoney - _price;
|
||||
_player setVariable ["ExileMoney", _playerMoney, true];
|
||||
format["setPlayerMoney:%1:%2", _playerMoney, _player getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
|
||||
[_sessionID, "purchaseTerritoryResponse" , [0]] call ExileServer_system_network_send_to;
|
||||
_logging = getNumber(configFile >> "CfgSettings" >> "Logging" >> "territoryLogging");
|
||||
if (_logging isEqualTo 1) then
|
||||
{
|
||||
_territoryLog = format ["PLAYER ( %1 ) %2 PAID %3 POP TABS TO PURCHASE A TERRITORY FLAG | PLAYER TOTAL POP TABS: %4",getPlayerUID _player,_player,_price,_playerMoney];
|
||||
"extDB3" callExtension format["1:TERRITORY:%1",_territoryLog];
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
[_sessionID, "purchaseTerritoryResponse" , [_exception]] call ExileServer_system_network_send_to;
|
||||
};
|
||||
true
|
@ -0,0 +1,71 @@
|
||||
/**
|
||||
* ExileServer_system_territory_network_restoreFlagRequest
|
||||
*
|
||||
* 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","_flagNetID","_flag","_playerObject","_buildRights","_playerUID","_level","_itemClassName","_territoryDatabaseID","_flagTexture","_logging"];
|
||||
_sessionID = _this select 0;
|
||||
_parameters = _this select 1;
|
||||
_flagNetID = _parameters select 0;
|
||||
try
|
||||
{
|
||||
_flag = objectFromNetid _flagNetID;
|
||||
if (isNull _flag) then
|
||||
{
|
||||
throw "Territory not found!";
|
||||
};
|
||||
if ((_flag getVariable ["ExileFlagStolen", 1]) isEqualTo 0) then
|
||||
{
|
||||
throw "Flag is not stolen!";
|
||||
};
|
||||
_playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
|
||||
if (isNull _playerObject) then
|
||||
{
|
||||
throw "You do not exist!";
|
||||
};
|
||||
if !(alive _playerObject) then
|
||||
{
|
||||
throw "You are dead! Didn't you know that?";
|
||||
};
|
||||
if ((_playerObject distance2D _flag) > 4) then
|
||||
{
|
||||
throw "You are too far away.";
|
||||
};
|
||||
_buildRights = _flag getVariable ["ExileTerritoryBuildRights", []];
|
||||
_playerUID = getPlayerUID _playerObject;
|
||||
if !(_playerUID in _buildRights) then
|
||||
{
|
||||
throw "Missing build rights.";
|
||||
};
|
||||
_level = _flag getVariable ["ExileTerritoryLevel", 0];
|
||||
_itemClassName = format["Exile_Item_FlagStolen%1", _level];
|
||||
if !(_itemClassName in (magazines _playerObject)) then
|
||||
{
|
||||
throw format ["You need a level %1 flag.", _level];
|
||||
};
|
||||
_playerObject removeItem _itemClassName;
|
||||
_territoryDatabaseID = _flag getVariable ["ExileDatabaseID", 0];
|
||||
format["flagRestore:%1", _territoryDatabaseID] call ExileServer_system_database_query_fireAndForget;
|
||||
_flag setVariable ["ExileFlagStolen", 0, true];
|
||||
_flag setFlagOwner objNull;
|
||||
_flagTexture = _flag getVariable "ExileFlagTexture";
|
||||
_flag setFlagTexture _flagTexture;
|
||||
_logging = getNumber(configFile >> "CfgSettings" >> "Logging" >> "territoryLogging");
|
||||
if (_logging isEqualTo 1) then
|
||||
{
|
||||
"extDB3" callExtension format ["1:TERRITORY:PLAYER ( %1 ) %2 RESTORED THE FLAG OF TERRITORY #%3", _playerUID, _playerObject, _territoryDatabaseID];
|
||||
};
|
||||
[_sessionID, "toastRequest", ["SuccessTitleAndText", ["Flag has been restored!", "You can now maintain and build on our territory again."]]] call ExileServer_system_network_send_to;
|
||||
_flag call ExileServer_system_xm8_sendFlagRestored;
|
||||
}
|
||||
catch
|
||||
{
|
||||
[_sessionID, "toastRequest", ["ErrorTitleAndText", ["Failed to restore!", _exception]]] call ExileServer_system_network_send_to;
|
||||
};
|
||||
true
|
@ -0,0 +1,72 @@
|
||||
/**
|
||||
* ExileServer_system_territory_network_territoryUpgradeRequest
|
||||
*
|
||||
* 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","_flag","_playerObject","_databaseID","_moderators","_level","_territoryConfig","_territoryLevels","_territoryPrice","_territoryRange","_playerMoney","_logging","_territoryLog"];
|
||||
_sessionID = _this select 0;
|
||||
_parameters = _this select 1;
|
||||
_flag = _parameters select 0;
|
||||
try
|
||||
{
|
||||
if (isNull _flag) then
|
||||
{
|
||||
throw "Invalid flag object";
|
||||
};
|
||||
if ((_flag getVariable ["ExileFlagStolen", 0]) isEqualTo 1) then
|
||||
{
|
||||
throw "Flag is stolen!";
|
||||
};
|
||||
_playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
|
||||
if (isNull _playerObject) then
|
||||
{
|
||||
throw "Player Object NULL";
|
||||
};
|
||||
_databaseID = _flag getVariable ["ExileDatabaseID",0];
|
||||
_moderators = _flag getVariable ["ExileTerritoryModerators",[]];
|
||||
if !((getPlayerUID _playerObject) in _moderators) then
|
||||
{
|
||||
throw "No upgrade Access!";
|
||||
};
|
||||
_level = _flag getVariable ["ExileTerritoryLevel",_level];
|
||||
_territoryConfig = getArray(missionConfigFile >> "CfgTerritories" >> "Prices");
|
||||
_territoryLevels = count _territoryConfig;
|
||||
if (_territoryLevels < (_level + 1)) then
|
||||
{
|
||||
throw "This territory has already the highest level.";
|
||||
};
|
||||
_territoryPrice = (_territoryConfig select _level) select 0;
|
||||
_territoryRange = (_territoryConfig select _level) select 1;
|
||||
_playerMoney = _playerObject getVariable ["ExileMoney",0];
|
||||
if (_playerMoney < _territoryPrice) then
|
||||
{
|
||||
throw "Not enough pop tabs!";
|
||||
};
|
||||
_playerMoney = _playerMoney - _territoryPrice;
|
||||
_playerObject setVariable ["ExileMoney", _playerMoney, true];
|
||||
format["setPlayerMoney:%1:%2", _playerMoney, _playerObject getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
|
||||
_flag setVariable ["ExileTerritoryLevel",_level + 1, true];
|
||||
_flag setVariable ["ExileTerritorySize",_territoryRange, true];
|
||||
format ["setTerritoryLevel:%1:%2",_level + 1,_databaseID] call ExileServer_system_database_query_fireAndForget;
|
||||
format ["setTerritorySize:%1:%2",_territoryRange,_databaseID] call ExileServer_system_database_query_fireAndForget;
|
||||
_flag call ExileServer_system_territory_updateNearContainers;
|
||||
_flag call ExileServer_system_territory_updateNearConstructions;
|
||||
[_sessionID, "toastRequest", ["SuccessTitleAndText", ["Territory upgraded!", format ["Your territory has reached level %1 and now has a new radius of %2 meters.", _level + 1, _territoryRange]]]] call ExileServer_system_network_send_to;
|
||||
_logging = getNumber(configFile >> "CfgSettings" >> "Logging" >> "territoryLogging");
|
||||
if (_logging isEqualTo 1) then
|
||||
{
|
||||
_territoryLog = format ["PLAYER ( %1 ) %2 PAID %3 POP TABS TO UPGRADE TERRITORY #%4 TO LEVEL %5 | PLAYER TOTAL POP TABS: %6",getPlayerUID _playerObject,_playerObject,_territoryPrice,_databaseID,(_level + 1),_playerMoney];
|
||||
"extDB3" callExtension format["1:TERRITORY:%1",_territoryLog];
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
[_sessionID, "toastRequest", ["ErrorTitleAndText", ["Failed to upgrade!", _exception]]] call ExileServer_system_network_send_to;
|
||||
};
|
||||
true
|
@ -0,0 +1,82 @@
|
||||
/**
|
||||
* ExileServer_system_trading_network_purchaseItemRequest
|
||||
*
|
||||
* 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","_itemClassName","_quantity","_containerType","_containerNetID","_playerObject","_vehicleObject","_salesPrice","_playerMoney","_playerRespect","_quality","_requiredRespect","_logging","_traderLog","_responseCode"];
|
||||
_sessionID = _this select 0;
|
||||
_parameters = _this select 1;
|
||||
_itemClassName = _parameters select 0;
|
||||
_quantity = _parameters select 1;
|
||||
_containerType = _parameters select 2;
|
||||
_containerNetID = _parameters select 3;
|
||||
try
|
||||
{
|
||||
_playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
|
||||
if (_playerObject getVariable ["ExileMutex",false]) then
|
||||
{
|
||||
throw 12;
|
||||
};
|
||||
_playerObject setVariable ["ExileMutex",true];
|
||||
_vehicleObject = objNull;
|
||||
if (isNull _playerObject) then
|
||||
{
|
||||
throw 1;
|
||||
};
|
||||
if !(alive _playerObject) then
|
||||
{
|
||||
throw 2;
|
||||
};
|
||||
if !(isClass (missionConfigFile >> "CfgExileArsenal" >> _itemClassName) ) then
|
||||
{
|
||||
throw 3;
|
||||
};
|
||||
_salesPrice = getNumber (missionConfigFile >> "CfgExileArsenal" >> _itemClassName >> "price");
|
||||
if (_salesPrice <= 0) then
|
||||
{
|
||||
throw 4;
|
||||
};
|
||||
_playerMoney = _playerObject getVariable ["ExileMoney", 0];
|
||||
if (_playerMoney < _salesPrice) then
|
||||
{
|
||||
throw 5;
|
||||
};
|
||||
_playerRespect = _playerObject getVariable ["ExileScore", 0];
|
||||
_quality = getNumber(missionConfigFile >> "CfgExileArsenal" >> _itemClassName >> "quality");
|
||||
_requiredRespect = getNumber(missionConfigFile >> "CfgTrading" >> "requiredRespect" >> format["Level%1",_quality]);
|
||||
if (_playerRespect < _requiredRespect) then
|
||||
{
|
||||
throw 14;
|
||||
};
|
||||
_playerMoney = _playerMoney - _salesPrice;
|
||||
_playerObject setVariable ["ExileMoney", _playerMoney, true];
|
||||
format["setPlayerMoney:%1:%2", _playerMoney, _playerObject getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
|
||||
[_sessionID, "purchaseItemResponse", [0, _salesPrice, _itemClassName, 1, _containerType, _containerNetID]] call ExileServer_system_network_send_to;
|
||||
_logging = getNumber(configFile >> "CfgSettings" >> "Logging" >> "traderLogging");
|
||||
if (_logging isEqualTo 1) then
|
||||
{
|
||||
_traderLog = format ["PLAYER: ( %1 ) %2 PURCHASED ITEM %3 FOR %4 POPTABS | PLAYER TOTAL MONEY: %5",getPlayerUID _playerObject,_playerObject,_itemClassName,_salesPrice,_playerMoney];
|
||||
"extDB3" callExtension format["1:TRADING:%1",_traderLog];
|
||||
};
|
||||
if !(_vehicleObject isEqualTo objNull) then
|
||||
{
|
||||
_vehicleObject call ExileServer_object_vehicle_database_update;
|
||||
}
|
||||
else
|
||||
{
|
||||
_playerObject call ExileServer_object_player_database_update;
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
_responseCode = _exception;
|
||||
[_sessionID, "purchaseItemResponse", [_responseCode, 0, "", 0, 0, ""]] call ExileServer_system_network_send_to;
|
||||
};
|
||||
_playerObject setVariable ["ExileMutex",false];
|
||||
true
|
@ -0,0 +1,90 @@
|
||||
/**
|
||||
* ExileServer_system_trading_network_purchaseVehicleRequest
|
||||
*
|
||||
* 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","_vehicleClass","_pinCode","_playerObject","_salesPrice","_playerMoney","_position","_vehicleObject","_logging","_traderLog","_responseCode"];
|
||||
_sessionID = _this select 0;
|
||||
_parameters = _this select 1;
|
||||
_vehicleClass = _parameters select 0;
|
||||
_pinCode = _parameters select 1;
|
||||
try
|
||||
{
|
||||
_playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
|
||||
if (isNull _playerObject) then
|
||||
{
|
||||
throw 1;
|
||||
};
|
||||
if !(alive _playerObject) then
|
||||
{
|
||||
throw 2;
|
||||
};
|
||||
if (_playerObject getVariable ["ExileMutex",false]) then
|
||||
{
|
||||
throw 12;
|
||||
};
|
||||
_playerObject setVariable ["ExileMutex", true];
|
||||
if !(isClass (missionConfigFile >> "CfgExileArsenal" >> _vehicleClass) ) then
|
||||
{
|
||||
throw 3;
|
||||
};
|
||||
_salesPrice = getNumber (missionConfigFile >> "CfgExileArsenal" >> _vehicleClass >> "price");
|
||||
if (_salesPrice <= 0) then
|
||||
{
|
||||
throw 4;
|
||||
};
|
||||
_playerMoney = _playerObject getVariable ["ExileMoney", 0];
|
||||
if (_playerMoney < _salesPrice) then
|
||||
{
|
||||
throw 5;
|
||||
};
|
||||
if !((count _pinCode) isEqualTo 4) then
|
||||
{
|
||||
throw 11;
|
||||
};
|
||||
if (_vehicleClass isKindOf "Ship") then
|
||||
{
|
||||
_position = [(getPosATL _playerObject), 100, 20] call ExileClient_util_world_findWaterPosition;
|
||||
_vehicleObject = [_vehicleClass, _position, (random 360), false, _pinCode] call ExileServer_object_vehicle_createPersistentVehicle;
|
||||
}
|
||||
else
|
||||
{
|
||||
_position = (getPos _playerObject) findEmptyPosition [10, 250, _vehicleClass];
|
||||
if (_position isEqualTo []) then
|
||||
{
|
||||
throw 13;
|
||||
};
|
||||
_vehicleObject = [_vehicleClass, _position, (random 360), true, _pinCode] call ExileServer_object_vehicle_createPersistentVehicle;
|
||||
};
|
||||
_vehicleObject setVariable ["ExileOwnerUID", (getPlayerUID _playerObject)];
|
||||
_vehicleObject setVariable ["ExileIsLocked",0];
|
||||
_vehicleObject lock 0;
|
||||
_vehicleObject call ExileServer_object_vehicle_database_insert;
|
||||
_vehicleObject call ExileServer_object_vehicle_database_update;
|
||||
_playerMoney = _playerMoney - _salesPrice;
|
||||
_playerObject setVariable ["ExileMoney", _playerMoney, true];
|
||||
format["setPlayerMoney:%1:%2", _playerMoney, _playerObject getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
|
||||
[_sessionID, "purchaseVehicleResponse", [0, netId _vehicleObject, _salesPrice]] call ExileServer_system_network_send_to;
|
||||
_logging = getNumber(configFile >> "CfgSettings" >> "Logging" >> "traderLogging");
|
||||
if (_logging isEqualTo 1) then
|
||||
{
|
||||
_traderLog = format ["PLAYER: ( %1 ) %2 PURCHASED VEHICLE %3 FOR %4 POPTABS | PLAYER TOTAL MONEY: %5",getPlayerUID _playerObject,_playerObject,_vehicleClass,_salesPrice,_playerMoney];
|
||||
"extDB3" callExtension format["1:TRADING:%1",_traderLog];
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
_responseCode = _exception;
|
||||
[_sessionID, "purchaseVehicleResponse", [_responseCode, "", 0]] call ExileServer_system_network_send_to;
|
||||
};
|
||||
if !(isNull _playerObject) then
|
||||
{
|
||||
_playerObject setVariable ["ExileMutex", false];
|
||||
};
|
||||
true
|
@ -0,0 +1,93 @@
|
||||
/**
|
||||
* ExileServer_system_trading_network_purchaseVehicleSkinRequest
|
||||
*
|
||||
* 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","_vehicleNetID","_skinTextures","_playerObject","_vehicleObject","_vehicleParentClass","_salesPrice","_skinVariations","_availableSkinTexture","_playerMoney","_skinMaterials","_skinClassName","_vehicleID","_logging","_traderLog","_responseCode"];
|
||||
_sessionID = _this select 0;
|
||||
_parameters = _this select 1;
|
||||
_vehicleNetID = _parameters select 0;
|
||||
_skinTextures = _parameters select 1;
|
||||
try
|
||||
{
|
||||
_playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
|
||||
if (isNull _playerObject) then
|
||||
{
|
||||
throw 1;
|
||||
};
|
||||
if !(alive _playerObject) then
|
||||
{
|
||||
throw 2;
|
||||
};
|
||||
if(_playerObject getVariable ["ExileMutex",false]) then
|
||||
{
|
||||
throw 12;
|
||||
};
|
||||
_playerObject setVariable ["ExileMutex",true];
|
||||
_vehicleObject = objectFromNetId _vehicleNetID;
|
||||
if (isNull _vehicleObject) then
|
||||
{
|
||||
throw 6;
|
||||
};
|
||||
_vehicleParentClass = configName (inheritsFrom (configFile >> "CfgVehicles" >> (typeOf _vehicleObject)));
|
||||
if !(isClass (missionConfigFile >> "CfgVehicleCustoms" >> _vehicleParentClass) ) then
|
||||
{
|
||||
throw 7;
|
||||
};
|
||||
_salesPrice = -1;
|
||||
_skinVariations = getArray(missionConfigFile >> "CfgVehicleCustoms" >> _vehicleParentClass >> "skins");
|
||||
{
|
||||
_availableSkinTexture = _x select 3;
|
||||
if (_availableSkinTexture isEqualTo _skinTextures) exitWith
|
||||
{
|
||||
_salesPrice = _x select 1;
|
||||
};
|
||||
}
|
||||
forEach _skinVariations;
|
||||
if (_salesPrice <= 0) then
|
||||
{
|
||||
throw 4;
|
||||
};
|
||||
_playerMoney = _playerObject getVariable ["ExileMoney", 0];
|
||||
if (_playerMoney < _salesPrice) then
|
||||
{
|
||||
throw 5;
|
||||
};
|
||||
_skinMaterials = getArray(configFile >> "CfgVehicles" >> _skinClassName >> "hiddenSelectionsMaterials");
|
||||
{
|
||||
_vehicleObject setObjectTextureGlobal [_forEachIndex, _skinTextures select _forEachIndex];
|
||||
}
|
||||
forEach _skinTextures;
|
||||
{
|
||||
_vehicleObject setObjectMaterial [_forEachIndex, _x];
|
||||
}
|
||||
forEach _skinMaterials;
|
||||
_vehicleID = _vehicleObject getVariable ["ExileDatabaseID", -1];
|
||||
format["updateVehicleSkin:%1:%2", _skinTextures, _vehicleID] call ExileServer_system_database_query_fireAndForget;
|
||||
_playerMoney = _playerMoney - _salesPrice;
|
||||
_playerObject setVariable ["ExileMoney", _playerMoney, true];
|
||||
format["setPlayerMoney:%1:%2", _playerMoney, _playerObject getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
|
||||
[_sessionID, "purchaseVehicleSkinResponse", [0, _salesPrice]] call ExileServer_system_network_send_to;
|
||||
_logging = getNumber(configFile >> "CfgSettings" >> "Logging" >> "traderLogging");
|
||||
if (_logging isEqualTo 1) then
|
||||
{
|
||||
_traderLog = format ["PLAYER: ( %1 ) %2 PURCHASED VEHICLE SKIN %3 (%4) FOR %5 POPTABS | PLAYER TOTAL MONEY: %6",getPlayerUID _playerObject,_playerObject,_skinTextures,_vehicleParentClass,_salesPrice,_playerMoney];
|
||||
"extDB3" callExtension format["1:TRADING:%1",_traderLog];
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
_responseCode = _exception;
|
||||
[_sessionID, "purchaseVehicleSkinResponse", [_responseCode, 0]] call ExileServer_system_network_send_to;
|
||||
};
|
||||
if !(isNull _playerObject) then
|
||||
{
|
||||
_playerObject setVariable ["ExileMutex", false];
|
||||
};
|
||||
true
|
@ -0,0 +1,133 @@
|
||||
/**
|
||||
* ExileServer_system_trading_network_sellItemRequest
|
||||
*
|
||||
* 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","_itemClassName","_quantity","_containerType","_containerNetID","_playerObject","_vehicleObject","_sellPrice","_playerMoney","_noRespectItems","_playerRespect","_respectGain","_logging","_playerMoneyString","_traderLog","_responseCode"];
|
||||
_sessionID = _this select 0;
|
||||
_parameters = _this select 1;
|
||||
_itemClassName = _parameters select 0;
|
||||
_quantity = _parameters select 1;
|
||||
_containerType = _parameters select 2;
|
||||
_containerNetID = _parameters select 3;
|
||||
try
|
||||
{
|
||||
_playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
|
||||
if (isNull _playerObject) then
|
||||
{
|
||||
throw 1;
|
||||
};
|
||||
if !(alive _playerObject) then
|
||||
{
|
||||
throw 2;
|
||||
};
|
||||
if(_playerObject getVariable ["ExileMutex",false]) then
|
||||
{
|
||||
throw 12;
|
||||
};
|
||||
_playerObject setVariable ["ExileMutex",true];
|
||||
_vehicleObject = objNull;
|
||||
if !(isClass (missionConfigFile >> "CfgExileArsenal" >> _itemClassName) ) then
|
||||
{
|
||||
throw 3;
|
||||
};
|
||||
_sellPrice = _itemClassName call ExileClient_util_gear_calculateSellPrice;
|
||||
if (_containerType isEqualTo 1) then
|
||||
{
|
||||
if (_itemClassName isEqualTo (primaryWeapon _playerObject)) then
|
||||
{
|
||||
{
|
||||
{
|
||||
if !(_x isEqualTo "") then
|
||||
{
|
||||
_sellPrice = _sellPrice + (_x call ExileClient_util_gear_calculateSellPrice);
|
||||
};
|
||||
}
|
||||
forEach _x;
|
||||
}
|
||||
forEach
|
||||
[
|
||||
primaryWeaponItems _playerObject,
|
||||
primaryWeaponMagazine _playerObject
|
||||
];
|
||||
};
|
||||
if (_itemClassName isEqualTo (handgunWeapon _playerObject)) then
|
||||
{
|
||||
{
|
||||
{
|
||||
if !(_x isEqualTo "") then
|
||||
{
|
||||
_sellPrice = _sellPrice + (_x call ExileClient_util_gear_calculateSellPrice);
|
||||
};
|
||||
}
|
||||
forEach _x;
|
||||
}
|
||||
forEach
|
||||
[
|
||||
handgunItems _playerObject,
|
||||
handgunMagazine _playerObject
|
||||
];
|
||||
};
|
||||
};
|
||||
if (_sellPrice <= 0) then
|
||||
{
|
||||
throw 4;
|
||||
};
|
||||
_playerMoney = _playerObject getVariable ["ExileMoney", 0];
|
||||
_playerMoney = _playerMoney + _sellPrice;
|
||||
_playerObject setVariable ["ExileMoney", _playerMoney, true];
|
||||
format["setPlayerMoney:%1:%2", _playerMoney, _playerObject getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
|
||||
_noRespectItems =
|
||||
[
|
||||
"Exile_Item_FlagStolen1",
|
||||
"Exile_Item_FlagStolen2",
|
||||
"Exile_Item_FlagStolen3",
|
||||
"Exile_Item_FlagStolen4",
|
||||
"Exile_Item_FlagStolen5",
|
||||
"Exile_Item_FlagStolen6",
|
||||
"Exile_Item_FlagStolen7",
|
||||
"Exile_Item_FlagStolen8",
|
||||
"Exile_Item_FlagStolen9",
|
||||
"Exile_Item_FlagStolen10"
|
||||
];
|
||||
_playerRespect = _playerObject getVariable ["ExileScore", 0];
|
||||
if !(_itemClassName in _noRespectItems) then
|
||||
{
|
||||
_respectGain = _sellPrice * getNumber (configFile >> "CfgSettings" >> "Respect" >> "tradingRespectFactor");
|
||||
_playerRespect = floor (_playerRespect + _respectGain);
|
||||
_playerObject setVariable ["ExileScore", _playerRespect];
|
||||
format["setAccountScore:%1:%2", _playerRespect, (getPlayerUID _playerObject)] call ExileServer_system_database_query_fireAndForget;
|
||||
};
|
||||
[_sessionID, "sellItemResponse", [0, _sellPrice, _itemClassName, 1, _containerType, _containerNetID, str _playerRespect]] call ExileServer_system_network_send_to;
|
||||
_logging = getNumber(configFile >> "CfgSettings" >> "Logging" >> "traderLogging");
|
||||
if (_logging isEqualTo 1) then
|
||||
{
|
||||
_playerMoneyString = _playerMoney call ExileClient_util_string_exponentToString;
|
||||
_traderLog = format ["PLAYER: ( %1 ) %2 SOLD ITEM %3 FOR %4 POPTABS AND %5 RESPECT | PLAYER TOTAL MONEY: %6",getPlayerUID _playerObject,_playerObject,_itemClassName,_sellPrice,_respectGain,_playerMoneyString];
|
||||
"extDB3" callExtension format["1:TRADING:%1",_traderLog];
|
||||
};
|
||||
if !(_vehicleObject isEqualTo objNull) then
|
||||
{
|
||||
_vehicleObject call ExileServer_object_vehicle_database_update;
|
||||
}
|
||||
else
|
||||
{
|
||||
_playerObject call ExileServer_object_player_database_update;
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
_responseCode = _exception;
|
||||
[_sessionID, "sellItemResponse", [_responseCode, 0, "", 0, 0, "", ""]] call ExileServer_system_network_send_to;
|
||||
};
|
||||
if !(isNull _playerObject) then
|
||||
{
|
||||
_playerObject setVariable ["ExileMutex", false];
|
||||
};
|
||||
true
|
@ -0,0 +1,85 @@
|
||||
/**
|
||||
* ExileServer_system_trading_network_wasteDumpRequest
|
||||
*
|
||||
* 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","_vehicleNetID","_mode","_vehicleObject","_vehicleDBID","_playerObject","_cargo","_revenue","_playerMoney","_respectGain","_playerRespect","_logging","_traderLog","_responseCode"];
|
||||
_sessionID = _this select 0;
|
||||
_parameters = _this select 1;
|
||||
_vehicleNetID = _parameters select 0;
|
||||
_mode = _parameters select 1;
|
||||
try
|
||||
{
|
||||
_vehicleObject = objectFromNetId _vehicleNetID;
|
||||
_vehicleDBID = _vehicleObject getVariable "ExileDatabaseID";
|
||||
if (isNull _vehicleObject) then
|
||||
{
|
||||
throw 6;
|
||||
};
|
||||
if (_vehicleObject getVariable ["ExileMutex", false]) then
|
||||
{
|
||||
throw 12;
|
||||
};
|
||||
_vehicleObject setVariable ["ExileMutex", true];
|
||||
_playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
|
||||
if (isNull _playerObject) then
|
||||
{
|
||||
throw 1;
|
||||
};
|
||||
if !(alive _playerObject) then
|
||||
{
|
||||
throw 2;
|
||||
};
|
||||
if !((owner _vehicleObject) isEqualTo (owner _playerObject)) then
|
||||
{
|
||||
throw 6;
|
||||
};
|
||||
_cargo = _vehicleObject call ExileClient_util_containerCargo_list;
|
||||
_revenue = _cargo call ExileClient_util_gear_calculateTotalSellPrice;
|
||||
clearBackpackCargoGlobal _vehicleObject;
|
||||
clearItemCargoGlobal _vehicleObject;
|
||||
clearMagazineCargoGlobal _vehicleObject;
|
||||
clearWeaponCargoGlobal _vehicleObject;
|
||||
if (_mode isEqualTo 2) then
|
||||
{
|
||||
_revenue = _revenue + ([(typeOf _vehicleObject)] call ExileClient_util_gear_calculateTotalSellPrice);
|
||||
_vehicleObject call ExileServer_object_vehicle_remove;
|
||||
deleteVehicle _vehicleObject;
|
||||
}
|
||||
else
|
||||
{
|
||||
_vehicleObject call ExileServer_object_vehicle_database_update;
|
||||
};
|
||||
_playerMoney = _playerObject getVariable ["ExileMoney", 0];
|
||||
_playerMoney = _playerMoney + _revenue;
|
||||
_playerObject setVariable ["ExileMoney", _playerMoney, true];
|
||||
format["setPlayerMoney:%1:%2", _playerMoney, _playerObject getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
|
||||
_respectGain = _revenue * getNumber (configFile >> "CfgSettings" >> "Respect" >> "tradingRespectFactor");
|
||||
_playerRespect = _playerObject getVariable ["ExileScore", 0];
|
||||
_playerRespect = floor (_playerRespect + _respectGain);
|
||||
_playerObject setVariable ["ExileScore", _playerRespect];
|
||||
format["setAccountScore:%1:%2", _playerRespect, (getPlayerUID _playerObject)] call ExileServer_system_database_query_fireAndForget;
|
||||
[_sessionID, "wasteDumpResponse", [0, _revenue, str _playerRespect]] call ExileServer_system_network_send_to;
|
||||
_logging = getNumber(configFile >> "CfgSettings" >> "Logging" >> "traderLogging");
|
||||
if (_logging isEqualTo 1) then
|
||||
{
|
||||
_traderLog = format ["PLAYER: ( %1 ) %2 SOLD ITEM: %3 (ID# %4) with Cargo %5 FOR %6 POPTABS AND %7 RESPECT | PLAYER TOTAL MONEY: %8",getPlayerUID _playerObject,_playerObject,typeOf _vehicleObject,_vehicleDBID,_cargo,_revenue,_respectGain,_playerMoney];
|
||||
"extDB3" callExtension format["1:TRADING:%1",_traderLog];
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
_responseCode = _exception;
|
||||
[_sessionID, "wasteDumpResponse", [_responseCode, 0, ""]] call ExileServer_system_network_send_to;
|
||||
};
|
||||
if (!isNull _vehicleObject) then
|
||||
{
|
||||
_vehicleObject setVariable ["ExileMutex", false];
|
||||
};
|
||||
true
|
@ -0,0 +1,15 @@
|
||||
/**
|
||||
* ExileServer_util_time_addTime
|
||||
*
|
||||
* 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["_time1","_time2"];
|
||||
_time1 = _this select 0;
|
||||
_time2 = _this select 1;
|
||||
(parseSimpleArray ("extDB3" callExtension format ["9:TIMEDIFF:MINUTES:%1:%2",_time1,_time2])) select 1
|
@ -0,0 +1,12 @@
|
||||
/**
|
||||
* ExileServer_util_time_currentTime
|
||||
*
|
||||
* 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/.
|
||||
*/
|
||||
|
||||
(parseSimpleArray ("extDB3" callExtension "9:LOCAL_TIME")) select 1
|
@ -0,0 +1,12 @@
|
||||
/**
|
||||
* ExileServer_util_time_uptime
|
||||
*
|
||||
* 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/.
|
||||
*/
|
||||
|
||||
(parseNumber ("extDB3" callExtension "9:UPTIME:MINUTES"))
|
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* ExileServer_world_initialize
|
||||
*
|
||||
* 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/.
|
||||
*/
|
||||
|
||||
"Initializing game world..." call ExileServer_util_log;
|
||||
call ExileServer_World_loadAllClans;
|
||||
call ExileServer_World_loadAllTerritories;
|
||||
call ExileServer_world_loadAllDatabaseConstructions;
|
||||
call ExileServer_world_loadAllDatabaseVehicles;
|
||||
call ExileServer_world_loadAllDatabaseContainers;
|
||||
call ExileServer_system_xm8_sendProtectionMoneyDue;
|
||||
call ExileServer_world_spawnSpawnZoneVehicles;
|
||||
call ExileServer_world_spawnVehicles;
|
||||
"Game world initialized! Let the fun begin!" call ExileServer_util_log;
|
||||
true
|
Loading…
Reference in New Issue
Block a user