Kurewe

External Time Until Restart Clock/Timer

15 posts in this topic

I made a post the other day asking if anyone knew of a way to display a "time until server restart" clock on a website or some other external location. Outside of using basic pre-programmed countdown timer based on static restart times, the general consensus was that it would need to be created. After doing a couple hours of research and finding nothing, I decided to make one.

This basically gives you a way to display the time left until your Exile server restarts on a web site. I've done this in PHP and then "converted" the resulting database info into a "dynamic" image via PHP as well. I opted to convert the data to an image due to the lack of PHP on Enjin and more importantly, because you get a much better and more customizable display of the data. If you have any web development abilities, you should be able to adapt what I've done to suit your needs.

When first connecting to the database and when reconnecting after a period of time, It can take a couple seconds while it connects to the database and performs the query. If anyone has an idea on how to speed up that connect/query, feel free to let me know.

PREREQUISITES:

  1. Some basic web development knowledge
  2. You'll need access to a website to upload/store the files
  3. The website where you host the files must have PHP and have GD Support enabled. GD Support (Graphics Drawing Support) is what allows the conversion of the query result into an image. A site hosted on GoDaddy for example, will typically have what you need.
  4. The ability to follow my detailed instructions

I've included detailed instructions in the README.md on how to set this up. If you're still confused, post here and I will answer to the best of my abilities.

*** GitHub Files ***

timer_01.png

Edited by Kurewe
Fixed error in DB setup query and moved files to GitHub
  • Like 4

Share this post


Link to post
Share on other sites

you sir are an absolute god, thank you very much, we will be moving our website to a host that allows external database connections in a month or so (our current web space lease with one.com expires) and will definitely be using this once our site has been migrated.

Thanks again buddy nice work :)

  • Like 1

Share this post


Link to post
Share on other sites
Advertisement

BTW @Kurewe I got to ask this because I'm wetting myself here, is that a real website? Cantankerous Old Goats? Love it, brilliant, sounds a bit like my server community.

Also I'd like to compliment you on the instructions included in the download, just been reading them, very well written buddy, whilst I'm no professional web developer they do make sense based on my skill set to the point where I can follow them with no issues.

Cheers

Edited by wilderness

Share this post


Link to post
Share on other sites

@wilderness Yes, Cantankerous Old Goats is a real site. You can click the link in my signature to get there. While the core of our group was/is typically 35 and up, we still let the youngins have fun too.

  • Like 2

Share this post


Link to post
Share on other sites
6 hours ago, Kurewe said:

@wilderness Yes, Cantankerous Old Goats is a real site. You can click the link in my signature to get there. While the core of our group was/is typically 35 and up, we still let the youngins have fun too.

Yeah you killed it man. Excellent post well planned and really well done directions.

I was going suggest PowerShell and >file.html so it was in HTML. Your method is clearly the right way to go.

Kudos.

Edited by GamersRoost
  • Like 1

Share this post


Link to post
Share on other sites
6 minutes ago, GamersRoost said:

Yeah you killed it man. Excellent post well planned and really well done directions.

I was going suggest PowerShell and >file.html so it was in HTML. Your method is clearly the right way to go.

Kudos.

Thanks! I think some of my OCD came out in the directions. lol

  • Like 1

Share this post


Link to post
Share on other sites

Help I'm confused. I don't understand why you would want the value "240" (restart timer) in your database. Why not just define this in the PHP file itself?
And I thought Enjin allready had this countdown feature, which coutns down every x hours for you. You can visit my site to look what i mean (not meant as an ad).

But an ArmA server takes some time to boot, like 2 minutes or so. So if you fill in 120 minutes for example, won't this go a little bit more unprecise every restart?

Edited by GolovaRaoul

Share this post


Link to post
Share on other sites

@GolovaRaoul

Enjin doesn't have a module to poll the actual restart time of the server. Just a countdown timer that you "match" to your server restart periods.

With regards to the 240 value... I explained why I used that number in the instructions. If you want to put in 1, you can do that too. It doesn't matter. 

Quote

Run this query on your Exile database
It is simply to add the "restart_timer" table and insert an initial value for "id"
and "time_until_restart". I used 240 for the initial "time_until_restart" value
simply because we needed a starting number and I have 4 hour restarts. So, why not?

The amount of time until restart is regularly updated to the database. The "module" pulls the data from the database. It doesn't matter how long it takes the server to start up, as it's pulling the actual time until restart.

  • Like 2

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.