Jump to content

arthurluna

Members
  • Posts

    12
  • Joined

  • Last visited

arthurluna's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. TIBIA ... items are cloned into games that need to be eliminated.
  2. This system is in LUA programming The afunção this system is to check in player_items, player_deposit, tile_items, if there are items with the same serial number, items with the same serial number on the tables, will be excluded .. a line for each serial number.
  3. Here is all code: local function Antidupe()-- USAR FROM 62 OU 70 ELE VAI PEGAR APARTIR DO 62 ou 70 CARACTERSlocal tablesToCheck = {"player_items", "player_depotitems", "tile_items"}local itemsToCheck = {2523}local text, final = "", ""local filex = "data/logs/Duplicated.txt"local f = io.open(filex, "a+")local count = 0local Caracters = 70for i = 1, table.maxn(tablesToCheck) dofor _, item in ipairs(itemsToCheck) do if(type(tablesToCheck[i]) == "string") thenlocal query = db.getResult("SELECT *, SUBSTRING(CONVERT(attributes USING latin1) FROM "..Caracters..") AS 'track' FROM " .. tablesToCheck[i] .. " WHERE itemtype = "..item.." AND SUBSTRING(CONVERT(attributes USING latin1) FROM "..Caracters..") IN (SELECT SUBSTRING(CONVERT(attributes USING latin1) FROM "..Caracters..") FROM " .. tablesToCheck[i] .. " WHERE CONVERT(attributes USING latin1) LIKE '%serial%' GROUP BY SUBSTRING(CONVERT(attributes USING latin1) FROM "..Caracters..") HAVING COUNT(*) > 0)")if(query:getID() < 1) thenprint("[!] [Anti-Dupe] -> No duplicated item was found in the database!")endif(query:getID() ~= -1) thenwhile(true) dolocal delete = db.executeQuery("DELETE FROM " .. tablesToCheck[i] .. " WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM "..Caracters..") = " .. db.escapeString(query:getDataString("track")) .. ";") text = "[!] [Anti-Dupe] -> Deleting item with duplicated serial from '" .. tablesToCheck[i] .. "' [Player: " .. getPlayerNameByGUID(query:getDataInt("player_id")) .. ", Item: " .. query:getDataInt("itemtype") .. ", Count: " .. query:getDataInt("count") .. ", Serial: " .. query:getDataString("track") .."]... " .. (delete and "Success!" or "Failed!")count = (delete and count + 1 or count)final = final .. (final ~= "" and "n" or "") .. textprint(text)if not query:next() then break endend endendendendif(f ~= nil) thenf:write("[" .. os.date("%d %B %Y Hora: %X") .. "] >> [Anti-Dupe] " .. count .. " duplicated items have been deleted from the database.n" .. (final == "" and "[!] [Anti-Dupe] -> No duplicated item was found in the database" or final) .. "nn")f:close()elseprint("[!] [Anti-Dupe] -> Cannot save info to file!")endreturn trueendfunction onSay(cid, words, param)Antidupe()return trueend
  4. I want to delete lines with the same feature, leaving only 1 line
  5. 100 are existing products with the same serial number, after use local delete = db.executeQuery("DELETE FROM " .. tablesToCheck[i] .. " WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM "..Caracters..") = " .. db.escapeString(query:getDataString("track")) .. ";") Continue to exist a single product with a number of serious, the other duplicates will be deleted. A product with unique serial number is only permitted, existing more than 1 will be deleted. EX: 100 Products 100 = 100-99 = 1 - Products Must remain only one item with the same serial LINK DATBASE: local function Antidupe()-- USAR FROM 62 OU 70 ELE VAI PEGAR APARTIR DO 62 ou 70 CARACTERSlocal tablesToCheck = {"player_items", "player_depotitems", "tile_items"}local itemsToCheck = {2523}local text, final = "", ""local filex = "data/logs/Duplicated.txt"local f = io.open(filex, "a+")local count = 0local Caracters = 70for i = 1, table.maxn(tablesToCheck) dofor _, item in ipairs(itemsToCheck) do if(type(tablesToCheck[i]) == "string") thenlocal query = db.getResult("SELECT *, SUBSTRING(CONVERT(attributes USING latin1) FROM "..Caracters..") AS 'track' FROM " .. tablesToCheck[i] .. " WHERE itemtype = "..item.." AND SUBSTRING(CONVERT(attributes USING latin1) FROM "..Caracters..") IN (SELECT SUBSTRING(CONVERT(attributes USING latin1) FROM "..Caracters..") FROM " .. tablesToCheck[i] .. " WHERE CONVERT(attributes USING latin1) LIKE '%serial%' GROUP BY SUBSTRING(CONVERT(attributes USING latin1) FROM "..Caracters..") HAVING COUNT(*) > 0)")if(query:getID() < 1) thenprint("[!] [Anti-Dupe] -> No duplicated item was found in the database!")endif(query:getID() ~= -1) thenwhile(true) dolocal delete = db.executeQuery("DELETE FROM " .. tablesToCheck[i] .. " WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM "..Caracters..") = " .. db.escapeString(query:getDataString("track")) .. ";") text = "[!] [Anti-Dupe] -> Deleting item with duplicated serial from '" .. tablesToCheck[i] .. "' [Player: " .. getPlayerNameByGUID(query:getDataInt("player_id")) .. ", Item: " .. query:getDataInt("itemtype") .. ", Count: " .. query:getDataInt("count") .. ", Serial: " .. query:getDataString("track") .."]... " .. (delete and "Success!" or "Failed!")count = (delete and count + 1 or count)final = final .. (final ~= "" and "n" or "") .. textprint(text)if not query:next() then break endend endendendendif(f ~= nil) thenf:write("[" .. os.date("%d %B %Y Hora: %X") .. "] >> [Anti-Dupe] " .. count .. " duplicated items have been deleted from the database.n" .. (final == "" and "[!] [Anti-Dupe] -> No duplicated item was found in the database" or final) .. "nn")f:close()elseprint("[!] [Anti-Dupe] -> Cannot save info to file!")endreturn trueendfunction onSay(cid, words, param)Antidupe()return trueend
  6. so please tell us which company.
  7. About Anti sql injection, there is a way to hedge, I use modern acc, could send my website to you measure the level of security is database?
  8. Today can not rely on the internet and not in people, there are people who steal hackean site and malice, I think security against this kind of thing is never more.
  9. I thought I could encrypt html codes ... is there any way?
  10. have any way to disable view-source:Namehost, causing the index codes are not copied?
×
×
  • Create New...