added devauth

Added some extra checks
Made RD 1024
This commit is contained in:
mcrcortex
2025-01-14 19:27:48 +10:00
parent 07b00bc710
commit 6539e69fb0
4 changed files with 28 additions and 8 deletions

View File

@@ -202,3 +202,15 @@ dependencies {
//implementation 'org.rocksdb:rocksdbjni:8.10.0'
//implementation 'redis.clients:jedis:5.1.0'
}
repositories {
maven {
url = "https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1"
}
}
dependencies {
modRuntimeOnly('me.djtheredstoner:DevAuth-fabric:1.1.0') {
exclude group: 'net.fabricmc', module: 'fabric-loader'
}
}

View File

@@ -13,6 +13,7 @@ import me.cortex.voxy.client.core.rendering.section.IUsesMeshlets;
import me.cortex.voxy.client.core.rendering.section.MDICSectionRenderer;
import me.cortex.voxy.client.core.rendering.util.DownloadStream;
import me.cortex.voxy.client.core.rendering.util.UploadStream;
import me.cortex.voxy.common.Logger;
import me.cortex.voxy.common.util.MessageQueue;
import me.cortex.voxy.common.world.WorldEngine;
import me.cortex.voxy.common.thread.ServiceThreadPool;
@@ -48,7 +49,7 @@ public class RenderService<T extends AbstractSectionRenderer<J, ?>, J extends Vi
//Max sections: ~500k
//Max geometry: 1 gb
this.sectionRenderer = (T) createSectionRenderer(this.modelService.getStore(),1<<20, (1L<<32)-1024);
this.sectionRenderer = (T) createSectionRenderer(this.modelService.getStore(),1<<20, (1L<<31)-1024);
//Do something incredibly hacky, we dont need to keep the reference to this around, so just connect and discard
var router = new SectionUpdateRouter();
@@ -148,10 +149,14 @@ public class RenderService<T extends AbstractSectionRenderer<J, ?>, J extends Vi
private int q = -60;
public void setup(Camera camera) {
final int W = 80;
final int W = 32;
final int H = 2;
for (int i = 0; i<32 && q<((W*2+1)*(W*2+1)*H)&&q++>=0;i++) {
this.nodeManager.insertTopLevelNode(WorldEngine.getWorldSectionId(4, (q%(W*2+1))-W, ((q/(W*2+1))/(W*2+1))-1, ((q/(W*2+1))%(W*2+1)))-W);
for (int i = 0; i<64 && q<((W*2+1)*(W*2+1)*H)&&q++>=0;i++) {
this.nodeManager.insertTopLevelNode(WorldEngine.getWorldSectionId(4, (q%(W*2+1))-W, ((q/(W*2+1))/(W*2+1))-1, ((q/(W*2+1))%(W*2+1))-W));
}
if (q==((W*2+1)*(W*2+1)*H)) {
q++;
Logger.info("Finished loading render distance");
}
this.modelService.tick();
}

View File

@@ -87,6 +87,9 @@ public class NodeManager {
}
public void insertTopLevelNode(long pos) {
if ((pos&0xF) != 0) {
throw new IllegalStateException("BAD POS !! YOU DID SOMETHING VERY BAD");
}
if (this.activeSectionMap.containsKey(pos)) {
Logger.error("Tried inserting top level pos " + WorldEngine.pprintPos(pos) + " but it was in active map, discarding!");
return;

View File

@@ -14,11 +14,11 @@ public class MixinClientCommonNetworkHandler {
private void handleDisconnectAsCrash(Packet<?> packet, Exception exception, CallbackInfo ci) {
if (packet instanceof GameJoinS2CPacket) {
ci.cancel();
if (exception instanceof RuntimeException re) {
throw re;
} else {
//if (exception instanceof RuntimeException re) {
// throw re;
//} else {
throw new RuntimeException("Force crashing due to exception during on game join", exception);
}
//}
}
}
}