Final kick revision (?)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Sat Mar 24 19:17:04 EDT 2018
|
#Sat Mar 24 19:29:29 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=474
|
androidBuildCode=474
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
|
|||||||
@@ -172,9 +172,9 @@ public class NetServer extends Module{
|
|||||||
TraceInfo info = admins.getTrace(Net.getConnection(id).address);
|
TraceInfo info = admins.getTrace(Net.getConnection(id).address);
|
||||||
Weapon weapon = (Weapon)Upgrade.getByID(packet.weaponid);
|
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 ++;
|
info.fastShots ++;
|
||||||
|
|
||||||
if(info.fastShots - 10 > (int)(wtrc / (weapon.getReload() / 2f))){
|
if(info.fastShots - 10 > (int)(wtrc / (weapon.getReload() / 2f))){
|
||||||
@@ -182,6 +182,7 @@ public class NetServer extends Module{
|
|||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
info.fastShots = 0;
|
info.fastShots = 0;
|
||||||
|
info.lastFastShot = TimeUtils.millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
packet.playerid = connections.get(id).id;
|
packet.playerid = connections.get(id).id;
|
||||||
@@ -264,6 +265,10 @@ public class NetServer extends Module{
|
|||||||
});
|
});
|
||||||
|
|
||||||
Net.handleServer(WeaponSwitchPacket.class, (id, packet) -> {
|
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;
|
packet.playerid = connections.get(id).id;
|
||||||
Net.sendExcept(id, packet, SendMode.tcp);
|
Net.sendExcept(id, packet, SendMode.tcp);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ public class TraceInfo {
|
|||||||
public boolean android;
|
public boolean android;
|
||||||
|
|
||||||
public int fastShots;
|
public int fastShots;
|
||||||
|
public long lastFastShot;
|
||||||
|
|
||||||
public int totalBlocksBroken;
|
public int totalBlocksBroken;
|
||||||
public int structureBlocksBroken;
|
public int structureBlocksBroken;
|
||||||
|
|||||||
Reference in New Issue
Block a user