Packet spam, rate limit fix / Flying unit command limit nerf
This commit is contained in:
@@ -896,20 +896,28 @@ public class UnitTypes implements ContentList{
|
|||||||
engineOffset = 5.5f;
|
engineOffset = 5.5f;
|
||||||
range = 140f;
|
range = 140f;
|
||||||
targetAir = false;
|
targetAir = false;
|
||||||
|
commandLimit = 4;
|
||||||
|
|
||||||
weapons.add(new Weapon(){{
|
weapons.add(new Weapon(){{
|
||||||
y = 0f;
|
y = 0f;
|
||||||
x = 2f;
|
x = 2f;
|
||||||
reload = 13f;
|
reload = 13f;
|
||||||
ejectEffect = Fx.casing1;
|
ejectEffect = Fx.casing1;
|
||||||
bullet = Bullets.standardCopper;
|
bullet = new BasicBulletType(2.5f, 9){{
|
||||||
|
width = 7f;
|
||||||
|
height = 9f;
|
||||||
|
lifetime = 45f;
|
||||||
|
shootEffect = Fx.shootSmall;
|
||||||
|
smokeEffect = Fx.shootSmallSmoke;
|
||||||
|
ammoMultiplier = 2;
|
||||||
|
}};
|
||||||
shootSound = Sounds.shoot;
|
shootSound = Sounds.shoot;
|
||||||
}});
|
}});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
horizon = new UnitType("horizon"){{
|
horizon = new UnitType("horizon"){{
|
||||||
health = 350;
|
health = 340;
|
||||||
speed = 1.8f;
|
speed = 1.7f;
|
||||||
accel = 0.08f;
|
accel = 0.08f;
|
||||||
drag = 0.016f;
|
drag = 0.016f;
|
||||||
flying = true;
|
flying = true;
|
||||||
@@ -920,6 +928,7 @@ public class UnitTypes implements ContentList{
|
|||||||
faceTarget = false;
|
faceTarget = false;
|
||||||
armor = 4f;
|
armor = 4f;
|
||||||
targetFlag = BlockFlag.factory;
|
targetFlag = BlockFlag.factory;
|
||||||
|
commandLimit = 5;
|
||||||
|
|
||||||
weapons.add(new Weapon(){{
|
weapons.add(new Weapon(){{
|
||||||
minShootVelocity = 0.75f;
|
minShootVelocity = 0.75f;
|
||||||
@@ -1718,7 +1727,7 @@ public class UnitTypes implements ContentList{
|
|||||||
hitSize = 9f;
|
hitSize = 9f;
|
||||||
rotateShooting = false;
|
rotateShooting = false;
|
||||||
lowAltitude = true;
|
lowAltitude = true;
|
||||||
commandLimit = 5;
|
commandLimit = 4;
|
||||||
|
|
||||||
weapons.add(new Weapon("small-mount-weapon"){{
|
weapons.add(new Weapon("small-mount-weapon"){{
|
||||||
top = false;
|
top = false;
|
||||||
@@ -1757,7 +1766,7 @@ public class UnitTypes implements ContentList{
|
|||||||
health = 220f;
|
health = 220f;
|
||||||
engineOffset = 6f;
|
engineOffset = 6f;
|
||||||
hitSize = 11f;
|
hitSize = 11f;
|
||||||
commandLimit = 7;
|
commandLimit = 5;
|
||||||
|
|
||||||
weapons.add(new Weapon("small-mount-weapon"){{
|
weapons.add(new Weapon("small-mount-weapon"){{
|
||||||
top = false;
|
top = false;
|
||||||
|
|||||||
@@ -46,14 +46,11 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
final static float playerSelectRange = mobile ? 17f : 11f;
|
final static float playerSelectRange = mobile ? 17f : 11f;
|
||||||
/** Maximum line length. */
|
/** Maximum line length. */
|
||||||
final static int maxLength = 100;
|
final static int maxLength = 100;
|
||||||
final static Vec2 stackTrns = new Vec2();
|
|
||||||
final static Rect r1 = new Rect(), r2 = new Rect();
|
final static Rect r1 = new Rect(), r2 = new Rect();
|
||||||
final static Seq<Unit> units = new Seq<>();
|
|
||||||
/** Distance on the back from where items originate. */
|
|
||||||
final static float backTrns = 3f;
|
|
||||||
|
|
||||||
public final OverlayFragment frag = new OverlayFragment();
|
public final OverlayFragment frag = new OverlayFragment();
|
||||||
|
|
||||||
|
public Interval controlInterval = new Interval();
|
||||||
public @Nullable Block block;
|
public @Nullable Block block;
|
||||||
public boolean overrideLineRotation;
|
public boolean overrideLineRotation;
|
||||||
public int rotation;
|
public int rotation;
|
||||||
@@ -419,7 +416,10 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
Unit unit = Units.closest(player.team(), player.x, player.y, u -> !u.isPlayer() && u.type == controlledType && !u.dead);
|
Unit unit = Units.closest(player.team(), player.x, player.y, u -> !u.isPlayer() && u.type == controlledType && !u.dead);
|
||||||
|
|
||||||
if(unit != null){
|
if(unit != null){
|
||||||
Call.unitControl(player, unit);
|
//only trying controlling once a second to prevent packet spam
|
||||||
|
if(!net.client() || controlInterval.get(0, 70f)){
|
||||||
|
Call.unitControl(player, unit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user