Some Fixes for NULL
Just some fixes for NULL for extDB3 (since it is now supported properly when doing prepared statements). Reverted createTerritory to passing flag_stolen_by_uid to an input value. Just incase there is a 3rd party code that uses this, possible used by admin tools to restore base without a flag etc...
This commit is contained in:
parent
d54f60668a
commit
9afa3a4225
@ -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
|
91
Overrides/ExileServer_object_container_database_insert.sqf
Normal file
91
Overrides/ExileServer_object_container_database_insert.sqf
Normal 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
|
@ -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;
|
||||
|
@ -299,7 +299,7 @@ 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
|
||||
SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12-NULL
|
||||
Return InsertID = true
|
||||
|
||||
[deleteConstruction]
|
||||
@ -379,7 +379,7 @@ 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
|
||||
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]
|
||||
@ -512,9 +512,9 @@ SQL1_INPUTS = 1
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
[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 = NULL , build_rights = ? , moderators = ?
|
||||
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,10,11
|
||||
SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,12-NULL,10,11
|
||||
Return InsertID = true
|
||||
|
||||
[loadTerriotryIdPage]
|
||||
|
Loading…
Reference in New Issue
Block a user