Updated uCore

This commit is contained in:
Anuken
2018-04-03 23:58:33 -04:00
parent efd9280f96
commit 0559b43bde
5 changed files with 12 additions and 13 deletions

View File

@ -25,7 +25,7 @@ allprojects {
appName = 'Mindustry'
gdxVersion = '1.9.8'
aiVersion = '1.8.1'
uCoreVersion = 'c5d47cc'
uCoreVersion = 'a41b4c2'
getVersionString = {
String buildVersion = getBuildVersion()

View File

@ -1,7 +1,7 @@
#Autogenerated file. Do not modify.
#Mon Apr 02 15:23:03 EDT 2018
#Tue Apr 03 23:58:20 EDT 2018
version=release
androidBuildCode=497
androidBuildCode=501
name=Mindustry
code=3.5
build=37
build=custom build

View File

@ -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);

View File

@ -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){

View File

@ -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;