Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Help me create a testperiod of my game

Discussion in 'Scripting' started by Agron, Jul 16, 2015.

  1. Agron

    Agron

    Joined:
    Mar 29, 2015
    Posts:
    7
    Hello out there!

    I am new on Unity and Programmning. I have only been working with this for a few months. Now i have a problem and thought that maybe you guys could help me out.

    I have a few people who are going to test my game. I want the game to only be playable for 1 day, after that no mather how much they reinstall the game. they should not be able to play that version of the game again. Anyone with some good advices on how to solve this problem?

    My idea is to use "System.DateTime.now" or something like that but if the user changes the date on the system, then "System.DateTime.Now" make no sense. or?

    Sorry for my bad English, i hope you understand and can help me with this.
     
  2. WheresMommy

    WheresMommy

    Joined:
    Oct 4, 2012
    Posts:
    890
    I would check the date on a webserver, so they cannot modify the system date. And if the date is not equal the one you want, dont load anything
     
    Agron likes this.
  3. Defero

    Defero

    Joined:
    Jul 9, 2012
    Posts:
    200
    To make it for offline mode, maybe something like this: Remember the date on the first run, save it. Then on every other first run, check if the "new" date is behind the one you remembered, you know it's been manipulated.
    But then, they can just move their system clock to startTime+3 hours, and this check would fail.
    For that, maybe if you count the number of minutes/hours while the app is opened, and make a limit of 6 hours or something (or how long you expect for the game to be played in one day). So that max open game time is 6 hours.

    Or remember the time on exit also, and check if it was changed behind next time the app starts. This would all fail if time changes while the app is running, but if they try that hard, they probably deserve the free time.

    The webserver one is definetly the best one though but it does require a 100% internet access on start.
     
    Agron likes this.
  4. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    you can't stop a user messing with their local environment to get around timelocks. You need to look at a online solution.
     
    Agron likes this.
  5. Agron

    Agron

    Joined:
    Mar 29, 2015
    Posts:
    7
    Thank you guys, I will try one of your ideas later @Defero ;)
     
  6. Defero

    Defero

    Joined:
    Jul 9, 2012
    Posts:
    200
    Ok, i missread the situation. I don't know if there is a way to permanently store that data for it to work. If they uninstall and delete the saved data. The reinstall would work again for them.
     
  7. GroZZleR

    GroZZleR

    Joined:
    Feb 1, 2015
    Posts:
    3,201
    Nothing will really protect your game like that - they could crack the game to remove the check entirely or redirect the server request to a different / local server that always returns the correct value. You're better off to provide a compact version of the game with only a single test level (or whatever is appropriate for your particular game).
     
  8. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,433
    Is it really that important that it could justify the amount of time you would be spending to implement a solution that can never give you 100% protection? Sounds like a waste of time to me to be honest.
     
    SkyTech6 likes this.