mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-20 12:47:37 +07:00
Updated uCore
This commit is contained in:
@ -174,15 +174,14 @@ public class NetServer extends Module{
|
||||
|
||||
float wtrc = 60;
|
||||
|
||||
if(TimeUtils.millis() < info.lastFastShot + (int)(wtrc/60f*1000)){
|
||||
info.fastShots ++;
|
||||
if(!Timers.get("fastshoot-" + id + "-" + weapon.id, wtrc)){
|
||||
info.fastShots.getAndIncrement(weapon.id, 0, 1);
|
||||
|
||||
if(info.fastShots - 6 > (int)(wtrc / (weapon.getReload() / 2f))){
|
||||
if(info.fastShots.get(weapon.id, 0) > (int)(wtrc / (weapon.getReload() / 2f)) + 2){
|
||||
kick(id, KickReason.kick);
|
||||
}
|
||||
}else{
|
||||
info.fastShots = 0;
|
||||
info.lastFastShot = TimeUtils.millis();
|
||||
info.fastShots.put(weapon.id, 0);
|
||||
}
|
||||
|
||||
packet.playerid = connections.get(id).id;
|
||||
@ -266,8 +265,6 @@ public class NetServer extends Module{
|
||||
|
||||
Net.handleServer(WeaponSwitchPacket.class, (id, packet) -> {
|
||||
TraceInfo info = admins.getTrace(Net.getConnection(id).address);
|
||||
info.fastShots = 0;
|
||||
info.lastFastShot = TimeUtils.millis();
|
||||
|
||||
packet.playerid = connections.get(id).id;
|
||||
Net.sendExcept(id, packet, SendMode.tcp);
|
||||
|
@ -113,6 +113,8 @@ public class NetEvents {
|
||||
packet.rotation = angle;
|
||||
packet.playerid = Vars.player.id;
|
||||
Net.send(packet, SendMode.udp);
|
||||
|
||||
handleWeaponSwitch();
|
||||
}
|
||||
|
||||
public static void handlePlace(int x, int y, Block block, int rotation){
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.anuke.mindustry.net;
|
||||
|
||||
import com.badlogic.gdx.utils.IntIntMap;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.blocks.Blocks;
|
||||
|
||||
@ -9,8 +10,7 @@ public class TraceInfo {
|
||||
public boolean modclient;
|
||||
public boolean android;
|
||||
|
||||
public int fastShots;
|
||||
public long lastFastShot;
|
||||
public IntIntMap fastShots = new IntIntMap();
|
||||
|
||||
public int totalBlocksBroken;
|
||||
public int structureBlocksBroken;
|
||||
|
Reference in New Issue
Block a user