Advertisement
Guest User

Untitled

a guest
Jun 7th, 2015
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 7.54 KB | None | 0 0
  1. [Default]
  2. Version = 4
  3.  
  4. Number of Inputs = 0
  5.  
  6. Sanitize Value Check = false
  7.  
  8. String Datatype Check = false
  9. ; Add Quotations around Text / VarChar DataTypes when retrieving Values
  10. ;   Note: This Doesn't Work for  Text DataTypes for MySQL1
  11. ; This is mainly a legacy option to provide similar behaviour as older DB_CUSTOM_V2/3
  12.  
  13. Bad Chars = `/\|;{}<>'
  14. ; Can't Strip Char : since its used as a divider in extDB.
  15. ; If you need it stripped you will need todo it in SQF Code.
  16. ;   Note: if value contains divider :
  17. ;       It will result in extDB reading to many input values + will return an error anyway.
  18.  
  19. ;   Important if you are using $INPUT_STRING_x, recommended you strip the char `
  20. ;       That is the quotation char used to wrap strings
  21.  
  22. Bad Chars Action = STRIP
  23. ; Actions   STRIP / NONE
  24. ;  
  25.  
  26. ;; $INPUT_x = normal value
  27. ;; $INPUT_STRING_x =  " + value(stripped char ") + "    
  28. ;;      i.e "omg"it"stupid" ->  "omgitstupid"  etc
  29. ;; $INPUT_BEGUID_x = value converted to BEGuid i.e send it player guid + it will convert it to beguid.
  30.  
  31. ; --------------------------------------------------------------------------------
  32. ; DB INFO
  33. ; --------------------------------------------------------------------------------
  34.  
  35. [getDBVersion]
  36. SQL1_1 = SELECT IFNULL ((SELECT Value FROM DBInfo WHERE Name = 'Version'), '2.03');
  37.  
  38. ; --------------------------------------------------------------------------------
  39. ; SERVER INSTANCE & MAP
  40. ; --------------------------------------------------------------------------------
  41.  
  42. [checkServerInstance]
  43. SQL1_1 = SELECT IF ((SELECT 1 FROM ServerInstance WHERE ID = '$INPUT_1'), 'true', 'false');
  44.  
  45. Number of Inputs = 1
  46.  
  47. [insertServerInstance]
  48. SQL1_1 = INSERT INTO ServerInstance SET ID = '$INPUT_1';
  49.  
  50. Number of Inputs = 1
  51.  
  52. [getServerMapID]
  53. SQL1_1 = SELECT IFNULL ((SELECT ID FROM ServerMap WHERE WorldName = '$INPUT_1' AND Environment = '$INPUT_2'), 0);
  54.  
  55. Number of Inputs = 2
  56.  
  57. [insertServerMap]
  58. SQL1_1 = INSERT INTO ServerMap SET WorldName = '$INPUT_1', Environment = '$INPUT_2';
  59. SQL2_1 = SELECT LAST_INSERT_ID();
  60.  
  61. Number of Inputs = 2
  62.  
  63. ; --------------------------------------------------------------------------------
  64. ; PLAYER SAVING
  65. ; --------------------------------------------------------------------------------
  66.  
  67. [checkPlayerSave]
  68. SQL1_1 = SELECT IF ((SELECT 1 FROM PlayerSave WHERE PlayerUID = '$INPUT_1' AND MapID = $INPUT_2), 'true', 'false');
  69.  
  70. Number of Inputs = 2
  71.  
  72. [getPlayerSave]
  73. SQL1_1 = SELECT $INPUT_3 FROM PlayerSave WHERE PlayerUID = '$INPUT_1' AND MapID = $INPUT_2;
  74.  
  75. Bad Chars = `/\|;{}<>
  76. Number of Inputs = 3
  77.  
  78. [getPlayerBankMoney]
  79. SQL1_1 = SELECT BankMoney FROM PlayerInfo WHERE UID = '$INPUT_1';
  80.  
  81. Number of Inputs = 1
  82.  
  83. [insertOrUpdatePlayerInfo]
  84. SQL1_1 = INSERT INTO PlayerInfo SET UID = '$INPUT_1', BattlEyeGUID = REPLACE('$INPUT_BEGUID_1', '"', ''), $INPUT_2
  85. SQL1_2 = ON DUPLICATE KEY UPDATE $INPUT_3;
  86.  
  87. Bad Chars = `/\|;{}<>
  88. Number of Inputs = 3
  89.  
  90. [insertOrUpdatePlayerSave]
  91. SQL1_1 = INSERT INTO PlayerSave SET PlayerUID = '$INPUT_1', MapID = $INPUT_2, CreationDate = NOW(), $INPUT_3
  92. SQL1_2 = ON DUPLICATE KEY UPDATE $INPUT_4;
  93.  
  94. Bad Chars = `/\|;{}<>
  95. Number of Inputs = 4
  96.  
  97. [deletePlayerSave]
  98. SQL1_1 = DELETE FROM PlayerSave WHERE PlayerUID = '$INPUT_1' AND MapID = $INPUT_2;
  99.  
  100. Number of Inputs = 2
  101.  
  102. [insertOrUpdatePlayerStats]
  103. SQL1_1 = INSERT INTO PlayerStats SET PlayerUID = '$INPUT_1', $INPUT_4 = $INPUT_5
  104. SQL1_2 = ON DUPLICATE KEY UPDATE $INPUT_4 = $INPUT_4 + $INPUT_5;
  105. SQL2_1 = INSERT INTO PlayerStatsMap SET PlayerUID = '$INPUT_1', ServerID = $INPUT_2, MapID = $INPUT_3, $INPUT_4 = $INPUT_5
  106. SQL2_2 = ON DUPLICATE KEY UPDATE $INPUT_4 = $INPUT_4 + $INPUT_5;
  107.  
  108. Number of Inputs = 5
  109.  
  110. ; --------------------------------------------------------------------------------
  111. ; WARCHEST
  112. ; --------------------------------------------------------------------------------
  113.  
  114. [getWarchestMoney]
  115. SQL1_1 = SELECT WarchestMoneyBLUFOR, WarchestMoneyOPFOR FROM ServerInstance WHERE ID = $INPUT_1;
  116.  
  117. Number of Inputs = 1
  118.  
  119. [updateWarchestMoney]
  120. SQL1_1 = UPDATE ServerInstance SET WarchestMoneyBLUFOR = $INPUT_2, WarchestMoneyOPFOR = $INPUT_3 WHERE ID = $INPUT_1;
  121.  
  122. Number of Inputs = 3
  123.  
  124. ; --------------------------------------------------------------------------------
  125. ; OBJECT SAVING
  126. ; --------------------------------------------------------------------------------
  127.  
  128. [getServerObjects]
  129. SQL1_1 = SELECT $INPUT_3 FROM ServerObjects WHERE ServerID = $INPUT_1 AND MapID = $INPUT_2;
  130.  
  131. Number of Inputs = 3
  132.  
  133. [newServerObject]
  134. SQL1_1 = INSERT INTO ServerObjects SET ServerID = $INPUT_1, MapID = $INPUT_2, CreationDate = NOW();
  135. SQL2_1 = SELECT LAST_INSERT_ID();
  136.  
  137. Number of Inputs = 2
  138.  
  139. [updateServerObject]
  140. SQL1_1 = UPDATE ServerObjects SET $INPUT_2 WHERE ID = $INPUT_1;
  141.  
  142. Bad Chars = `/\|;{}<>
  143. Number of Inputs = 2
  144.  
  145. [deleteServerObjects]
  146. SQL1_1 = DELETE FROM ServerObjects WHERE ID IN ($INPUT_1);
  147.  
  148. Number of Inputs = 1
  149.  
  150. [deleteExpiredServerObjects]
  151. SQL1_1 = DELETE FROM ServerObjects WHERE ServerID = $INPUT_1 AND MapID = $INPUT_2
  152. SQL1_2 =    AND (($INPUT_3 > 0 AND TIMESTAMPDIFF(HOUR, LastInteraction, NOW()) > $INPUT_3)
  153. SQL1_3 =         OR ($INPUT_4 <= 0 AND Locked = 0 AND Deployable = 0)
  154. SQL1_4 =         OR Damage >= 1);
  155.  
  156. Number of Inputs = 4
  157.  
  158. ; --------------------------------------------------------------------------------
  159. ; VEHICLE SAVING
  160. ; --------------------------------------------------------------------------------
  161.  
  162. [getServerVehicles]
  163. SQL1_1 = SELECT $INPUT_3 FROM ServerVehicles WHERE ServerID = $INPUT_1 AND MapID = $INPUT_2;
  164.  
  165. Number of Inputs = 3
  166.  
  167. [newServerVehicle]
  168. SQL1_1 = INSERT INTO ServerVehicles SET ServerID = $INPUT_1, MapID = $INPUT_2, CreationDate = NOW();
  169. SQL2_1 = SELECT LAST_INSERT_ID();
  170.  
  171. Number of Inputs = 2
  172.  
  173. [updateServerVehicle]
  174. SQL1_1 = UPDATE ServerVehicles SET $INPUT_2 WHERE ID = $INPUT_1;
  175.  
  176. Bad Chars = `/|;{}<>
  177. Number of Inputs = 2
  178.  
  179. [deleteServerVehicles]
  180. SQL1_1 = DELETE FROM ServerVehicles WHERE ID IN ($INPUT_1);
  181.  
  182. Number of Inputs = 1
  183.  
  184. [deleteExpiredServerVehicles]
  185. SQL1_1 = DELETE FROM ServerVehicles WHERE ServerID = $INPUT_1 AND MapID = $INPUT_2
  186. SQL1_2 =    AND (($INPUT_3 > 0 AND TIMESTAMPDIFF(HOUR, CreationDate, NOW()) > $INPUT_3)
  187. SQL1_3 =         OR ($INPUT_4 > 0 AND TIMESTAMPDIFF(HOUR, LastUsed, NOW()) > $INPUT_4)
  188. SQL1_4 =         OR Damage >= 0.99);
  189.  
  190. Number of Inputs = 4
  191.  
  192. ; --------------------------------------------------------------------------------
  193. ; LOGGING
  194. ; --------------------------------------------------------------------------------
  195.  
  196. [addAdminLog]
  197. SQL1_1 = INSERT INTO AdminLog (ServerID, PlayerName, PlayerUID, BattlEyeGUID, ActionType, ActionValue)
  198. SQL1_2 =    VALUES ($INPUT_1, '$INPUT_2', '$INPUT_3', REPLACE('$INPUT_BEGUID_3', '"', ''), '$INPUT_STRING_4', '$INPUT_STRING_5');
  199.  
  200. Number of Inputs = 5
  201.  
  202. [addAntihackLog]
  203. SQL1_1 = INSERT INTO AntihackLog (ServerID, PlayerName, PlayerUID, BattlEyeGUID, HackType, HackValue)
  204. SQL1_2 =    VALUES ($INPUT_1, '$INPUT_2', '$INPUT_3', REPLACE('$INPUT_BEGUID_3', '"', ''), '$INPUT_STRING_4', '$INPUT_STRING_5');
  205.  
  206. Number of Inputs = 5
  207.  
  208. [getAntihackEntry]
  209. SQL1_1 = SELECT '""', HackType FROM AntihackLog WHERE PlayerUID = '$INPUT_1' AND KickOnJoin = 1 LIMIT 1;
  210. ; First column was supposed to be CONCAT('"',PlayerName,'"'), but current scripts don't make use of it, so it's not really needed
  211.  
  212. Number of Inputs = 1
  213.  
  214. [addBankTransferLog]
  215. SQL1_1 = INSERT INTO BankTransferLog (ServerID, SenderName, SenderUID, SenderSide, RecipientName, RecipientUID, RecipientSide, Amount, Fee)
  216. SQL1_2 =    VALUES ($INPUT_1, '$INPUT_2', '$INPUT_3', '$INPUT_4', '$INPUT_5', '$INPUT_6', '$INPUT_7', $INPUT_8, $INPUT_9);
  217.  
  218. Number of Inputs = 9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement