You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
yarusetman 5ae254528c Project sources 2 years ago
..
Android Project sources 2 years ago
Demo Project sources 2 years ago
DevToDevOSX.bundle Project sources 2 years ago
Editor Project sources 2 years ago
Metro Project sources 2 years ago
Standalone Project sources 2 years ago
UDP Project sources 2 years ago
UnbiasedTime Project sources 2 years ago
UnityPurchasing Project sources 2 years ago
WebGL Project sources 2 years ago
iOS Project sources 2 years ago
Android.meta Project sources 2 years ago
Demo.meta Project sources 2 years ago
DevToDevOSX.bundle.meta Project sources 2 years ago
Editor.meta Project sources 2 years ago
Metro.meta Project sources 2 years ago
Standalone.meta Project sources 2 years ago
UDP.meta Project sources 2 years ago
UnbiasedTime.meta Project sources 2 years ago
UnityPurchasing.meta Project sources 2 years ago
WebGL.meta Project sources 2 years ago
iOS.meta Project sources 2 years ago
readme.txt Project sources 2 years ago
readme.txt.meta Project sources 2 years ago

readme.txt

# Time-cheat prevention

iOS native plugin to prevent cheating by changing phone time in settings.
Works in offline mode.

Plugin have simple API which main method is Now(). It returns current timestamp
that is initialized at first app launch and increment monotonically regardless of
time changes in device settings.

### Usage

1. Plugins/iOS folder contains native static lib for iOS: `libUnbiasedTime.a`.
It should be included automatically in the generated Xcode project.

2. UnbiasedTime.cs is a wrapper script for native lib. It is a singleton class
and creates empty GameObject on first access to `UnbiasedTime.Instance`.

3. Call `UnbiasedTime.Instance.Now()` to get estimated real timestamp. Use it for
time span calculations, but be aware that it have 1 second precision.

### Sample project

Simple demo included. It have two timers: one naive using `DateTime.Now` and the other
is using `UnbiasedTime.Instance.Now()`. Timers are implemented by remembering timestamp of timespan end in PlayerPrefs
so they keep counting even if app is backgrounded or closed. Launch it on your mobile device, tap +60 seconds several times, then go to
settings and increment current device time by few minutes. One timer will advance forward, while the other will keep
it's speed unchanged measuring real time.

### Caution

It is advised to use timestamp server to get real world time and fallback to `UnbiasedTime.Instance.Now()` only
when offline.