Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Kayac-TrungDV · Jul 17, 2014 at 09:53 AM · realtimeindependentcheat

Get real world's time which independent with device

I'm creating a game on Iphone/Android. In my game, user plants a tree then have to wait for that tree grow up. Each time user opens game, I check the time when user planted the tree and the current time, then decide the tree is grew up or not.

The problem is, if user plants the tree, then change device's time, he/she can cheat to make the tree grow faster.

How to avoid this? Is there a way to get the "real world current time" which user can not change?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
6

Answer by Saad_Khawaja · Jul 17, 2014 at 12:46 PM

The only way to do this (if i'm not wrong) is to query the time from the internet. You can create a small PHP page that prints the time and host it somewhere on the web, then use WWW to query it whenever you need to find the time.

For e.g.

PHP Page :

 <?php 
 print date("G.i:s", time());
 ?>

Unity Code

 void Start () {
         StartCoroutine("getTime");
 
     }
 
     IEnumerator getTime()
     {
         WWW www = new WWW("http://www.saadkhawaja.com/gettime.php");
         yield return www;
 
         Debug.Log("Time on the server is now: " + www.text);
     }
 


Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kayac-TrungDV · Jul 18, 2014 at 12:31 AM 0
Share

@Saad_$$anonymous$$hawaja Thank you for fast reply, but I'm finding a offline method.

I tried to hack time on "Injustice - God among us" (Iphone version) by set the phone to air plane mode, close the game, check to make sure that the game not run at background, then change the time of device, but it didn't work. There must be a way to check the time which independent with device's display time and not use internet. I just want to know the method which give the result like the game "Injustice - God among us"

avatar image Saad_Khawaja · Jul 18, 2014 at 04:37 PM 0
Share

That could simply be an error handling scenario. If wifi is not connected, then it wouldn't be able to check the time from the internet (hence didn't give the score).

So inorder to check, you must switch off the internet, wait the actual required time and then open Injustice - God among us. If it gives you the credit, when you have wifi off, then it will confirm that it is getting time from the phone.

I hope you understand where i'm co$$anonymous$$g from.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Creating realtime shadows without unity pro? 1 Answer

Time.realtimeSinceStartup returns negative number 3 Answers

How do you change a player's 3d model via a script? 1 Answer

Realtime vertex position of a SkinnedMesh 3 Answers

Memory leak when changing material 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges