diff --git a/@ExileServer/sql_custom/exile.ini b/@ExileServer/sql_custom/exile.ini index 9371f0e..77829dd 100644 --- a/@ExileServer/sql_custom/exile.ini +++ b/@ExileServer/sql_custom/exile.ini @@ -1,11 +1,8 @@ [Default] Version = 1 - Strip Chars = "\/\|;{}<>\'" - Strip Chars Mode = 0 - Input SQF Parser = false ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Account related queries @@ -34,7 +31,8 @@ SQL1_INPUTS = 1 [getAccountStats] SQL1_1 = SELECT score, kills, deaths, clan_id, locker FROM account WHERE uid = ? -SQL1_INPUTS = 1 + +SQL1_INPUTS = 1 OUTPUT = 1,2,3,4,5 [addAccountKill] @@ -85,11 +83,9 @@ 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 +SQL1_1 = INSERT INTO player SET account_uid = ?, name = ? +SQL1_INPUTS = 1,2 Return InsertID = true [insertPlayerHistory] @@ -156,6 +152,7 @@ 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 @@ -200,15 +197,16 @@ SQL1_37 = vest_weapons = ?, SQL1_38 = temperature = ?, SQL1_39 = wetness = ? SQL1_40 = WHERE id = ? - +9 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_1 = INSERT INTO vehicle SET +SQL1_2 = class = ?, SQL1_3 = account_uid = ?, SQL1_4 = is_locked = ?, SQL1_5 = position_x = ?, @@ -221,6 +219,7 @@ SQL1_11 = up_x = ?, SQL1_12 = up_y = ?, SQL1_13 = up_z = ?, SQL1_14 = pin_code = ? +3 SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12,13 Return InsertID = true @@ -237,6 +236,7 @@ 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 @@ -265,17 +265,19 @@ SQL1_15 = cargo_items = ?, SQL1_16 = cargo_magazines = ?, SQL1_17 = cargo_weapons = ?, SQL1_18 = cargo_container = ?, -SQL1_19 = money = ? -SQL1_20 = WHERE id = ? +SQL1_19 = money = ?, +SQL1_20 = last_updated_at = NOW() +SQL1_21 = WHERE id = ? +9 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_1 = UPDATE vehicle SET vehicle_texture = ?, last_updated_at = NOW() WHERE id = ? SQL1_INPUTS = 1,2 [vehicleSetPinCode] -SQL1_1 = UPDATE vehicle SET pin_code = ? WHERE id = ? +SQL1_1 = UPDATE vehicle SET pin_code = ?, last_updated_at = NOW() WHERE id = ? SQL1_INPUTS = 1,2 @@ -297,9 +299,10 @@ 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 +SQL1_13 = territory_id = $CUSTOM_1$ +1 +Number of Custom Inputs = 1 +SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11 Return InsertID = true [deleteConstruction] @@ -325,22 +328,22 @@ SQL1_1 = SELECT COUNT(*) FROM construction OUTPUT = 1 [constructionSetPinCode] -SQL1_1 = UPDATE construction SET pin_code= ? WHERE id = ? +SQL1_1 = UPDATE construction SET pin_code= ?, last_updated_at = NOW() WHERE id = ? SQL1_INPUTS = 1,2 [upgradeObject] -SQL1_1 = UPDATE construction SET class=? WHERE id = ? +SQL1_1 = UPDATE construction SET class = ?, last_updated_at = NOW() WHERE id = ? SQL1_INPUTS = 1,2 [addDoorLock] -SQL1_1 = UPDATE construction SET pin_code = ?,is_locked = -1 WHERE id = ? +SQL1_1 = UPDATE construction SET pin_code = ?, is_locked = -1, last_updated_at = NOW() WHERE id = ? SQL1_INPUTS = 1,2 [updateLock] -SQL1_1 = UPDATE construction SET is_locked = ? WHERE id = ? +SQL1_1 = UPDATE construction SET is_locked = ?, last_updated_at = NOW() WHERE id = ? SQL1_INPUTS = 1,2 @@ -350,7 +353,7 @@ SQL1_1 = UPDATE construction SET territory_id = ? WHERE id IN(?) SQL1_INPUTS = 1,2 [updateDamage] -SQL1_1 = UPDATE construction SET damage = ? WHERE id = ? +SQL1_1 = UPDATE construction SET damage = ?, last_updated_at = NOW() WHERE id = ? SQL1_INPUTS = 1,2 @@ -377,9 +380,10 @@ 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 +SQL1_19 = territory_id = $CUSTOM_1$ +7 +Number of Custom Inputs = 1 +SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 Return InsertID = true [deleteContainer] @@ -421,13 +425,16 @@ 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 +SQL1_16 = territory_id = $CUSTOM_1$, +SQL1_17 = money = ?, +SQL1_18 = last_updated_at = NOW() +SQL1_19 = WHERE id = ? +6 +Number of Custom Inputs = 1 +SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 [containerSetPinCode] -SQL1_1 = UPDATE container SET pin_code= ? WHERE id = ? +SQL1_1 = UPDATE container SET pin_code= ?, last_updated_at = NOW() WHERE id = ? SQL1_INPUTS = 1,2 @@ -512,9 +519,10 @@ 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 =? , build_rights = ? , moderators = ? - -SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,12-NULL,10,11 +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 =$CUSTOM_1$ , build_rights = ? , moderators = ? +1 +Number Of Custom Inputs = 1 +SQL1_INPUTS = 1,2,3,4,5,6,7,8,9,10,11 Return InsertID = true [loadTerriotryIdPage] @@ -524,10 +532,11 @@ 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_1 = SET @connector = ?; +SQL2_1 = SELECT id,owner_uid,name,position_x,position_y,position_z,radius, level,flag_texture,flag_stolen,flag_stolen_by_uid,last_paid_at,build_rights,moderators,deleted_at,(SELECT COUNT(*)FROM construction c WHERE c.territory_id = @connector) FROM territory WHERE id = @connector -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 +SQL1_INPUTS = 1 +OUTPUT = 1,2-STRING,3-STRING,4,5,6,7,8,9-STRING,10,11-STRING,12-DateTime_ISO8601,13,14,15,16 [setTerritoryLevel] SQL1_1 = UPDATE territory SET level = ? WHERE id = ? @@ -587,7 +596,7 @@ 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_1 = UPDATE construction SET deleted_at = NOW() WHERE spawned_at < DATE_SUB(NOW(), INTERVAL ? DAY) AND territory_id IS NULL AND deleted_at IS NULL SQL1_INPUTS = 1 @@ -612,8 +621,9 @@ 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) +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) WHERE construction.territory_id 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) WHERE container.territory_id IS NOT NULL + SQL1_INPUTS = 1 ; Removes territories (and all containers/constructions) that were not paid within ? days @@ -634,7 +644,7 @@ 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)); +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 @@ -656,12 +666,12 @@ SQL1_INPUTS = 1 OUTPUT = 1 [setContainerMoney] -SQL1_1 = UPDATE container SET money = ? WHERE id = ? +SQL1_1 = UPDATE container SET money = ?, last_updated_at = NOW() WHERE id = ? SQL1_INPUTS = 1,2 [setVehicleMoney] -SQL1_1 = UPDATE vehicle SET money = ? WHERE id = ? +SQL1_1 = UPDATE vehicle SET money = ?, last_updated_at = NOW() WHERE id = ? SQL1_INPUTS = 1,2 @@ -676,5 +686,5 @@ SQL1_INPUTS = 1 [setTerritoryNotified] SQL1_1 = UPDATE territory SET xm8_protectionmoney_notified = ? WHERE id = ? - +Number of Inputs = 2 SQL1_INPUTS = 1,2