Stand-alone game timer anti cheating solution

Single-player game timer anti-zuo cheating solution

1. Zuo cheating method description
    Some games will make players wait for a period of time under certain circumstances. For example, if the game fails in candy crush, it will consume a little stamina. When the stamina is dissatisfied, it will increase every 30 minutes. a little. When the physical strength is exhausted, the game can no longer be played. At this time, the player can modify the system time, adjust the time to the future, and then return to the game, the physical strength will be full. This control of the game is ineffective.

    Principle: When a little physical strength is consumed, the game will record a time t1, and when the current time is t1+30 minutes, a little physical strength will be added. If you adjust the system time back by half an hour, you don't need to wait to restore your stamina directly.


2. Solutions
1. Calculate the boot time through the boot running time.
    Both ios and android provide a method: get the running time from boot to present. This is the way to check the time. By obtaining the current time (which may be modified) and the boot running time, the boot time (the former minus the latter) can be calculated. If the boot state is kept on, then the boot time should be unchanged. If a certain boot time is calculated to be different from the last time, it can be judged that the timer is wrong.

2. Record the boot time
    When the game is run for the first time, the boot time will be recorded for comparison in subsequent calculations.

3. Networking time correction
    When the user's time is abnormal, for example, it has been adjusted 1 hour later, it is calculated that the start-up time is different from the last time. At this time, it needs to be connected to the network to correct the time. Obtain the correct current time from the network, compare the user time (which may be modified), calculate the time difference of 1 hour, and record the time difference. After that, this time difference must be subtracted each time the user's current time is obtained. The result may be regarded as the correct system time, and then the boot time can be calculated according to the method of 1 to be more accurate. After the time is corrected, the last boot time will be reset as a new reference value.


3. Examples
    When entering the game, the current system time is obtained at 8:00, the boot time is obtained for 3 hours, and the boot time is calculated at 5:00.
    The game triggers a 30-minute timer at 9:00, which should be completed by 9:30. At this point, the user switches to the settings and modifies the system time to 10:00.
    Back in the game, a timer check will be performed. The system time is 10 o'clock, and the boot time is 4 hours. The calculated boot time is 6 o'clock, which is different from the previously recorded 5 o'clock, and it is judged that the timer is wrong. If the user does not perform online calibration, it cannot continue.
    After the user is connected to the Internet, take out the real time of the network at 9:00, calculate the user time difference of 1 hour (10-9), and reset the last boot time, or 5:00.
    After the correction, let the timer continue, and the user time will be subtracted from the time difference, that is, the real time can be obtained, then the timer can run normally.
    If the user remains connected to the network, the timer error is corrected instantaneously.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326210214&siteId=291194637