Ir para conteúdo

Pergunta

8 respostass a esta questão

Posts Recomendados

  • 0
  Em 14/09/2016 em 13:25, FlamesAdmin disse:

Voce quer que reinicie em um  horario só ou em varios?

Expand  

em um horário apenas, ex: todos os dias as 05:00 da manha.

Link para o comentário
https://xtibia.com/forum/topic/242173-script-para-salvar-e-reiniciar-server/#findComment-1704143
Compartilhar em outros sites

  • 0

Vai no config.lua do servidor e procure por isso:

globalSaveEnabled

 

Deixe assim:

globalSaveEnabled = trueglobalSaveHour = 5shutdownAtGlobalSave = truecleanMapAtGlobalSave = false

 

Link para o comentário
https://xtibia.com/forum/topic/242173-script-para-salvar-e-reiniciar-server/#findComment-1704146
Compartilhar em outros sites

  • 0
  Em 14/09/2016 em 14:56, FlamesAdmin disse:

Vai no config.lua do servidor e procure por isso:

globalSaveEnabled

 

Deixe assim:

globalSaveEnabled = trueglobalSaveHour = 5shutdownAtGlobalSave = truecleanMapAtGlobalSave = false

 

Expand  

Boa tarde,

 

No conf lua não tem essas opções, global 10.96

 

posso adicionar essas opções? será que irá funcionar?

Link para o comentário
https://xtibia.com/forum/topic/242173-script-para-salvar-e-reiniciar-server/#findComment-1704148
Compartilhar em outros sites

  • 0
  Em 14/09/2016 em 15:26, marvadon disse:

Boa tarde,

 

No conf lua não tem essas opções, global 10.96

 

posso adicionar essas opções? será que irá funcionar?

Expand  

Para religar basta tu fazer um shell que rode um loop infinito onde a cada chamada ele execute o server.

Já o save com shutdown tu faz internamente por script, não da pra dar mais informações porque tu nao falou qual a distro que tu usa, se é tfs 1.x, 036, 04, crystal, otx e etc

Normalmente seria uma global event, porem vai depender de que distro tu usa

Link para o comentário
https://xtibia.com/forum/topic/242173-script-para-salvar-e-reiniciar-server/#findComment-1704169
Compartilhar em outros sites

  • 0

Se você usa global 10.96 ele já vem instalado no seu servidor, se encontra em globalevents/scripts/serversave.lua, caso não tenha estarei deixando ele aqui.

 

local shutdownAtServerSave = truelocal cleanMapAtServerSave = truelocal function serverSave()    if shutdownAtServerSave then        Game.setGameState(GAME_STATE_SHUTDOWN)    else        Game.setGameState(GAME_STATE_NORMAL)    end    if cleanMapAtServerSave then        cleanMap()    end    saveServer()endlocal function secondServerSaveWarning()    Game.broadcastMessage('Server is saving game in one minute. Please go to a safe place.', MESSAGE_STATUS_WARNING)    addEvent(serverSave, 60000)endlocal function firstServerSaveWarning()    Game.broadcastMessage('Server is saving game in 3 minutes. Please go to a safe place.', MESSAGE_STATUS_WARNING)    addEvent(secondServerSaveWarning, 120000)endfunction onTime(interval)    Game.broadcastMessage('Server is saving game in 5 minutes. Please go to a safe place.', MESSAGE_STATUS_WARNING)    Game.setGameState(GAME_STATE_STARTUP)    addEvent(firstServerSaveWarning, 120000)    return not shutdownAtServerSaveend

 

tag

<globalevent name="ServerSave" time="04:55:00" script="serversave.lua" />

 

PS: Sempre coloque 5 minutos antes do horário que você quer que o server caia, se quer que caia as 14:00, coloque 13:55.

Editado por Skymagnum
Link para o comentário
https://xtibia.com/forum/topic/242173-script-para-salvar-e-reiniciar-server/#findComment-1705066
Compartilhar em outros sites

  • 0
  Em 15/09/2016 em 02:54, dalvorsn disse:

Para religar basta tu fazer um shell que rode um loop infinito onde a cada chamada ele execute o server.

Já o save com shutdown tu faz internamente por script, não da pra dar mais informações porque tu nao falou qual a distro que tu usa, se é tfs 1.x, 036, 04, crystal, otx e etc

Normalmente seria uma global event, porem vai depender de que distro tu usa

Expand  

Meu TFS é 1.2

  Em 29/09/2016 em 08:41, Skymagnum disse:

Se você usa global 10.96 ele já vem instalado no seu servidor, se encontra em globalevents/scripts/serversave.lua, caso não tenha estarei deixando ele aqui.

 

local shutdownAtServerSave = truelocal cleanMapAtServerSave = truelocal function serverSave()    if shutdownAtServerSave then        Game.setGameState(GAME_STATE_SHUTDOWN)    else        Game.setGameState(GAME_STATE_NORMAL)    end    if cleanMapAtServerSave then        cleanMap()    end    saveServer()endlocal function secondServerSaveWarning()    Game.broadcastMessage('Server is saving game in one minute. Please go to a safe place.', MESSAGE_STATUS_WARNING)    addEvent(serverSave, 60000)endlocal function firstServerSaveWarning()    Game.broadcastMessage('Server is saving game in 3 minutes. Please go to a safe place.', MESSAGE_STATUS_WARNING)    addEvent(secondServerSaveWarning, 120000)endfunction onTime(interval)    Game.broadcastMessage('Server is saving game in 5 minutes. Please go to a safe place.', MESSAGE_STATUS_WARNING)    Game.setGameState(GAME_STATE_STARTUP)    addEvent(firstServerSaveWarning, 120000)    return not shutdownAtServerSaveend

 

tag

<globalevent name="ServerSave" time="04:55:00" script="serversave.lua" />

 

PS: Sempre coloque 5 minutos antes do horário que você quer que o server caia, se quer que caia as 14:00, coloque 13:55.

Expand  

Vou testar, :D

  Em 29/09/2016 em 08:41, Skymagnum disse:

Se você usa global 10.96 ele já vem instalado no seu servidor, se encontra em globalevents/scripts/serversave.lua, caso não tenha estarei deixando ele aqui.

 

local shutdownAtServerSave = truelocal cleanMapAtServerSave = truelocal function serverSave()    if shutdownAtServerSave then        Game.setGameState(GAME_STATE_SHUTDOWN)    else        Game.setGameState(GAME_STATE_NORMAL)    end    if cleanMapAtServerSave then        cleanMap()    end    saveServer()endlocal function secondServerSaveWarning()    Game.broadcastMessage('Server is saving game in one minute. Please go to a safe place.', MESSAGE_STATUS_WARNING)    addEvent(serverSave, 60000)endlocal function firstServerSaveWarning()    Game.broadcastMessage('Server is saving game in 3 minutes. Please go to a safe place.', MESSAGE_STATUS_WARNING)    addEvent(secondServerSaveWarning, 120000)endfunction onTime(interval)    Game.broadcastMessage('Server is saving game in 5 minutes. Please go to a safe place.', MESSAGE_STATUS_WARNING)    Game.setGameState(GAME_STATE_STARTUP)    addEvent(firstServerSaveWarning, 120000)    return not shutdownAtServerSaveend

 

tag

<globalevent name="ServerSave" time="04:55:00" script="serversave.lua" />

 

PS: Sempre coloque 5 minutos antes do horário que você quer que o server caia, se quer que caia as 14:00, coloque 13:55.

Expand  

 

Deixa eu ver se entendi,

Esse script irá executar o serversave e ira reiniciar o servidor!? ou ira desligar?

Link para o comentário
https://xtibia.com/forum/topic/242173-script-para-salvar-e-reiniciar-server/#findComment-1705637
Compartilhar em outros sites

×
×
  • Criar Novo...