nishinavin
Lurker
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);
}
}
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);
}
}