Update : Simulation Manager and parseSimpleArray

Basically, a basic simulation manager is implemented and
parseSimpleArray exhanged from call compile so database is faster. For
issues PM me on discord or Exile forums.
This commit is contained in:
Cloudhax23 2017-03-19 20:26:45 -05:00
parent 2481921256
commit 5fa1bc18fd
24 changed files with 1465 additions and 27 deletions

Binary file not shown.

View File

@ -0,0 +1,38 @@
/**
* 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];
_constructionID

View File

@ -35,18 +35,13 @@ 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
if (typeOf _constructionObject in ["Exile_Construction_ConcreteDoor_Static", "Exile_Construction_ConcreteGate_Static", "Exile_Construction_WoodGate_Static", "Exile_Construction_WoodDoor_Static", "Exile_Construction_ConcreteWindowHatch_Static", "Exile_Construction_WoodGate_Reinforced_Static", "Exile_Construction_WoodDoor_Reinforced_Static", "Exile_Construction_ConcreteFloorHatch_Static"]) then
{
_constructionObject enableSimulationGlobal true;
_constructionObject call ExileServer_system_simulationMonitor_addVehicle;
}
else
{
_constructionObject enableSimulationGlobal false;
_constructionObject enableDynamicSimulation true;
};
_constructionObject setVelocity [0, 0, 0];
_constructionObject setPosATL _position;
_constructionObject setVelocity [0, 0, 0];
_constructionObject setVectorDirAndUp [_vectorDirection, _vectorUp];
_constructionObject setVelocity [0, 0, 0];
_constructionObject
_constructionObject

View File

@ -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 enableDynamicSimulation true;
_containerObject

View File

@ -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

View File

@ -0,0 +1,45 @@
/**
* 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;
_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 enableDynamicSimulation true;
_containerObject addMPEventHandler ["MPKilled", { if !(isServer) exitWith {}; (_this select 0) call ExileServer_object_container_event_onMpKilled; }];
_containerObject

View File

@ -5,7 +5,7 @@
* www.exilemod.com
* © 2015 Exile Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* 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/.
*/
@ -18,7 +18,7 @@ if (_containerID > -1) then
_vectorDirection = vectorDir _containerObject;
_vectorUp = vectorUp _containerObject;
_territoryFlag = _containerObject call ExileClient_util_world_getTerritoryAtPosition;
_territoryID = if (isNull _territoryFlag) then { 'NULL' } else { _territoryFlag getVariable ["ExileDatabaseID", 'NULL']};
_territoryID = if (isNull _territoryFlag) then { '' } else { _territoryFlag getVariable ["ExileDatabaseID", '']};
_containerObject setVariable ["ExileTerritoryID", _territoryID];
_data =
[
@ -26,7 +26,7 @@ if (_containerID > -1) then
_position select 0,
_position select 1,
_position select 2,
_vectorDirection select 0,
_vectorDirection select 0,
_vectorDirection select 1,
_vectorDirection select 2,
_vectorUp select 0,

View File

@ -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 _player) isEqualTo false) then
{
_player 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

View File

@ -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","_requestingPlayer","_bambiPlayer","_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 ((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;
};
_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

View File

@ -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 enableDynamicSimulation true;
_vehicleObject

View File

@ -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 enableDynamicSimulation true;
_vehicleObject

View File

@ -0,0 +1,82 @@
/**
* 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;
_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 enableDynamicSimulation true;
if (_vehicleObject call ExileClient_util_world_isInTraderZone) then
{
_vehicleObject allowDamage false;
};
_vehicleObject

View File

@ -17,20 +17,24 @@ ExileServerRconSessionID = "";
try
{
_result = "extDB3" callExtension "9:VERSION";
format ["Installed extDB2 version: %1", _result] call ExileServer_util_log;
_result = call compile ("extDB3" callExtension "9:ADD_DATABASE:exile");
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 = str(round(random(999999)));
_result = call compile ("extDB3" callExtension "9:ADD_DATABASE_PROTOCOL:exile:SQL_CUSTOM:SQL:exile.ini");
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 = (call compile ("extDB3" callExtension "9:LOCAL_TIME")) select 1;
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";
@ -43,7 +47,7 @@ catch
if (!_error_locked) then
{
"MySQL connection error!" call ExileServer_util_log;
"Please have a look at @ExileServer/logs/ to find out what went wrong." 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;
//"extDB3" callExtension "9:SHUTDOWN"; Not implemented in extDB3

View File

@ -12,5 +12,5 @@
private["_parameters","_query","_result"];
_parameters = _this;
_query = [0, "SQL",_parameters] joinString ":";
_result = call compile ("extDB3" callExtension _query);
_result = parseSimpleArray ("extDB3" callExtension _query);
(_result select 1) select 0

View File

@ -12,7 +12,7 @@
private["_parameters","_query","_result"];
_parameters = _this;
_query = [0, "SQL",_parameters] joinString ":";
_result = call compile ("extDB3" callExtension _query);
_result = parseSimpleArray ("extDB3" callExtension _query);
switch (_result select 0) do
{
case 0:

View File

@ -12,7 +12,7 @@
private["_parameters","_query","_result"];
_parameters = _this;
_query = [0, "SQL",_parameters] joinString ":";
_result = call compile ("extDB3" callExtension _query);
_result = parseSimpleArray ("extDB3" callExtension _query);
switch (_result select 0) do
{
case 0:

View File

@ -12,7 +12,7 @@
private["_parameters","_query","_result"];
_parameters = _this;
_query = [0,"SQL",_parameters] joinString ":";
_result = call compile ("extDB3" callExtension _query);
_result = parseSimpleArray ("extDB3" callExtension _query);
switch (_result select 0) do
{
case 0:

View File

@ -5,7 +5,7 @@
* www.exilemod.com
* © 2015 Exile Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* 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/.
*/
@ -30,7 +30,8 @@ _data =
_flagTexture,
0,
_build_rights,
_moderators
_moderators,
""
];
_extDB2Message = ["createTerritory", _data] call ExileServer_util_extDB2_createMessage;
_territoryID = _extDB2Message call ExileServer_system_database_query_insertSingle;

View File

@ -14,6 +14,6 @@ _flag = _this;
_currentTimestamp = call ExileServer_util_time_currentTime;
_flagBuild = _flag getVariable ["ExileTerritoryLastPayed", _currentTimestamp];
_maintenancePeriod = getNumber(configFile >> "CfgSettings" >> "GarbageCollector" >> "Database" >> "territoryLifeTime");
_maintenancePeriodDueDate = call compile ("extDB3" callExtension format["9:DATEADD:%1:[%2,0,0,0]",_flagBuild,_maintenancePeriod]);
_maintenancePeriodDueDate = parseSimpleArray ("extDB3" callExtension format["9:DATEADD:%1:[%2,0,0,0]",_flagBuild,_maintenancePeriod]);
_flag setVariable ["ExileTerritoryMaintenanceDue", _maintenancePeriodDueDate select 1, true];
true

View File

@ -12,4 +12,4 @@
private["_time1","_time2"];
_time1 = _this select 0;
_time2 = _this select 1;
(call compile ("extDB3" callExtension format ["9:TIMEDIFF:MINUTES:%1:%2",_time1,_time2])) select 1
(parseSimpleArray ("extDB3" callExtension format ["9:TIMEDIFF:MINUTES:%1:%2",_time1,_time2])) select 1

View File

@ -9,4 +9,4 @@
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*/
(call compile ("extDB3" callExtension "9:LOCAL_TIME")) select 1
(parseSimpleArray ("extDB3" callExtension "9:LOCAL_TIME")) select 1

View File

@ -9,4 +9,4 @@
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*/
(call compile ("extDB3" callExtension "9:UPTIME:MINUTES")) select 1
(parseNumber ("extDB3" callExtension "9:UPTIME:MINUTES"))

View File

@ -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/.
*/
enableDynamicSimulationSystem true;
"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

680
exile.ini Normal file
View File

@ -0,0 +1,680 @@
[Default]
Version = 1
Strip Chars = "\/\|;{}<>\'"
Strip Chars Mode = 0
Input SQF Parser = false
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Account related queries
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[isKnownAccount]
SQL1_1 = SELECT CASE WHEN EXISTS(SELECT uid FROM account WHERE uid = ?) THEN 'true' ELSE 'false' END
SQL1_INPUTS = 1
OUTPUT = 1
[createAccount]
SQL1_1 = INSERT INTO account SET uid = ?, name = ?
SQL1_INPUTS = 1,2
[startAccountSession]
SQL1_1 = UPDATE account SET name = ?, last_connect_at = NOW(), total_connections = total_connections + 1 WHERE uid = ?
SQL1_INPUTS = 2,1
[endAccountSession]
SQL1_1 = UPDATE account SET last_disconnect_at = NOW() WHERE uid = ?
SQL1_INPUTS = 1
[getAccountStats]
SQL1_1 = SELECT score, kills, deaths, clan_id, locker FROM account WHERE uid = ?
SQL1_INPUTS = 1
OUTPUT = 1,2,3,4,5
[addAccountKill]
SQL1_1 = UPDATE account SET kills = kills + 1 WHERE uid = ?
SQL1_INPUTS = 1
[addAccountDeath]
SQL1_1 = UPDATE account SET deaths = deaths + 1 WHERE uid = ?
SQL1_INPUTS = 1
[getAccountScore]
SQL1_1 = SELECT score FROM account WHERE uid = ?
SQL1_INPUTS = 1
OUTPUT = 1
[setAccountScore]
SQL1_1 = UPDATE account SET score = ? WHERE uid = ?
SQL1_INPUTS = 1,2
[modifyAccountScore]
SQL1_1 = UPDATE account SET score = score + ? WHERE uid = ?
SQL1_INPUTS = 1,2
[updateLocker]
SQL1_1 = UPDATE account SET locker = ? WHERE uid = ?
SQL1_INPUTS = 1,2
[getLocker]
SQL1_1 = SELECT locker FROM account WHERE uid = ?
SQL1_INPUTS = 1
OUTPUT = 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Player related queries
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[hasAlivePlayer]
SQL1_1 = SELECT CASE WHEN EXISTS(SELECT account_uid FROM player WHERE account_uid = ? AND damage < 1) THEN 'true' ELSE 'false' END
SQL1_INPUTS = 1
OUTPUT = 1
[createPlayer]
SQL1_1 = DELETE FROM player WHERE account_uid = ?
SQL2_1 = INSERT INTO player SET account_uid = ?, name = ?
SQL1_INPUTS = 1
SQL2_INPUTS = 1,2
Return InsertID = true
[insertPlayerHistory]
SQL1_1 = INSERT INTO player_history SET account_uid = ?, name = ?, position_x = ?, position_y = ?, position_z = ?
SQL1_INPUTS = 1,2,3,4,5
[deletePlayer]
SQL1_1 = DELETE FROM player WHERE id = ?
SQL1_INPUTS = 1
[loadPlayer]
SQL1_1 = SELECT p.id,
SQL1_2 = p.name,
SQL1_3 = p.account_uid,
SQL1_4 = p.damage,
SQL1_5 = p.hunger,
SQL1_6 = p.thirst,
SQL1_7 = p.alcohol,
SQL1_8 = p.oxygen_remaining,
SQL1_9 = p.bleeding_remaining,
SQL1_10 = p.hitpoints,
SQL1_11 = p.direction,
SQL1_12 = p.position_x,
SQL1_13 = p.position_y,
SQL1_14 = p.position_z,
SQL1_15 = p.assigned_items,
SQL1_16 = p.backpack,
SQL1_17 = p.backpack_items,
SQL1_18 = p.backpack_magazines,
SQL1_19 = p.backpack_weapons,
SQL1_20 = p.current_weapon,
SQL1_21 = p.goggles,
SQL1_22 = p.handgun_items,
SQL1_23 = p.handgun_weapon,
SQL1_24 = p.headgear,
SQL1_25 = p.binocular,
SQL1_26 = p.loaded_magazines,
SQL1_27 = p.primary_weapon,
SQL1_28 = p.primary_weapon_items,
SQL1_29 = p.secondary_weapon,
SQL1_30 = p.secondary_weapon_items,
SQL1_31 = p.uniform,
SQL1_32 = p.uniform_items,
SQL1_33 = p.uniform_magazines,
SQL1_34 = p.uniform_weapons,
SQL1_35 = p.vest,
SQL1_36 = p.vest_items,
SQL1_37 = p.vest_magazines,
SQL1_38 = p.vest_weapons,
SQL1_39 = p.money,
SQL1_40 = a.score,
SQL1_41 = a.kills,
SQL1_42 = a.deaths,
SQL1_43 = c.id,
SQL1_44 = c.name,
SQL1_45 = p.temperature,
SQL1_46 = p.wetness,
SQL1_47 = a.locker
SQL1_48 = FROM player p
SQL1_49 = INNER JOIN account a
SQL1_50 = ON a.uid = p.account_uid
SQL1_51 = LEFT JOIN clan c
SQL1_52 = ON c.id = a.clan_id
SQL1_53 = WHERE p.account_uid = ?
SQL1_INPUTS = 1
OUTPUT = 1,2-STRING,3-STRING,4,5,6,7,8,9,10,11,12,13,14,15,16-STRING,17,18,19,20-STRING,21-STRING,22,23-STRING,24-STRING,25-STRING,26,27-STRING,28,29-STRING,30,31-STRING,32,33,34,35-STRING,36,37,38,39,40,41,42,43,44-STRING,45,46,47
[updatePlayer]
SQL1_1 = UPDATE player SET
SQL1_2 = name = ?,
SQL1_3 = damage = ?,
SQL1_4 = hunger = ?,
SQL1_5 = thirst = ?,
SQL1_6 = alcohol = ?,
SQL1_7 = oxygen_remaining = ?,
SQL1_8 = bleeding_remaining = ?,
SQL1_9 = hitpoints = ?,
SQL1_10 = direction = ?,
SQL1_11 = position_x = ?,
SQL1_12 = position_y = ?,
SQL1_13 = position_z = ?,
SQL1_14 = assigned_items = ?,
SQL1_15 = backpack = ?,
SQL1_16 = backpack_items = ?,
SQL1_17 = backpack_magazines = ?,
SQL1_18 = backpack_weapons = ?,
SQL1_19 = current_weapon = ?,
SQL1_20 = goggles = ?,
SQL1_21 = handgun_items = ?,
SQL1_22 = handgun_weapon = ?,
SQL1_23 = headgear = ?,
SQL1_24 = binocular = ?,
SQL1_25 = loaded_magazines = ?,
SQL1_26 = primary_weapon = ?,
SQL1_27 = primary_weapon_items = ?,
SQL1_28 = secondary_weapon = ?,
SQL1_29 = secondary_weapon_items = ?,
SQL1_30 = uniform = ?,
SQL1_31 = uniform_items = ?,
SQL1_32 = uniform_magazines = ?,
SQL1_33 = uniform_weapons = ?,
SQL1_34 = vest = ?,
SQL1_35 = vest_items = ?,
SQL1_36 = vest_magazines = ?,
SQL1_37 = vest_weapons = ?,
SQL1_38 = temperature = ?,
SQL1_39 = wetness = ?
SQL1_40 = WHERE id = ?
SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Vehicle related queries
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[insertVehicle]
SQL1_1 = INSERT INTO vehicle SET
SQL1_2 = class = ?,
SQL1_3 = account_uid = ?,
SQL1_4 = is_locked = ?,
SQL1_5 = position_x = ?,
SQL1_6 = position_y = ?,
SQL1_7 = position_z = ?,
SQL1_8 = direction_x = ?,
SQL1_9 = direction_y = ?,
SQL1_10 = direction_z = ?,
SQL1_11 = up_x = ?,
SQL1_12 = up_y = ?,
SQL1_13 = up_z = ?,
SQL1_14 = pin_code = ?
SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12,13
Return InsertID = true
[deleteVehicle]
SQL1_1 = DELETE FROM vehicle WHERE id = ?
SQL1_INPUTS = 1
[loadVehicleIdPage]
SQL1_1 = SELECT id FROM vehicle WHERE deleted_at IS NULL LIMIT ?,?
SQL1_INPUTS = 1,2
OUTPUT = 1
[loadVehicle]
SQL1_1 = SELECT id,class,spawned_at,account_uid,is_locked,fuel,damage,hitpoints,position_x,position_y,position_z,direction_x,direction_y,direction_z,up_x,up_y,up_z,cargo_items,cargo_magazines,cargo_weapons,pin_code,vehicle_texture,deleted_at,money FROM vehicle WHERE id = ?
SQL1_INPUTS = 1
OUTPUT = 1,2-STRING,3-STRING,4-STRING,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21-STRING,22,23,24
[loadVehicleContainer]
SQL1_1 = SELECT cargo_container FROM vehicle WHERE id = ?
SQL1_INPUTS = 1
OUTPUT = 1
[updateVehicle]
SQL1_1 = UPDATE vehicle SET
SQL1_2 = is_locked = ?,
SQL1_3 = fuel = ?,
SQL1_4 = damage = ?,
SQL1_5 = hitpoints = ?,
SQL1_6 = position_x = ?,
SQL1_7 = position_y = ?,
SQL1_8 = position_z = ?,
SQL1_9 = direction_x = ?,
SQL1_10 = direction_y = ?,
SQL1_11 = direction_z = ?,
SQL1_12 = up_x = ?,
SQL1_13 = up_y = ?,
SQL1_14 = up_z = ?,
SQL1_15 = cargo_items = ?,
SQL1_16 = cargo_magazines = ?,
SQL1_17 = cargo_weapons = ?,
SQL1_18 = cargo_container = ?,
SQL1_19 = money = ?
SQL1_20 = WHERE id = ?
SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
[updateVehicleSkin]
SQL1_1 = UPDATE vehicle SET vehicle_texture = ? WHERE id = ?
SQL1_INPUTS = 1,2
[vehicleSetPinCode]
SQL1_1 = UPDATE vehicle SET pin_code = ? WHERE id = ?
SQL1_INPUTS = 1,2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Construction related queries
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[insertConstruction]
SQL1_1 = INSERT INTO construction SET
SQL1_2 = class = ?,
SQL1_3 = account_uid = ?,
SQL1_4 = position_x = ?,
SQL1_5 = position_y = ?,
SQL1_6 = position_z = ?,
SQL1_7 = direction_x = ?,
SQL1_8 = direction_y = ?,
SQL1_9 = direction_z = ?,
SQL1_10 = up_x = ?,
SQL1_11 = up_y = ?,
SQL1_12 = up_z = ?,
SQL1_13 = territory_id = ?
SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12-NULL
Return InsertID = true
[deleteConstruction]
SQL1_1 = DELETE FROM construction WHERE id = ?
SQL1_INPUTS = 1
[loadConstructionIdPage]
SQL1_1 = SELECT id FROM construction WHERE deleted_at IS NULL LIMIT ?,?
SQL1_INPUTS = 1,2
OUTPUT = 1
[loadConstruction]
SQL1_1 = SELECT id,class,account_uid,spawned_at,position_x,position_y,position_z,direction_x,direction_y,direction_z,up_x,up_y,up_z,is_locked,pin_code,territory_id,deleted_at,damage FROM construction WHERE id = ?
SQL1_INPUTS = 1
OUTPUT = 1,2-STRING,3-STRING,4-STRING,5,6,7,8,9,10,11,12,13,14,15-STRING,16,17,18
[countConstruction]
SQL1_1 = SELECT COUNT(*) FROM construction
OUTPUT = 1
[constructionSetPinCode]
SQL1_1 = UPDATE construction SET pin_code= ? WHERE id = ?
SQL1_INPUTS = 1,2
[upgradeObject]
SQL1_1 = UPDATE construction SET class=? WHERE id = ?
SQL1_INPUTS = 1,2
[addDoorLock]
SQL1_1 = UPDATE construction SET pin_code = ?,is_locked = -1 WHERE id = ?
SQL1_INPUTS = 1,2
[updateLock]
SQL1_1 = UPDATE construction SET is_locked = ? WHERE id = ?
SQL1_INPUTS = 1,2
[updateConstructionTerritoryIDs]
SQL1_1 = UPDATE construction SET territory_id = ? WHERE id IN(?)
SQL1_INPUTS = 1,2
[updateDamage]
SQL1_1 = UPDATE construction SET damage = ? WHERE id = ?
SQL1_INPUTS = 1,2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Containers related queries
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[insertContainer]
SQL1_1 = INSERT INTO container SET
SQL1_2 = class = ?,
SQL1_3 = account_uid = ?,
SQL1_4 = position_x = ?,
SQL1_5 = position_y = ?,
SQL1_6 = position_z = ?,
SQL1_7 = direction_x = ?,
SQL1_8 = direction_y = ?,
SQL1_9 = direction_z = ?,
SQL1_10 = up_x = ?,
SQL1_11 = up_y = ?,
SQL1_12 = up_z = ?,
SQL1_13 = cargo_items = ?,
SQL1_14 = cargo_magazines = ?,
SQL1_15 = cargo_weapons = ?,
SQL1_16 = cargo_container = ?,
SQL1_17 = money = ?,
SQL1_18 = pin_code = ?,
SQL1_19 = territory_id = ?
SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18-NULL
Return InsertID = true
[deleteContainer]
SQL1_1 = DELETE FROM container WHERE id = ?
SQL1_INPUTS = 1
[loadContainerIdPage]
SQL1_1 = SELECT id FROM container WHERE deleted_at IS NULL LIMIT ?,?
SQL1_INPUTS = 1,2
OUTPUT = 1
[loadContainer]
SQL1_1 = SELECT id,class,account_uid,is_locked,position_x,position_y,position_z,direction_x,direction_y,direction_z,up_x,up_y,up_z,cargo_items,cargo_magazines,cargo_weapons,pin_code,territory_id,abandoned,deleted_at,money FROM container WHERE id = ?
SQL1_INPUTS = 1
OUTPUT = 1,2-STRING,3-STRING,4,5,6,7,8,9,10,11,12,13,14,15,16,17-STRING,18,19-STRING,20,21
[loadContainerCargo]
SQL1_1 = SELECT cargo_container FROM container WHERE id = ?
SQL1_INPUTS = 1
OUTPUT = 1
[updateContainer]
SQL1_1 = UPDATE container SET
SQL1_2 = is_locked = ?,
SQL1_3 = position_x = ?,
SQL1_4 = position_y = ?,
SQL1_5 = position_z = ?,
SQL1_6 = direction_x = ?,
SQL1_7 = direction_y = ?,
SQL1_8 = direction_z = ?,
SQL1_9 = up_x = ?,
SQL1_10 = up_y = ?,
SQL1_11 = up_z = ?,
SQL1_12 = cargo_items = ?,
SQL1_13 = cargo_magazines = ?,
SQL1_14 = cargo_weapons = ?,
SQL1_15 = cargo_container = ?,
SQL1_16 = territory_id = ?,
SQL1_17 = money = ?
SQL1_18 = WHERE id = ?
SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15-NULL,16,17
[containerSetPinCode]
SQL1_1 = UPDATE container SET pin_code= ? WHERE id = ?
SQL1_INPUTS = 1,2
[updateContainerTerritoryIDs]
SQL1_1 = UPDATE container SET territory_id = ? WHERE id IN(?)
SQL1_INPUTS = 1,2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Clan related queries
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[createClan]
SQL1_1 = INSERT INTO clan SET leader_uid = ?, name = ?
SQL1_INPUTS = 1,2
Return InsertID = true
[setAccountClanLink]
SQL1_1 = UPDATE account SET clan_id = ? WHERE uid = ?
SQL1_INPUTS = 1,2
[unLinkClanLink]
SQL1_1 = UPDATE account SET clan_id = NULL WHERE uid = ?
SQL1_INPUTS = 1
[updateClanLeader]
SQL1_1 = UPDATE clan SET leader_uid = ? WHERE id = ?
SQL1_INPUTS = 1,2
[deleteClan]
SQL1_1 = DELETE FROM clan WHERE id = ?
SQL1_INPUTS = 1
[loadClansIdPage]
SQL1_1 = SELECT id FROM clan LIMIT ?,?
SQL1_INPUTS = 1,2
OUTPUT = 1
[getClanInfo]
SQL1_1 = SELECT name,leader_uid FROM clan WHERE id = ?
SQL1_INPUTS = 1
OUTPUT = 1-STRING,2-STRING
[getClanMembers]
SQL1_1 = SELECT uid,name FROM account WHERE clan_id = ?
SQL1_INPUTS = 1
OUTPUT = 1-STRING,2-STRING
[getClanMarkers]
SQL1_1 = SELECT id,markerType,positionArr,color,icon,iconSize,label,labelSize FROM clan_map_marker WHERE clan_id = ?
SQL1_INPUTS = 1
OUTPUT = 1,2,3,4,5-STRING,6,7-STRING,8
[addMarker]
SQL1_1 = INSERT INTO clan_map_marker SET clan_id = ?, markerType = 0, positionArr = ?, color = ?, icon = ?, iconSize = ?, label = ?, labelSize = ?
SQL1_INPUTS = 1,2,3,4,5,6,7
Return InsertID = true
[addPoly]
SQL1_1 = INSERT INTO clan_map_marker SET clan_id = ?, markerType = 1, positionArr = ?, color = ?
SQL1_INPUTS = 1,2,3
Return InsertID = true
[deleteMarker]
SQL1_1 = DELETE FROM clan_map_marker WHERE id = ?
SQL1_INPUTS = 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Territory related queries
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[createTerritory]
SQL1_1 = INSERT INTO territory SET owner_uid = ?, name = ?, position_x = ? , position_y = ? , position_z = ?, radius = ? , level = ? , flag_texture = ? , flag_stolen = ? , flag_stolen_by_uid =? , build_rights = ? , moderators = ?
SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,12-NULL,10,11
Return InsertID = true
[loadTerriotryIdPage]
SQL1_1 = SELECT id FROM territory WHERE deleted_at IS NULL LIMIT ?,?
SQL1_INPUTS = 1,2
OUTPUT = 1
[loadTerritory]
SQL1_1 = SELECT id,owner_uid,name,position_x,position_y,position_z,radius, level,flag_texture,flag_stolen,flag_stolen_by_uid,last_paid_at,build_rights,moderators,deleted_at,(SELECT COUNT(*)FROM construction c WHERE c.territory_id = ?) FROM territory WHERE id = ?
SQL1_INPUTS = 1,1
OUTPUT = 1,2-STRING,3-STRING,4,5,6,7,8,9-STRING,10,11-STRING,12,13,14,15,16
[setTerritoryLevel]
SQL1_1 = UPDATE territory SET level = ? WHERE id = ?
SQL1_INPUTS = 1,2
[setTerritorySize]
SQL1_1 = UPDATE territory SET radius = ? WHERE id = ?
SQL1_INPUTS = 1,2
[updateTerritoryBuildRights]
SQL1_1 = UPDATE territory SET build_rights = ? WHERE id = ?
SQL1_INPUTS = 1,2
[updateTerritoryModerators]
SQL1_1 = UPDATE territory SET moderators = ? WHERE id = ?
SQL1_INPUTS = 1,2
[maintainTerritory]
SQL1_1 = UPDATE territory SET last_paid_at = NOW(),xm8_protectionmoney_notified = 0 WHERE id = ?
SQL1_INPUTS = 1
[deleteTerritory]
SQL1_1 = DELETE FROM territory WHERE id = ?
SQL1_INPUTS = 1
[flagStolen]
SQL1_1 = UPDATE territory SET flag_stolen = 1, flag_stolen_by_uid = ?, flag_stolen_at = NOW() WHERE id = ?
SQL1_INPUTS = 1,2
[flagRestore]
SQL1_1 = UPDATE territory SET flag_stolen = 0, flag_stolen_by_uid = NULL, flag_stolen_at = NULL WHERE id = ?
SQL1_INPUTS = 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Garbage Collector
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Marks for deletion containers outside territories that were not accessed within ? days
[markDeleteOldContainers]
SQL1_1 = UPDATE container SET deleted_at = NOW() WHERE last_updated_at < DATE_SUB(NOW(), INTERVAL ? DAY) AND territory_id IS NULL AND deleted_at IS NULL
SQL1_INPUTS = 1
; Removes containers outside territories that were not accessed within ? days
[deleteOldContainers]
SQL1_1 = DELETE FROM container WHERE deleted_at < DATE_SUB(NOW(), INTERVAL ? DAY) AND territory_id IS NULL
SQL1_INPUTS = 1
; Marks contructions outside territories deleted after ? days
[markDeleteOldConstructions]
SQL1_1 = UPDATE construction SET deleted_at = NOW() WHERE last_updated_at < DATE_SUB(NOW(), INTERVAL ? DAY) AND territory_id IS NULL AND deleted_at IS NULL
SQL1_INPUTS = 1
; Removes contructions outside territories after ? days
[deleteOldConstructions]
SQL1_1 = DELETE FROM construction WHERE deleted_at < DATE_SUB(NOW(), INTERVAL ? DAY) AND territory_id IS NULL
SQL1_INPUTS = 1
; Marks for deletion vehicles that were not used within ? days
[markDeleteOldVehicles]
SQL1_1 = UPDATE vehicle SET deleted_at = NOW() WHERE last_updated_at < DATE_SUB(NOW(), INTERVAL ? DAY) AND deleted_at IS NULL
SQL1_INPUTS = 1
; Removes vehicles that were not used within ? days
[deleteOldVehicles]
SQL1_1 = DELETE FROM vehicle WHERE deleted_at < DATE_SUB(NOW(), INTERVAL ? DAY)
SQL1_INPUTS = 1
; Marks territories (and all containers/constructions) that were not paid within ? days as deleted
[markDeleteUnpaidTerritories]
SQL1_1 = UPDATE territory SET deleted_at = NOW() WHERE last_paid_at < DATE_SUB(NOW(), INTERVAL ? DAY) AND deleted_at IS NULL
SQL2_1 = UPDATE construction SET deleted_at = (select deleted_at from territory where territory.id=construction.territory_id and territory.deleted_at IS NOT NULL)
SQL3_1 = UPDATE container SET deleted_at = (select deleted_at from territory where territory.id=container.territory_id and territory.deleted_at IS NOT NULL)
SQL1_INPUTS = 1
; Removes territories (and all containers/constructions) that were not paid within ? days
[deleteUnpaidTerritories]
SQL1_1 = DELETE FROM territory WHERE deleted_at < DATE_SUB(NOW(), INTERVAL ? DAY)
SQL1_INPUTS = 1
[addAbandonedSafes]
SQL1_1 = UPDATE container SET abandoned = NOW(), pin_code = '0000' WHERE last_updated_at < DATE_SUB(NOW(), INTERVAL ? DAY) AND class = "Exile_Container_Safe" AND territory_id IS NULL
SQL1_INPUTS = 1
[deleteBaseFlagStolen]
SQL1_1 = DELETE FROM territory WHERE flag_stolen_at < DATE_SUB(NOW(), INTERVAL ? DAY)
SQL1_INPUTS = 1
; Unlock doors and mark safes as abandoned if flag stolen for X days
[setAbandonedUnlocked]
SQL1_1 = UPDATE container SET abandoned = NOW(), pin_code = '0000' WHERE (SELECT flag_stolen_at FROM territory WHERE territory.id=container.territory_id AND territory.flag_stolen_at < DATE_SUB(NOW(), INTERVAL ? DAY));
SQL2_1 = UPDATE construction SET pin_code = '0000' WHERE (SELECT flag_stolen_at FROM territory WHERE territory.id = construction.territory_id AND territory.flag_stolen_at < DATE_SUB(NOW(), INTERVAL ? DAY)) AND pin_code != '000000'
SQL1_INPUTS = 1
SQL2_INPUTS = 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Moneh moneh moneh
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[setPlayerMoney]
SQL1_1 = UPDATE player SET money = ? WHERE id = ?
SQL1_INPUTS = 1,2
[getPlayerMoney]
SQL1_1 = SELECT money FROM player WHERE id = ?
SQL1_INPUTS = 1
OUTPUT = 1
[setContainerMoney]
SQL1_1 = UPDATE container SET money = ? WHERE id = ?
SQL1_INPUTS = 1,2
[setVehicleMoney]
SQL1_1 = UPDATE vehicle SET money = ? WHERE id = ?
SQL1_INPUTS = 1,2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; XM8
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[getAllNotifTerritory]
SQL1_1 = SELECT id FROM territory WHERE last_paid_at < DATE_SUB(NOW(), INTERVAL ? - 1 DAY) and xm8_protectionmoney_notified = 0
SQL1_INPUTS = 1
[setTerritoryNotified]
SQL1_1 = UPDATE territory SET xm8_protectionmoney_notified = ? WHERE id = ?
SQL1_INPUTS = 1,2