Hey, So I made a script that starts bat files to restart the server, everytime it executes the bat files to start the server again, it says that:
Could not bind on 0.0.0.0:30120 - is this address valid and not already in use?
So this only happens if the server gets automaticly restarted with a Lua file and it doesn’t matter how much time I set to wait in:
timeout time /nobreak
It will always give the same message and you can’t connect to the server.
steps to reproduce:
make a simple server side lua file and paste this:
( this is only needed cause you can’t execute from lua directly a bat with a timeout function, cause it closes instantly again… may be another bug)
RegisterCommand("testthat", function()
os.execute("kick_restart.bat")
end)
close it and of course save it.
now go to the folder where your server.cfg is located and create two bat files,
one with the name “kick_restart.bat” and the other one with the name “restart.bat” and open both.
in kick_restart.bat paste this:
@echo off
start restart.bat
in restart.bat paste this:
@echo off
Taskkill /FI "WINDOWTITLE eq C:\Windows\system32\cmd.exe - SimpleServerStarter.bat
::only change the name above again with the name your server start bat has.
timeout 30 /nobreak
start SimpleServerStarter.bat
::only thing to change above is after the ' - ' the name of your server start bat.
that’s it. You will have the same problem as me…
thanks for reading if someone has any questions, ask me, I’m here.