Fixed some multiplayer bugs
This commit is contained in:
@@ -3320,7 +3320,7 @@ public class Blocks{
|
|||||||
|
|
||||||
ammo(Items.scrap, new BasicBulletType(){{
|
ammo(Items.scrap, new BasicBulletType(){{
|
||||||
damage = 40;
|
damage = 40;
|
||||||
speed = 8f;
|
speed = 8.5f;
|
||||||
width = 11f;
|
width = 11f;
|
||||||
height = 16f;
|
height = 16f;
|
||||||
trailColor = Pal.bulletYellowBack;
|
trailColor = Pal.bulletYellowBack;
|
||||||
@@ -3329,13 +3329,20 @@ public class Blocks{
|
|||||||
collidesTiles = false;
|
collidesTiles = false;
|
||||||
shootEffect = Fx.shootBig2;
|
shootEffect = Fx.shootBig2;
|
||||||
smokeEffect = Fx.shootBigSmoke2;
|
smokeEffect = Fx.shootBigSmoke2;
|
||||||
|
frontColor = Color.white;
|
||||||
|
backColor = Color.valueOf("869cbe");
|
||||||
|
|
||||||
|
lifetime = 34f;
|
||||||
|
//controversial
|
||||||
|
homingDelay = 10f;
|
||||||
|
homingPower = 0.01f;
|
||||||
}});
|
}});
|
||||||
|
|
||||||
//TODO bullet.
|
//TODO bullet.
|
||||||
|
|
||||||
//recoilAmount = 1f;
|
//recoilAmount = 1f;
|
||||||
reloadTime = 8f;
|
reloadTime = 8f;
|
||||||
shootLength = 15f;
|
shootLength = 14f;
|
||||||
rotateSpeed = 5f;
|
rotateSpeed = 5f;
|
||||||
|
|
||||||
coolantUsage = 30f / 60f;
|
coolantUsage = 30f / 60f;
|
||||||
@@ -3350,7 +3357,7 @@ public class Blocks{
|
|||||||
widthSpread = true;
|
widthSpread = true;
|
||||||
targetGround = false;
|
targetGround = false;
|
||||||
spread = 4.6f;
|
spread = 4.6f;
|
||||||
inaccuracy = 8f;
|
inaccuracy = 9f;
|
||||||
|
|
||||||
restitution = 0.1f;
|
restitution = 0.1f;
|
||||||
shootWarmupSpeed = 0.08f;
|
shootWarmupSpeed = 0.08f;
|
||||||
@@ -3359,7 +3366,7 @@ public class Blocks{
|
|||||||
acceptCoolant = false;
|
acceptCoolant = false;
|
||||||
|
|
||||||
scaledHealth = 340;
|
scaledHealth = 340;
|
||||||
range = 250f;
|
range = 270f;
|
||||||
size = 4;
|
size = 4;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ import static mindustry.Vars.*;
|
|||||||
|
|
||||||
public class NetClient implements ApplicationListener{
|
public class NetClient implements ApplicationListener{
|
||||||
private static final float dataTimeout = 60 * 20;
|
private static final float dataTimeout = 60 * 20;
|
||||||
private static final float playerSyncTime = 5;
|
/** ticks between syncs, e.g. 5 means 60/5 = 12 syncs/sec*/
|
||||||
|
private static final float playerSyncTime = 4;
|
||||||
private static final Reads dataReads = new Reads(null);
|
private static final Reads dataReads = new Reads(null);
|
||||||
|
|
||||||
private long ping;
|
private long ping;
|
||||||
|
|||||||
@@ -728,12 +728,9 @@ public class DesktopInput extends InputHandler{
|
|||||||
}
|
}
|
||||||
|
|
||||||
Call.commandUnits(player, ids, attack instanceof Building b ? b : null, attack instanceof Unit u ? u : null, target);
|
Call.commandUnits(player, ids, attack instanceof Building b ? b : null, attack instanceof Unit u ? u : null, target);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return super.tap(x, y, count, button);
|
return super.tap(x, y, count, button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -194,6 +194,9 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
public static void commandUnits(Player player, int[] unitIds, @Nullable Building buildTarget, @Nullable Unit unitTarget, @Nullable Vec2 posTarget){
|
public static void commandUnits(Player player, int[] unitIds, @Nullable Building buildTarget, @Nullable Unit unitTarget, @Nullable Vec2 posTarget){
|
||||||
if(player == null || unitIds == null) return;
|
if(player == null || unitIds == null) return;
|
||||||
|
|
||||||
|
//why did I ever think this was a good idea
|
||||||
|
if(unitTarget != null && unitTarget.isNull()) unitTarget = null;
|
||||||
|
|
||||||
if(net.server() && !netServer.admins.allowAction(player, ActionType.commandUnits, event -> {
|
if(net.server() && !netServer.admins.allowAction(player, ActionType.commandUnits, event -> {
|
||||||
event.unitIDs = unitIds;
|
event.unitIDs = unitIds;
|
||||||
})){
|
})){
|
||||||
|
|||||||
@@ -443,6 +443,8 @@ public class Weapon implements Cloneable{
|
|||||||
if(unitSpawned == null){
|
if(unitSpawned == null){
|
||||||
return bullet.create(unit, unit.team, x, y, angle, (1f - velocityRnd) + Mathf.random(velocityRnd), lifescl);
|
return bullet.create(unit, unit.team, x, y, angle, (1f - velocityRnd) + Mathf.random(velocityRnd), lifescl);
|
||||||
}else{
|
}else{
|
||||||
|
//don't spawn units clientside!
|
||||||
|
if(!net.client()){
|
||||||
Unit spawned = unitSpawned.create(unit.team);
|
Unit spawned = unitSpawned.create(unit.team);
|
||||||
spawned.set(x, y);
|
spawned.set(x, y);
|
||||||
spawned.rotation = angle;
|
spawned.rotation = angle;
|
||||||
@@ -452,6 +454,7 @@ public class Weapon implements Cloneable{
|
|||||||
ai.shooter = unit;
|
ai.shooter = unit;
|
||||||
}
|
}
|
||||||
spawned.add();
|
spawned.add();
|
||||||
|
}
|
||||||
//TODO assign AI target here?
|
//TODO assign AI target here?
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user