1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Big Cooldowns

Discussion in 'Development' started by Teamblocket, Dec 17, 2017.

  1. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    How can I make like 2 hour cooldowns? I know how to make 30 second cooldowns etc but I store this data in an array and I can’t do that for the 2 hour cool down because my server restarts every 30 min and I won’t be changing that.
     
    OnTheVerge likes this.
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Save the array into a flat file on shutdown and load it back up on restart.
     
  3. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    Ok, after the array is saved into the file and the timer is up how can i delete the now consider garbage data.
     
  4. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    Well, you should store it to file
    you can unset or unlink
     
  5. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    What array? Why an array? Just save an unix timestamp if you want it to be real-time, or save the remaining ticks if you want to have it game-time (game-time means your timer wouldn't continue to "run" if the server is shutdown)
     
  6. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    How are you going save the UNIX time stamp?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.