
leobrissac
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
leobrissac deu reputação a Hadggar em [NEW] Listão de Talkactions e Actions 2014Listão de Talkactions é Actions TK "2014"
--2011--
Nome do Tópico: Character Info
Autor: Doughell
Link do Tópico: http://tibiaking.com...character-info/
Comentário:
Nome do Tópico: Dungeon Finder
Autor: Guilherme
Link do Tópico: http://tibiaking.com...dungeon-finder/
Comentário:
Nome do Tópico: Gate System
Autor: Doughell
Link do Tópico: http://tibiaking.com...60-gate-system/
Comentário:
Nome do Tópico: Portal WoE
Autor: Doughell
Link do Tópico: http://tibiaking.com...353-portal-woe/
Comentário:
Nome do Tópico: Sistema de Forja
Autor: Lpz
Link do Tópico: http://tibiaking.com...stema-de-forja/
Comentário:
Nome do Tópico: [Action] Removedor de Frags
Autor: Matheus
Link do Tópico: http://tibiaking.com...vedor-de-frags/
Comentário:
Nome do Tópico: [Action] Stamina Doll
Autor: AgaSsI
Link do Tópico: http://tibiaking.com...s-stamina-doll/
Comentário:
Nome do Tópico: [Actions] Potions Baseadas no Level
Autor: AgaSsI
Link do Tópico: http://tibiaking.com...eadas-no-level/
Comentário:
Nome do Tópico: Gesior ACC - Postando Ticker in Game
Autor: Renato
Link do Tópico: http://tibiaking.com...ticker-in-game/
Comentário:
Nome do Tópico: Remover Pedra com Alavanca
Autor: Kimoszin
Link do Tópico: http://tibiaking.com/forum/topic/9261-action-remover-pedra-com-alavanca/
Comentário:
Nome do Tópico: [Action] Addons Em Quest
Autor: AgaSsI
Link do Tópico: http://tibiaking.com...dons-em-quests/
Comentário:
Nome do Tópico: Proibir Palavrões
Autor: Matheus
Link do Tópico: http://tibiaking.com...ibir-palavroes/
Comentário:
Nome do Tópico: Resete Sistem
Autor: macnowfhael
Link do Tópico: http://tibiaking.com...-resete-sistem/
Comentário:
Nome do Tópico: GOD que da BLESS
Autor: Matheus
Link do Tópico: http://tibiaking.com...bless-para-god/
Comentário:
Nome do Tópico: [Action] Scroll de Level
Autor: Augusto
Link do Tópico: http://tibiaking.com...croll-de-level/
Comentário:
Nome do Tópico: [Action] Sistema de Mineração
Autor: Matheus
Link do Tópico: http://tibiaking.com...a-de-mineracao/
Comentário:
Nome do Tópico: [TalkAction] Buy Aol
Autor: Kimoszin
Link do Tópico: http://tibiaking.com...action-buy-aol/
Comentário:
Nome do Tópico: [TalkAction] Addon Doll
Autor: Kimoszin
Link do Tópico: http://tibiaking.com...ion-addon-doll/
Comentário:
--2012,2013 & 2014--
[Action] Temple Cleaner Automatico
Autor: GodFather
Topico: Topico Official
Tipo: Action
[Action] Mount System 1.4 - 100% Inovador
Autor: Matheus
Topico: Topico Official
Tipo: Action
[Action] Item Que Da Experience e Dinheiro
Autor: Slaake
Topico: Topico Official
Tipo: Action
[Talkaction] Item Por Vocaçao
Autor: TonyPlyson
Topico: Topico Official
Tipo: Talkaction
[Talkaction] Shop System [!sell-!buy] Facil Configuraçao
Autor: Matheus
Topico: Topico Official
Tipo: Talkaction
[Talkaction] Comando Para Comprar Bless
Autor: Matheus
Topico: Topico Official
Tipo: Talkaction
[Talk] Comando Mute/Desmute
Autor: Vodkart
Topico: Topico Official
Tipo: Talkaction
[Talkaction] Pet System ! Tfs = 0.3.4
Autor: DevilMoon
Topico: Topico Official
Tipo: Talkaction
[Talkaction] Transformar
Autor: AvuEnja
Topico: Topico Official
Tipo: Talkaction
[Action] Quest Se O Player For Level (Desejado)+
Autor: TonyPlyson
Topico: Topico Official
Tipo: Action
[Action] Comprando Item Por Chest (Bau)
Autor: Slaake
Topico: Topico Official
Tipo: Action
[Action] Adquirindo Group Por Item
Autor: Slaake
Topico: Topico Official
Tipo: Action
[Action] Novo Gold
Autor: Slaake
Topico: Topico Official
Tipo: Action
[TalkAction] Magia Que Se Transforma Em Item
Autor: Slaake
Topico: Topico Official
Tipo: Talkaction
[Talkaction] Comprando Soul
Autor: Slaake
Topico: Topico Official
Tipo: Talkaction
[Talkaction] Comprando Premium Tile
Autor: Slaake
Topico: Topico Official
Tipo: Talkaction
[Talkaction] Comprando Uma Nova Vocation Por COmando
Autor: Slaake
Topico: Topico Official
Tipo: Talkaction
[Talkaction] Comprando ExperieNce Por Comando
Autor: Slaake
Topico: Topico Official
Tipo: Talkaction
[Talkaction] Addon Doll
Autor: Kimoszin
Topico: Topico Official
Tipo: Talkaction
[Action] Retirar Lixo e Ganhar Item
Autor: Kimoszin
Topico: Topico Official
Tipo: Action
[Action] Caça Niquel
Autor: EddyHavoc
Topico: Topico Official
Tipo: Action
[Action] Ramdom Box
Autor: EddyHavoc
Topico: Topico Official
Tipo: Action
[Talk] DeathList Para Server Sqlite 1.0
Autor: Vodk
art
Topico: Topico Official
Tipo: Talkaction
[Action] Aqua System
Autor: EddyHavoc
Topico: Topico Official
Tipo: Action
[Action] Lenhador - Lumber Jack
Autor: EddyHavoc
Topico: Topico Official
Tipo: Action
[Action] Quest De Addons Funcionando
Autor: EddyHavoc
Topico: Topico Official
Tipo: Action
[Talkaction] Create Teleport
Autor: SkyForever
Topico: Topico Official
Tipo: Talkaction
[Action] Desenterrando Mortos
Autor: Kimoszin
Topico: Topico Official
Tipo: Action
[Action] Mining System
Autor: Vittu
Topico: Topico Official
Tipo: Action
[Action] Quest que Ganha Crystal Coins Equivalente Ao Level
Autor: Renato
Topico: Topico Official
Tipo: Action
[Action] Alavanca de Itens Aleatória!
Autor: Halls Santos
Topico: Topico Official
Tipo: Action
[Action] Adicionar premium points ao usar x item
Autor: ViiTinG
Topico: Topico Official
Tipo: Action
[Action] Rare Candy
Autor: principe sharingan
Topico: Topico Official
Tipo: Action
[Action] Canoa em Movimento
Autor: ViiTinG
Topico: Topico Official
Tipo: Action
[Action] Item que faz poke selvagem aparecer
Autor: lucaslsre
Topico: Topico Official
Tipo: Action
[Talkactions] Sistema de Jail!
Autor: ScreMMo(eu)
Topico: Topico Official
Tipo: Talkaction
[Talkaction] [Proibir Palavras] Anti Divulgação
Autor: Absolute
Topico: Topico Official
Tipo: Talkaction
[Action] Trocar 100 Demon Dust's por demon armor
Autor: Vills
Topico: Topico Official
Tipo: Action
[Action] [TFS 1.0] Frag Remover
Autor: luanluciano93
Topico: Topico Official
Tipo: Action
[Talkaction] !addlevel [Comando para dar level]
Autor: Absolute
Topico: Topico Official
Tipo: Talkaction
[Talkaction] Mandar mensagem para a pasta do servidor
Autor: ViiTinG
Topico: Topico Official
Tipo: Talkaction
[Talkaction] Adicionar ou Remover VIP Do player
Autor ViiTinG
Topico: Topico Official
Tipo: Talkaction
Creditos: Jeff Owns - 35% Topico de 2012 & 2013 ScreMMo(Eu) - 30% do topico, adicionei os novos topicos Doughell - 35 - Topico de 2011 GOSTOU? REP+
-
leobrissac deu reputação a 9k22 em (resolvido) Contas inativas serem excluidas automaticamenteNenhum faz o seguinte, ele deleta altomaticamente:
Em globalevents/script coloca:
------------------------------------------------------------------------------* ----- [[> Automated Database Cleanup 1.1 Structure //By Cybermaster <]] ------| -------------- [[> System 2.0 Revamped by Teh Maverick <3 <]] ----------------| ------------- [[> Removal of empty accounts by darkaos <]] ---------------| --------------- [[> Function getDBPlayersCount() by Elf <]] ------------------| ------------------------------------------------------------------------------| ------------------------------------------------------------------------------| --- ~!READ THIS!~ ------------------------------------------------------------| --- Be sure to back up your database and test this on your server first, -----| --- I(Teh Maverick) cannot guarantee it will work the same for every core. ---| --- It is very easy to test, with the log file and values that are printed ---| -----------------------------------Enjoy!-------------------------------------| ------------------------------------------------------------------------------* function countRowsWhereInTable(table, field, condition) local result = db.getResult("SELECT COUNT(" .. field .. ") as count FROM " .. table .. " WHERE " .. field .. " = '" .. condition .. "';") local tmp = result:getDataInt("count") result:free() return tmp end function getDBPlayersCount() local result = db.getResult("SELECT COUNT(id) as count FROM `players`;") local tmp = result:getDataInt("count") result:free() return tmp end function getDBAccountsCount() local result = db.getResult("SELECT COUNT(id) as count FROM `accounts`;") local tmp = result:getDataInt("count") result:free() return tmp end function onstartup() local DB_BEFORE = {players = getDBPlayersCount(), accounts = getDBAccountsCount()} local result,result1, ii, numPlayersToDelete, numAccountsDeleted, tmp = 0, 0, 0, 0, 0 local pid, aid = {}, {} local dropCount = {players={},accounts={}} local config = { deleteAccountWithNoPlayers = true, cleanChildTables = true, printResult = true, saveResultToFile = true, logFileName = 'db_cleanup.txt' } --In each table, players with below specified level, and days of inactivity will be deleted from db on server startup local cleanup = { [1] = {level = 100, time = 7 * 24 * 60 * 60}, [2] = {level = 300, time = 60 * 24 * 60 * 60} } local childAttributeTables = { players = { [1] = {table = "`player_viplist`", idField = "`player_id`"}, [2] = {table = "`player_storage`", idField = "`player_id`"}, [3] = {table = "`player_spells`", idField = "`player_id`"}, [4] = {table = "`player_skills`", idField = "`player_id`"}, [5] = {table = "`player_namelocks`", idField = "`player_id`"}, [6] = {table = "`player_items`", idField = "`player_id`"}, [7] = {table = "`player_depotitems`", idField = "`player_id`"}, [8] = {table = "`houses`", idField = "`owner`"}, [9] = {table = "`house_auctions`", idField = "`player_id`"}, [10] = {table = "`players`", idField = "`id`"} -- Keep this as the last item in the array --Note: `houses` and `bans` are in the DB triggers for TFS so don't worry about them. --Also I did not want to put killers, or deaths on here because that is historic data, --do so at your ouwn risk. }, accounts = { [1] = {table = "`accounts`", idField = "`id`"}, [2] = {table = "`account_viplist`", idField = "`account_id`"} } } --Clean up all the players and player data for i = 1, #cleanup do result = db.getResult("SELECT `id`,`name`,`account_id` FROM `players` WHERE `level` < ".. cleanup[i].level .." AND `name` NOT IN('Account Manager', 'Sorcerer Sample', 'Druid Sample', 'Paladin Sample', 'Knight Sample', 'Rook Sample') AND `group_id` < 2 AND `lastlogin` < UNIX_TIMESTAMP() - ".. cleanup[i].time ..";") if(result:getID() ~= -1) then ii = 1 repeat pid[ii] = result:getDataInt("id") -- list the players id into an array aid[ii] = result:getDataInt("account_id") -- list the account id of each player being removed into an array ii = ii + 1 until not(result:next()) result:free() end numPlayersToDelete = ii - 1 --Drop players and their child table attribute data such as skills, items, etc. for j = 1, numPlayersToDelete do if(config.cleanChildTables) then for k = 1, #childAttributeTables.players do dropCount.players[k] = ((dropCount.players[k] or 0) + countRowsWhereInTable(childAttributeTables.players[k].table, childAttributeTables.players[k].idField, pid[j])) db.executeQuery("DELETE FROM " .. childAttributeTables.players[k].table .. " WHERE " .. childAttributeTables.players[k].idField .. " = '" .. pid[j] .. "';") end else db.executeQuery("DELETE FROM `players` WHERE `id` = '" .. pid[j] .. "';") end end end --Drop all the accounts that have 0 players linked to them (at the moment its only checking from the list of players removed) if config.deleteAccountWithNoPlayers then --This part was scripted by Darkhaos, modified/fixed by Teh Maverick --[[ for acc = 1, #aid do result1 = db.getResult("SELECT `id` FROM `accounts` WHERE `id` = '" .. aid[acc] .. "';") if result1:getID() ~= -1 then -- check to make sure the account exists result1:free() for i = 1, #childAttributeTables.accounts do --Make sure there are no other players on the account result1 = db.getResult("SELECT COUNT(id) as count FROM `players` WHERE `account_id` = '" .. aid[acc] .. "';") tmp = result1:getDataInt("count") if(tmp <= 0) then --Remove accounts dropCount.accounts[i] = ((dropCount.accounts[i] or 0) + countRowsWhereInTable(childAttributeTables.accounts[i].table, childAttributeTables.accounts[i].idField, aid[acc])) db.executeQuery("DELETE FROM " .. childAttributeTables.accounts[i].table .. " WHERE " .. childAttributeTables.accounts[i].idField .. " = '" .. aid[acc] .. "';") end end end end end --]] --Print and Save results (configurable) local DB_NOW = {players = DB_BEFORE.players - getDBPlayersCount(), accounts = DB_BEFORE.accounts - getDBAccountsCount()} if DB_NOW.players > 0 or DB_NOW.accounts > 0 then local text = ">> [DBCLEANUP] " .. DB_NOW.players .. " inactive players" .. (config.deleteAccountWithNoPlayers and " and " .. DB_NOW.accounts .. " empty accounts" or "") .. " have been deleted from the database." --Write to console if config.printResult then print("") print(text) if config.cleanChildTables then --Write player info for i = 1,#dropCount.players do print("[!] --> Dropped: " .. dropCount.players[i] .. " from " .. childAttributeTables.players[i].table .. " table") end --Write account info if config.deleteAccountWithNoPlayers then for i = 1,#dropCount.accounts do print("[!] --> Dropped: " .. dropCount.accounts[i] .. " from " .. childAttributeTables.accounts[i].table .. " table") end end print("") end end --Write to file if config.saveResultToFile then local file = io.open("data/logs/"..config.logFileName, "a") file:write("[" .. os.date("%d %B %Y %X ", os.time()) .. "] " .. text .. "\n") if config.cleanChildTables then --Write player info for i = 1, #dropCount.players do file:write("[!] --> Dropped: " .. dropCount.players[i] .. " from " .. childAttributeTables.players[i].table .. " table\n") end --Write account info if config.deleteAccountWithNoPlayers then for i = 1, #dropCount.accounts do file:write("[!] --> Dropped: " .. dropCount.accounts[i] .. " from " .. childAttributeTables.accounts[i].table .. " table\n") end end file:write("\n") end file:close() end end return true end [/code] Ai no mesmo lugar vc cria um arquivo .txt com o nome db_cleanup... Tag: [code] <globalevent name="dbcleaner" type="startup" event="script" value="dbcleaner.lua"/> Você só vai editar isso: [1] = {level = 100, time = 7 * 24 * 60 * 60}, [2] = {level = 300, time = 60 * 24 * 60 * 60}
Level minimo e o tempo...
Por exemplo: level 100- deletar acada 7 dias de inativo... level 300- deletar acada 2 meses de inativo...