Fixed dashing not syncing, position being verified on client hosting

This commit is contained in:
Anuken
2018-06-25 18:33:40 -04:00
parent 5a135e108a
commit d948607039
3 changed files with 6 additions and 8 deletions

View File

@@ -164,7 +164,7 @@ public class NetServer extends Module{
NetConnection connection = Net.getConnection(id);
if(player == null || connection == null || packet.snapid < connection.lastRecievedSnapshot) return;
boolean verifyPosition = !player.isDead() && !debug && !headless;
boolean verifyPosition = !player.isDead() && !debug && headless;
if(connection.lastRecievedTime == 0) connection.lastRecievedTime = TimeUtils.millis() - 16;

View File

@@ -271,7 +271,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait {
baseRotation = Mathf.slerpDelta(baseRotation, movement.angle(), 0.13f);
}
boostHeat = Mathf.lerpDelta(boostHeat, isBoosting && !movement.isZero() && moved ? 1f : 0f, 0.08f);
boostHeat = Mathf.lerpDelta(boostHeat, isBoosting && ((!movement.isZero() && moved) || !isLocal) ? 1f : 0f, 0.08f);
boolean snap = snapCamera && isLocal;
@@ -717,7 +717,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait {
color.set(buffer.readInt());
dead = buffer.readBoolean();
mech = Upgrade.getByID(buffer.readByte());
boolean dashing = buffer.readBoolean();
boolean boosting = buffer.readBoolean();
int mine = buffer.readInt();
interpolator.read(lastx, lasty, x, y, time, rotation);
rotation = lastrot;
@@ -727,7 +727,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait {
y = lasty;
}else{
mining = world.tile(mine);
isBoosting = dashing;
isBoosting = boosting;
}
}

View File

@@ -24,9 +24,7 @@ import io.anuke.ucore.entities.Entities;
import java.nio.ByteBuffer;
import static io.anuke.mindustry.Vars.bulletGroup;
import static io.anuke.mindustry.Vars.playerGroup;
import static io.anuke.mindustry.Vars.world;
import static io.anuke.mindustry.Vars.*;
/**Class for specifying read/write methods for code generation.*/
public class TypeIO {
@@ -67,7 +65,7 @@ public class TypeIO {
@ReadClass(Bullet.class)
public static Bullet readBullet(ByteBuffer buffer){
int id = buffer.getInt();
return (Bullet)bulletGroup.getByID(id);
return bulletGroup.getByID(id);
}
@WriteClass(CarriableTrait.class)