SHARE
TWEET

Untitled

a guest Feb 17th, 2017 127 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [Default]
  2. Version = 1  
  3. ;; Used incase there is ever a breaking change, or to inform user in log about a new feature.
  4.  
  5. ;;Strip Chars = "/\|;{}<>'"
  6. Strip Chars = /\|;{}<>
  7. ;; List of characters to strip out  
  8. Strip Chars Mode = 0
  9. ;; 0 = Strip Bad Chars, 1 = Strip + Log Bad Chars, 2 = Return Error & Log Bad Chars  
  10. ;;     Note: Logging on works when sending data to database.
  11.  
  12. Input SQF Parser = false  
  13. ;; Expermential  
  14. ;;   If enabled will use SQF Array Parser instead of : seperator for values  
  15. ;;   i.e   0:SQL:UpdatePlayer:["Joe",[1,2,0],0.22333,"PlayerBackpack",-3]  
  16. ;;   Advantage is that you don't need to strip : seperator from user inputted values  
  17.  
  18.  
  19.  
  20. ; --------------------------------------------------------------------------------
  21. ; DB INFO
  22. ; --------------------------------------------------------------------------------
  23.  
  24. [getDBVersion]
  25. Prepared Statement = false
  26.  
  27. SQL1_1 = SELECT IFNULL ((SELECT Value FROM DBInfo WHERE Name = 'Version'), '2.0');
  28.  
  29.  
  30. ; --------------------------------------------------------------------------------
  31. ; SERVER INSTANCE & MAP
  32. ; --------------------------------------------------------------------------------
  33.  
  34. [checkServerInstance]
  35. Prepared Statement = false
  36.  
  37. SQL1_1 = SELECT IF ((SELECT 1 FROM ServerInstance WHERE ID = $CUSTOM_1$), 'true', 'false');
  38. SQL1_INPUTS = 1
  39.  
  40. [insertServerInstance]
  41. Prepared Statement = false
  42.  
  43. SQL1_1 = INSERT INTO ServerInstance SET ID = $CUSTOM_1$;
  44. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE
  45.  
  46. [getServerMapID]
  47. Prepared Statement = false
  48.  
  49. SQL1_1 = SELECT IFNULL ((SELECT ID FROM ServerMap WHERE WorldName = "$CUSTOM_1$" AND Environment = "$CUSTOM_2$"), 0);
  50. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP-MYSQL_ESCAPE
  51.  
  52. [insertServerMap]
  53. Prepared Statement = false
  54. Return InsertID = true
  55.  
  56. SQL1_1 = INSERT INTO ServerMap SET WorldName = "$CUSTOM_1$", Environment = "$CUSTOM_2$";
  57. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP-MYSQL_ESCAPE
  58.  
  59. ; --------------------------------------------------------------------------------
  60. ; PLAYER SAVING
  61. ; --------------------------------------------------------------------------------
  62.  
  63. [checkPlayerSave]
  64. SQL1_1 = SELECT IF ((SELECT 1 FROM PlayerSave WHERE PlayerUID = ? AND MapID = ?), 'true', 'false');
  65. SQL1_INPUTS = 1,2
  66.  
  67. [checkPlayerSaveXMap]
  68. SQL1_1 = SELECT IF ((SELECT 1 FROM PlayerSave ps INNER JOIN (SELECT ID AS ServerMapID FROM ServerMap WHERE Environment = ?) sm
  69. SQL1_2 =             WHERE PlayerUID = ? AND ps.MapID = sm.ServerMapID GROUP BY 1), 'true', 'false');
  70. SQL1_INPUTS = 2,1
  71.  
  72. [getPlayerSave]
  73. Prepared Statement = false
  74.  
  75. SQL1_1 = SELECT $CUSTOM_3$ FROM PlayerSave WHERE PlayerUID = "$CUSTOM_1$" AND MapID = "$CUSTOM_2$";
  76. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP-MYSQL_ESCAPE, 3-STRIP
  77.  
  78. [getPlayerSaveXMap]
  79. Prepared Statement = false
  80.  
  81. SQL1_1 = SELECT $CUSTOM_3$ FROM PlayerSave ps INNER JOIN (SELECT ID AS ServerMapID FROM ServerMap WHERE Environment = "$CUSTOM_1$") sm
  82. SQL1_2 = WHERE PlayerUID = "$CUSTOM_2$" AND ps.MapID = sm.ServerMapID
  83. SQL1_3 = ORDER BY LastModified DESC LIMIT 1;
  84.  
  85. SQL1_INPUTS = 2-STRIP-MYSQL_ESCAPE, 1-STRIP-MYSQL_ESCAPE, 3-MYSQL_ESCAPE
  86.  
  87. [getPlayerBankMoney]
  88. SQL1_1 = SELECT BankMoney FROM PlayerInfo WHERE UID = ?;
  89.  
  90. SQL1_INPUTS = 1
  91.  
  92. [getPlayerBounty]
  93. SQL1_1 = SELECT Bounty, BountyKills FROM PlayerInfo WHERE UID = ?;
  94.  
  95. SQL1_INPUTS = 1
  96.  
  97. [getTimeSinceServerSwitch]
  98. SQL1_1 = SELECT TIMESTAMPDIFF(SECOND, LastModified, NOW()), LastServerID FROM PlayerSave
  99. SQL1_2 = WHERE PlayerUID = ? AND MapID = ? AND LastServerID != ? AND LastServerID IS NOT NULL;
  100.  
  101. SQL1_INPUTS = 1,2,3
  102.  
  103. [getTimeSinceServerSwitchXMap]
  104. SQL1_1 = SELECT TIMESTAMPDIFF(SECOND, LastModified, NOW()), LastServerID, WorldName
  105. SQL1_2 = FROM PlayerSave ps INNER JOIN (SELECT ID AS ServerMapID, WorldName FROM ServerMap WHERE Environment = ?) sm
  106. SQL1_3 = WHERE PlayerUID = ? AND ps.MapID = sm.ServerMapID AND LastServerID != ? AND LastServerID IS NOT NULL
  107. SQL1_4 = ORDER BY LastModified DESC LIMIT 1;
  108.  
  109. SQL1_INPUTS = 2,1,3
  110.  
  111. [insertOrUpdatePlayerInfo]
  112. Prepared Statement = false
  113.  
  114. SQL1_1 = INSERT INTO PlayerInfo SET UID = "$CUSTOM_1$", BattlEyeGUID = REPLACE("$CUSTOM_2$",'"',''), $CUSTOM_3$
  115. SQL1_2 = ON DUPLICATE KEY UPDATE $CUSTOM_4$;
  116.  
  117. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 1-BEGUID, 2-STRIP, 3-STRIP
  118.  
  119.  
  120. [insertOrUpdatePlayerSave]
  121. Prepared Statement = false
  122.  
  123. SQL1_1 = INSERT INTO PlayerSave SET PlayerUID = "$CUSTOM_1$", MapID = "$CUSTOM_2$", LastServerID = "$CUSTOM_3$", CreationDate = NOW(), $CUSTOM_4$
  124. SQL1_2 = ON DUPLICATE KEY UPDATE LastServerID = VALUES(LastServerID), $CUSTOM_5$;
  125.  
  126. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP-MYSQL_ESCAPE, 3-STRIP-MYSQL_ESCAPE, 4-STRIP, 5-STRIP
  127.  
  128.  
  129. [deletePlayerSave]
  130. SQL1_1 = DELETE FROM PlayerSave WHERE PlayerUID = ? AND MapID = ?;
  131.  
  132. SQL1_INPUTS = 1,2
  133.  
  134. [deletePlayerSaveXMap]
  135. SQL1_1 = DELETE ps FROM PlayerSave ps INNER JOIN (SELECT ID AS ServerMapID FROM ServerMap WHERE Environment = ?) sm
  136. SQL1_2 = WHERE PlayerUID = ? AND ps.MapID = sm.ServerMapID;
  137.  
  138. SQL1_INPUTS = 2,1
  139.  
  140. [getPlayerStats]
  141. Prepared Statement = false
  142.  
  143. SQL1_1 = SELECT $CUSTOM_2$ FROM PlayerStats WHERE PlayerUID = $CUSTOM_1$;
  144.  
  145. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP
  146.  
  147. [insertOrUpdatePlayerStats]
  148. Prepared Statement = false
  149.  
  150. SQL1_1 = INSERT INTO PlayerStats SET PlayerUID = "$CUSTOM_1$", $CUSTOM_2$ = "$CUSTOM_3$"
  151. SQL1_2 = ON DUPLICATE KEY UPDATE $CUSTOM_2$ = $CUSTOM_2$ + "$CUSTOM_3$";
  152. SQL2_1 = INSERT INTO PlayerStatsMap SET PlayerUID = "$CUSTOM_1$", ServerID = "$CUSTOM_2$", MapID = "$CUSTOM_3$", $CUSTOM_4$ = "$CUSTOM_5$"
  153. SQL2_2 = ON DUPLICATE KEY UPDATE $CUSTOM_4$ = $CUSTOM_4$ + "$CUSTOM_5$";
  154.  
  155. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 4-STRIP-MYSQL_ESCAPE, 5-STRIP-MYSQL_ESCAPE
  156. SQL2_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP-MYSQL_ESCAPE, 3-STRIP-MYSQL_ESCAPE, 4-STRIP-MYSQL_ESCAPE, 5-STRIP-MYSQL_ESCAPE
  157.  
  158. ; --------------------------------------------------------------------------------
  159. ; PRIVATE STORAGE
  160. ; --------------------------------------------------------------------------------
  161.  
  162. [getPlayerStorage]
  163. Prepared Statement = false
  164.  
  165. SQL1_1 = SELECT $CUSTOM_3$ FROM PlayerStorage WHERE PlayerUID = "$CUSTOM_1$" AND MapID = "$CUSTOM_2$";
  166.  
  167. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP-MYSQL_ESCAPE, 3-STRIP
  168.  
  169. [getPlayerStorageXMap]
  170. Prepared Statement = false
  171.  
  172. SQL1_1 = SELECT $CUSTOM_3$ FROM PlayerStorage ps INNER JOIN (SELECT ID AS ServerMapID FROM ServerMap WHERE Environment = "%CUSTOM_1") sm
  173. SQL1_2 = WHERE PlayerUID = "$CUSTOM_2$" AND ps.MapID = sm.ServerMapID
  174. SQL1_3 = ORDER BY LastModified DESC LIMIT 1;
  175.  
  176. SQL1_INPUTS = 2-STRIP-MYSQL_ESCAPE, 1-STRIP-MYSQL_ESCAPE, 3-STRIP
  177.  
  178. [insertOrUpdatePlayerStorage]
  179. Prepared Statement = false
  180.  
  181. SQL1_1 = INSERT INTO PlayerStorage SET PlayerUID = "$CUSTOM_1$", MapID = "$CUSTOM_2$", CreationDate = NOW(), $CUSTOM_3$
  182. SQL1_2 = ON DUPLICATE KEY UPDATE $CUSTOM_4$;
  183.  
  184. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP-MYSQL_ESCAPE, 3-STRIP, 4-STRIP
  185.  
  186.  
  187. ; --------------------------------------------------------------------------------
  188. ; WARCHEST
  189. ; --------------------------------------------------------------------------------
  190.  
  191. [getWarchestMoney]
  192. Prepared Statement = false
  193.  
  194. SQL1_1 = SELECT WarchestMoneyBLUFOR, WarchestMoneyOPFOR FROM ServerInstance WHERE ID = "$CUSTOM_1$";
  195.  
  196. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE
  197.  
  198. [updateWarchestMoney]
  199. SQL1_1 = UPDATE ServerInstance SET WarchestMoneyBLUFOR = ?, WarchestMoneyOPFOR = ? WHERE ID = ?;
  200.  
  201. SQL1_INPUTS = 2,3,1
  202.  
  203. ; --------------------------------------------------------------------------------
  204. ; SERVER TIME
  205. ; --------------------------------------------------------------------------------
  206.  
  207. [getServerTime]
  208. Prepared Statement = false
  209.  
  210. SQL1_1 = SELECT DayTime, Fog, Overcast, Rain, Wind FROM ServerTime WHERE ServerID = "$CUSTOM_1$" AND MapID = "$CUSTOM_2$";
  211.  
  212. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP-MYSQL_ESCAPE
  213.  
  214. [insertOrUpdateServerTime]
  215. SQL1_1 = INSERT INTO ServerTime SET ServerID = ?, MapID = ?, DayTime = ?, Fog = ?, Overcast = ?, Rain = ?, Wind = ?
  216. SQL1_2 = ON DUPLICATE KEY UPDATE DayTime = VALUES(DayTime), Fog = VALUES(Fog), Overcast = VALUES(Overcast), Rain = VALUES(Rain), Wind = VALUES(Wind);
  217.  
  218. SQL1_INPUTS = 1,2,3,4,5,6,7
  219.  
  220. ; --------------------------------------------------------------------------------
  221. ; OBJECT SAVING
  222. ; --------------------------------------------------------------------------------
  223.  
  224. [getServerObjects]
  225. Prepared Statement = false
  226.  
  227. SQL1_1 = SELECT $CUSTOM_3$ FROM ServerObjects WHERE ServerID = "$CUSTOM_1$" AND MapID = "$CUSTOM_2$";
  228.  
  229. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP-MYSQL_ESCAPE, 3-STRIP
  230.  
  231. [newServerObject]
  232. SQL1_1 = INSERT INTO ServerObjects SET ServerID = ?, MapID = ?, CreationDate = NOW();
  233. SQL2_1 = SELECT QUOTE(LAST_INSERT_ID());
  234.  
  235. SQL1_INPUTS = 1,2
  236.  
  237. [updateServerObject]
  238. Prepared Statement = false
  239.  
  240. SQL1_1 = UPDATE ServerObjects SET $CUSTOM_2$ WHERE ID = "$CUSTOM_1$";
  241.  
  242. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP
  243.  
  244. [deleteServerObjects]
  245. Prepared Statement = false
  246.  
  247. SQL1_1 = DELETE FROM ServerObjects WHERE ID IN $CUSTOM_1$;
  248.  
  249. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE
  250.  
  251. [deleteExpiredServerObjects]
  252. Prepared Statement = false
  253.  
  254. SQL1_1 = DELETE FROM ServerObjects WHERE ServerID = "$CUSTOM_1$" AND MapID = "$CUSTOM_2$"
  255. SQL1_2 =    AND (($CUSTOM_3$ > 0 AND TIMESTAMPDIFF(HOUR, LastInteraction, NOW()) > $CUSTOM_4$)
  256. SQL1_3 =         OR ($CUSTOM_5$ <= 0 AND Locked < 1 AND Deployable < 1)
  257. SQL1_4 =         OR Damage >= 1);
  258.  
  259. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP-MYSQL_ESCAPE, 3-STRIP-MYSQL_ESCAPE, 3-STRIP-MYSQL_ESCAPE, 4-STRIP-MYSQL_ESCAPE
  260.  
  261. ; --------------------------------------------------------------------------------
  262. ; VEHICLE SAVING
  263. ; --------------------------------------------------------------------------------
  264.  
  265. [getServerVehicles]
  266. Prepared Statement = false
  267.  
  268. SQL1_1 = SELECT $CUSTOM_3$ FROM ServerVehicles WHERE ServerID = "$CUSTOM_1$" AND MapID = "$CUSTOM_2$" AND Parked < 1;
  269.  
  270. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP-MYSQL_ESCAPE, 3-STRIP
  271.  
  272. [newServerVehicle]
  273. SQL1_1 = INSERT INTO ServerVehicles SET ServerID = ?, MapID = ?, CreationDate = NOW();
  274. SQL2_1 = SELECT QUOTE(LAST_INSERT_ID());
  275.  
  276. SQL1_INPUTS = 1,2
  277.  
  278. [updateServerVehicle]
  279. Prepared Statement = false
  280.  
  281. SQL1_1 = UPDATE ServerVehicles SET $CUSTOM_2$ WHERE ID = "$CUSTOM_1$";
  282.  
  283. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP
  284.  
  285. [deleteServerVehicles]
  286. Prepared Statement = false
  287.  
  288. SQL1_1 = DELETE FROM ServerVehicles WHERE ID IN ($CUSTOM_1$);
  289.  
  290. SQL1_INPUTS = 1-STRIP
  291.  
  292. [deleteExpiredServerVehicles]
  293. Prepared Statement = false
  294.  
  295. SQL1_1 = DELETE FROM ServerVehicles WHERE ServerID = "$CUSTOM_1$" AND MapID = "$CUSTOM_2$" AND Parked < 1
  296. SQL1_2 =    AND (("$CUSTOM_3$" > 0 AND TIMESTAMPDIFF(HOUR, CreationDate, NOW()) > $CUSTOM_4$)
  297. SQL1_3 =         OR ($CUSTOM_5$ > 0 AND TIMESTAMPDIFF(HOUR, LastUsed, NOW()) > $CUSTOM_6$)
  298. SQL1_4 =         OR Damage >= 0.99);
  299.  
  300. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP-MYSQL_ESCAPE, 3-STRIP-MYSQL_ESCAPE, 3-STRIP-MYSQL_ESCAPE, 4-STRIP-MYSQL_ESCAPE, 4-STRIP-MYSQL_ESCAPE
  301.  
  302. [getParkedVehicles]
  303. Prepared Statement = false
  304.  
  305. SQL1_1 = SELECT $CUSTOM_3$ FROM ServerVehicles sv INNER JOIN (SELECT ID AS ServerMapID FROM ServerMap WHERE Environment = "$CUSTOM_1$") sm
  306. SQL1_2 = WHERE OwnerUID = "$CUSTOM_2$" AND Parked > 0 AND sv.MapID = sm.ServerMapID;
  307.  
  308. SQL1_INPUTS = 2-STRIP-MYSQL_ESCAPE, 1-STRIP-MYSQL_ESCAPE, 3-Strip
  309.  
  310. ; --------------------------------------------------------------------------------
  311. ; MINE SAVING
  312. ; --------------------------------------------------------------------------------
  313.  
  314. [getServerMines]
  315. Prepared Statement = false
  316.  
  317. SQL1_1 = SELECT $CUSTOM_3$ FROM ServerMines WHERE ServerID = "$CUSTOM_1$" AND MapID = "$CUSTOM_2$";
  318.  
  319. SQL1_INPUTS = 1-STRIP, 2-STRIP-MYSQL_ESCAPE, 3-STRIP-MYSQL_ESCAPE
  320.  
  321. [newServerMine]
  322. SQL1_1 = INSERT INTO ServerMines SET ServerID = ?, MapID = ?, CreationDate = NOW();
  323. SQL2_1 = SELECT QUOTE(LAST_INSERT_ID());
  324.  
  325. SQL1_INPUTS = 1,2
  326.  
  327. [updateServerMine]
  328. Prepared Statement = false
  329.  
  330. SQL1_1 = UPDATE ServerMines SET $CUSTOM_2$ WHERE ID = "$CUSTOM_1$";
  331.  
  332. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP
  333.  
  334.  
  335. [deleteServerMines]
  336. Prepared Statement = false
  337.  
  338. SQL1_1 = DELETE FROM ServerMines WHERE ID IN ($CUSTOM_1$);
  339.  
  340. SQL1_INPUTS = 1-STRIP
  341.  
  342. [deleteExpiredServerMines]
  343. Prepared Statement = false
  344.  
  345. SQL1_1 = DELETE FROM ServerMines WHERE ServerID = "$CUSTOM_1$" AND MapID = "$CUSTOM_2$"
  346. SQL1_2 =    AND ($CUSTOM_3$ > 0 AND TIMESTAMPDIFF(HOUR, LastInteraction, NOW()) > $CUSTOM_4$);
  347.  
  348. SQL1_INPUTS = 1-STRIP-MYSQL_ESCAPE, 2-STRIP-MYSQL_ESCAPE, 3-STRIP-MYSQL_ESCAPE, 3-STRIP-MYSQL_ESCAPE
  349.  
  350. ; --------------------------------------------------------------------------------
  351. ; LOGGING
  352. ; --------------------------------------------------------------------------------
  353.  
  354. [addAdminLog]
  355. SQL1_1 = INSERT INTO AdminLog (ServerID, PlayerName, PlayerUID, BattlEyeGUID, ActionType, ActionValue)
  356. SQL1_2 =    VALUES (?, ?, ?, REPLACE(?,'"',''), ?, ?);
  357.  
  358. SQL1_INPUTS = 1,2,3,3-STRING-BEGUID,4-STRING,5-STRING
  359.  
  360. [addAntihackLog]
  361. SQL1_1 = INSERT INTO AntihackLog (ServerID, PlayerName, PlayerUID, BattlEyeGUID, HackType, HackValue)
  362. SQL1_2 =    VALUES (?, ?, ?, REPLACE(?,'"',''), ?, ?);
  363.  
  364. SQL1_INPUTS = 1,2,3,3-STRING-BEGUID,4-STRING,5-STRING
  365.  
  366. [getAntihackEntry]
  367. SQL1_1 = SELECT QUOTE(PlayerName), HackType FROM AntihackLog WHERE PlayerUID = ? AND KickOnJoin > 0 LIMIT 1;
  368.  
  369. SQL1_INPUTS = 1
  370.  
  371. [addBankTransferLog]
  372. SQL1_1 = INSERT INTO BankTransferLog (ServerID, SenderName, SenderUID, SenderSide, RecipientName, RecipientUID, RecipientSide, Amount, Fee)
  373. SQL1_2 =    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);
  374.  
  375. SQL1_INPUTS = 1,2,3,4,5,6,7,8,9
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top