Final kick revision (?)

This commit is contained in:
Anuken 2018-03-24 19:30:16 -04:00
parent fd352f4ab1
commit e0c1bb8da1
3 changed files with 9 additions and 3 deletions

View File

@ -1,5 +1,5 @@
#Autogenerated file. Do not modify.
#Sat Mar 24 19:17:04 EDT 2018
#Sat Mar 24 19:29:29 EDT 2018
version=release
androidBuildCode=474
name=Mindustry

View File

@ -172,9 +172,9 @@ public class NetServer extends Module{
TraceInfo info = admins.getTrace(Net.getConnection(id).address);
Weapon weapon = (Weapon)Upgrade.getByID(packet.weaponid);
float wtrc = 60f;
float wtrc = 60;
if(!Timers.get(info.uuid + "-weapontrace", wtrc)){
if(TimeUtils.millis() < info.lastFastShot + wtrc*1000){
info.fastShots ++;
if(info.fastShots - 10 > (int)(wtrc / (weapon.getReload() / 2f))){
@ -182,6 +182,7 @@ public class NetServer extends Module{
}
}else{
info.fastShots = 0;
info.lastFastShot = TimeUtils.millis();
}
packet.playerid = connections.get(id).id;
@ -264,6 +265,10 @@ 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);
});

View File

@ -10,6 +10,7 @@ public class TraceInfo {
public boolean android;
public int fastShots;
public long lastFastShot;
public int totalBlocksBroken;
public int structureBlocksBroken;