mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-10 12:49:37 +07:00
Bugfixes
This commit is contained in:
parent
e49ebecffa
commit
467d995aed
@ -34,7 +34,8 @@ import static arc.util.Log.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class NetServer implements ApplicationListener{
|
||||
private static final int maxSnapshotSize = 430, timerBlockSync = 0;
|
||||
/** note that snapshots are compressed, so the max snapshot size here is above the typical UDP safe limit */
|
||||
private static final int maxSnapshotSize = 800, timerBlockSync = 0;
|
||||
private static final float serverSyncTime = 12, blockSyncTime = 60 * 6;
|
||||
private static final FloatBuffer fbuffer = FloatBuffer.allocate(20);
|
||||
private static final Vec2 vector = new Vec2();
|
||||
|
@ -107,6 +107,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
|
||||
@Remote(targets = Loc.both, called = Loc.server, forward = true)
|
||||
public static void pickupUnitPayload(Player player, Unit target){
|
||||
if(player == null) return;
|
||||
|
||||
Unit unit = player.unit();
|
||||
Payloadc pay = (Payloadc)unit;
|
||||
|
||||
@ -119,6 +121,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
|
||||
@Remote(targets = Loc.both, called = Loc.server, forward = true)
|
||||
public static void pickupBlockPayload(Player player, Building tile){
|
||||
if(player == null) return;
|
||||
|
||||
Unit unit = player.unit();
|
||||
Payloadc pay = (Payloadc)unit;
|
||||
|
||||
@ -142,6 +146,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
|
||||
@Remote(targets = Loc.both, called = Loc.server, forward = true)
|
||||
public static void dropPayload(Player player, float x, float y){
|
||||
if(player == null) return;
|
||||
|
||||
Payloadc pay = (Payloadc)player.unit();
|
||||
|
||||
//allow a slight margin of error
|
||||
@ -180,6 +186,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
@Remote(targets = Loc.both, forward = true, called = Loc.server)
|
||||
public static void transferInventory(Player player, Building tile){
|
||||
if(player == null || tile == null) return;
|
||||
|
||||
if(net.server() && (player.unit().stack.amount <= 0 || !Units.canInteract(player, tile) ||
|
||||
!netServer.admins.allowAction(player, ActionType.depositItem, tile.tile(), action -> {
|
||||
action.itemAmount = player.unit().stack.amount;
|
||||
|
Loading…
Reference in New Issue
Block a user