diego00 Posted February 1, 2020 Share Posted February 1, 2020 Good!Could anyone share one script to exec the console command: quit();At specifics real server's time, please?Like as I have one config:restarts = { "04:00", "08:00", "14:00", "20:00" }So the script will send the quit(); cmd to console at 4 o'clock, 8 o'clock 14 o'clock and 20 o'clock.Thank you!!! Quote Link to comment Share on other sites More sharing options...
Duion Posted February 2, 2020 Share Posted February 2, 2020 What you plan to do? You can make a script that quits the game from the operating system and restarts it if you need.From within the game I don't know how to get the real time, but I would simply start a timer and then send quit command so it will fit the clocks time. For example if you start the game at 4 and make a schedule for 4 hours and then send quit it will obviously quit at 8 and so on, I'm more a workaround kind of guy, so no idea if that is good enough for you, but I think it should do the job.Personally I use a command to restart my game servers after a certain time, since if they run nonstop for days some errors may happen. Quote Link to comment Share on other sites More sharing options...
diego00 Posted February 2, 2020 Author Share Posted February 2, 2020 What you plan to do? You can make a script that quits the game from the operating system and restarts it if you need.From within the game I don't know how to get the real time, but I would simply start a timer and then send quit command so it will fit the clocks time. For example if you start the game at 4 and make a schedule for 4 hours and then send quit it will obviously quit at 8 and so on, I'm more a workaround kind of guy, so no idea if that is good enough for you, but I think it should do the job.Personally I use a command to restart my game servers after a certain time, since if they run nonstop for days some errors may happen. I've think on those too, but it isn't good. I'm hosting one game made with Torque 3D engine. The server has the command: quit();I want to send this command: quit(); to server's console to quit the server.The reason is because quit(); saves the game before closes the server.I can force a kill process on windows, but it would not save the game before killing the process as quit() does. So i really need uses quit(); command, not force killing process on windows =(The timer don't fit my needs too. I want to server restarts at specifics real time. Don't matter if it restarted 1 hour before or 1 minute. If it's 8 o'clock i want server restart.The reason is because the game have some tasks that needs time to be completed, more than 1 or 2 hours. With specifics times configured, the players can planning and don't loose time doing something that can't be finished before restarts...Another reason is that i've a windows process check if game crashed. If so, the server is launched again.It will breaks up all my server restarts after get some crash for example with timers.Can i use C++ or 3rd party library instead torque 3d scripts to do the restart at real times, please?This is the only way it would work.Thank you!!! Quote Link to comment Share on other sites More sharing options...
Duion Posted February 2, 2020 Share Posted February 2, 2020 Well I have no idea about C++ but I would search for a function that gets the system time, like this maybe: https://github.com/GarageGames/Torque3D/blob/development/Engine/source/core/util/uuid.cpp#L373I just searched for "gettime" in the code. Quote Link to comment Share on other sites More sharing options...
ohmtal Posted March 28, 2020 Share Posted March 28, 2020 The easiest way is to trigger the restart remotely over the remote console. You can also write an real time scheduler but that's more work ;) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.