1. Are you ready for the Galaxy S20? Here is everything we know so far!

Help with custom timer.

Discussion in 'Android Apps & Games' started by nishinavin, Jun 11, 2017.

  1. nishinavin

    nishinavin Lurker
    Thread Starter

    I am trying to edit a game which is supposed to show winners as per the fastest time to complete a level.
    I have already decompiled the game but I am new to java thus need help of you guys.

    The time counter logic is pasted below but I need to change it so that whatever time it finally displays is less by 30 mins. That means if I take 35 minutes to complete a level, it should show it as 5 minutes.

    Can someone please help me with recoding it to get the above results?

    package org.apache.commons.net.time;

    import org.apache.commons.net.*;
    import java.util.*;
    import java.io.*;
    import java.net.*;

    public final class TimeUDPClient extends DatagramSocketClient
    {
    public static final int DEFAULT_PORT = 37;
    public static final long SECONDS_1900_TO_1970 = 2208988800L;
    private final byte[] __dummyData;
    private final byte[] __timeData;

    public TimeUDPClient() {
    this.__dummyData = new byte[1];
    this.__timeData = new byte[4];
    }

    public Date getDate(final InetAddress inetAddress) throws IOException {
    return new Date((this.getTime(inetAddress, 37) - 2208988800L) * 1000L);
    }

    public Date getDate(final InetAddress inetAddress, final int n) throws IOException {
    return new Date((this.getTime(inetAddress, n) - 2208988800L) * 1000L);
    }

    public long getTime(final InetAddress inetAddress) throws IOException {
    return this.getTime(inetAddress, 37);
    }

    public long getTime(final InetAddress inetAddress, final int n) throws IOException {
    final DatagramPacket datagramPacket = new DatagramPacket(this.__dummyData, this.__dummyData.length, inetAddress, n);
    final DatagramPacket datagramPacket2 = new DatagramPacket(this.__timeData, this.__timeData.length);
    this._socket_.send(datagramPacket);
    this._socket_.receive(datagramPacket2);
    return 0x0L | ((this.__timeData[0] & 0xFF) << 24 & 0xFFFFFFFFL) | ((this.__timeData[1] & 0xFF) << 16 & 0xFFFFFFFFL) | ((this.__timeData[2] & 0xFF) << 8 & 0xFFFFFFFFL) | (this.__timeData[3] & 0xFF & 0xFFFFFFFFL);
    }
    }
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...
Similar Threads - Help custom timer
  1. hacknorris
    Replies:
    0
    Views:
    307
  2. annie333
    Replies:
    6
    Views:
    265
  3. cocotus
    Replies:
    2
    Views:
    662
  4. Dw1892
    Replies:
    2
    Views:
    616
  5. 1776
    Replies:
    4
    Views:
    720
  6. rose2
    Replies:
    1
    Views:
    496
  7. 4554551n
    Replies:
    2
    Views:
    538
  8. LuckyBit33
    Replies:
    4
    Views:
    2,126
  9. Hedwig7s
    Replies:
    0
    Views:
    1,301
  10. XxLr23Xx
    Replies:
    8
    Views:
    2,570

Share This Page

Loading...