remove server from client

This commit is contained in:
Sen 2025-05-04 00:56:38 +02:00
parent 19f3813338
commit 7cdff9220a
18 changed files with 352 additions and 1216 deletions

View file

@ -1,7 +1,5 @@
package game.util;
import game.window.Window;
public enum PerfSection {
TIMING("Timing"),
INPUT("Input"),
@ -29,7 +27,7 @@ public enum PerfSection {
}
public void enter() {
this.time = Window.getTime();
this.time = Util.getTime();
if(section != null)
section.last[swap] = section.time = this.time - section.time;
section = this;
@ -44,7 +42,7 @@ public enum PerfSection {
}
public static void swap() {
long current = Window.getTime();
long current = Util.getTime();
total = current - start;
start = current;
swap ^= 1;

View file

@ -13,6 +13,8 @@ import game.log.Log;
import game.properties.IStringSerializable;
public abstract class Util {
private static long start = getTime();
public static String strip(String str, int offset, int len, char newl, char tab, char unk) {
StringBuilder sb = new StringBuilder();
for(int pos = offset; pos < offset + len; pos++) {
@ -375,4 +377,16 @@ int utf_len(const char *str) {
map.put("__pos", list);
return map;
}
public static long getTime() {
return System.nanoTime() / 1000L; // glfwGetTimerValue() / (glfwGetTimerFrequency() / 1000000L);
}
public static long rtime() {
return Util.getTime() - start;
}
public static double ftime() {
return ((double)rtime()) / 1000000.0;
}
}