Integrated server packets work (kinda)

This commit is contained in:
Catfoolyou
2025-04-17 14:12:39 -04:00
parent 3a10258a98
commit 6836e6d28e
8 changed files with 25246 additions and 914242 deletions

View File

@@ -50,17 +50,18 @@ public class NetLoginHandler extends NetHandler {
* network packets unless the timeout has occurred.
*/
public void handlePackets() {
System.out.println("[SP-Server][LOGIN][HANDLE][" + clientUsername + "]");
if (this.field_72544_i) { // FIX THIS SHIT!!!
//System.out.println("[SP-Server][LOGIN][HANDLE][" + clientUsername + "]");
if (this.field_72544_i) {
this.initializePlayerConnection();
return;
}
if (this.loginTimer++ == 600 && finishedProcessing == false) {
this.kickUser("Took too long to log in");
} else {
this.myTCPConnection.processReadPackets(); // problem
}
this.myTCPConnection.processReadPackets();
// if (this.loginTimer++ == 100) {
// this.kickUser("Took too long to log in");
// } else {
// this.myTCPConnection.processReadPackets();
// }
}
public boolean equals(Object o) {
@@ -155,7 +156,7 @@ public class NetLoginHandler extends NetHandler {
}
}
this.finishedProcessing = true;
//this.finishedProcessing = true;
System.out.println("finished processing");
}

View File

@@ -70,7 +70,7 @@ public class NetServerHandler extends NetHandler
if ((long)this.currentTicks - this.ticksOfLastKeepAlive > 20L)
{
this.ticksOfLastKeepAlive = (long)this.currentTicks;
this.ticksOfLastKeepAlive = this.currentTicks;
this.keepAliveTimeSent = System.nanoTime() / 1000000L;
this.keepAliveRandomID = randomGenerator.nextInt();
this.sendPacketToPlayer(new Packet0KeepAlive(this.keepAliveRandomID));
@@ -332,7 +332,6 @@ public class NetServerHandler extends NetHandler
public void handleBlockDig(Packet14BlockDig par1Packet14BlockDig)
{
WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension);
//this.playerEntity.func_143004_u();
if (par1Packet14BlockDig.status == 4)
{
@@ -428,7 +427,6 @@ public class NetServerHandler extends NetHandler
int var6 = par1Packet15Place.getYPosition();
int var7 = par1Packet15Place.getZPosition();
int var8 = par1Packet15Place.getDirection();
//this.playerEntity.func_143004_u();
if (par1Packet15Place.getDirection() == 255)
{