mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-22 21:57:58 +07:00
Bugfixes
This commit is contained in:
@ -64,24 +64,6 @@ public class AndroidLauncher extends AndroidApplication{
|
||||
moveTaskToBack(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUUID(){
|
||||
try{
|
||||
String s = Secure.getString(getContext().getContentResolver(), Secure.ANDROID_ID);
|
||||
int len = s.length();
|
||||
byte[] data = new byte[len / 2];
|
||||
for(int i = 0; i < len; i += 2){
|
||||
data[i / 2] = (byte)((Character.digit(s.charAt(i), 16) << 4)
|
||||
+ Character.digit(s.charAt(i + 1), 16));
|
||||
}
|
||||
String result = new String(Base64Coder.encode(data));
|
||||
if(result.equals("AAAAAAAAAOA=")) throw new RuntimeException("Bad UUID.");
|
||||
return result;
|
||||
}catch(Exception e){
|
||||
return super.getUUID();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public rhino.Context getScriptContext(){
|
||||
return AndroidRhinoContext.enter(getContext().getCacheDir());
|
||||
|
Binary file not shown.
@ -687,6 +687,7 @@ public class NetServer implements ApplicationListener{
|
||||
logic.skipWave();
|
||||
}else if(action == AdminAction.ban){
|
||||
netServer.admins.banPlayerIP(other.con.address);
|
||||
netServer.admins.banPlayerID(other.con.uuid);
|
||||
other.kick(KickReason.banned);
|
||||
Log.info("&lc@ has banned @.", player.name, other.name);
|
||||
}else if(action == AdminAction.kick){
|
||||
|
@ -79,6 +79,8 @@ public class SectorInfo{
|
||||
|
||||
//update sector's internal time spent counter1
|
||||
state.rules.sector.setTimeSpent(internalTimeSpent);
|
||||
|
||||
Log.info(production);
|
||||
}
|
||||
|
||||
/** Update averages of various stats, updates some special sector logic.
|
||||
@ -160,5 +162,9 @@ public class SectorInfo{
|
||||
|
||||
/** mean in terms of items produced per refresh rate (currently, per second) */
|
||||
public float mean;
|
||||
|
||||
public String toString(){
|
||||
return mean + "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,6 @@ public class SaveMeta{
|
||||
this.mods = JsonIO.read(String[].class, tags.get("mods", "[]"));
|
||||
this.secinfo = secinfo;
|
||||
|
||||
secinfo.exportRates().each(e -> hasProduction |= e.value > 0.001f);
|
||||
secinfo.production.each((e, amount) -> hasProduction |= amount.mean > 0.001f);
|
||||
}
|
||||
}
|
||||
|
@ -171,9 +171,10 @@ public class Packets{
|
||||
TypeIO.writeString(buffer, name);
|
||||
TypeIO.writeString(buffer, usid);
|
||||
|
||||
buffer.put(Base64Coder.decode(uuid));
|
||||
byte[] b = Base64Coder.decode(uuid);
|
||||
buffer.put(b);
|
||||
CRC32 crc = new CRC32();
|
||||
crc.update(Base64Coder.decode(uuid));
|
||||
crc.update(Base64Coder.decode(uuid), 0, b.length);
|
||||
buffer.putLong(crc.getValue());
|
||||
|
||||
buffer.put(mobile ? (byte)1 : 0);
|
||||
|
@ -44,6 +44,8 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
public PlanetDialog(){
|
||||
super("", Styles.fullDialog);
|
||||
|
||||
shouldPause = true;
|
||||
|
||||
getCell(buttons).padBottom(-4);
|
||||
buttons.background(Styles.black).defaults().growX().height(64f).pad(0);
|
||||
|
||||
|
@ -16,14 +16,12 @@ import mindustry.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.desktop.steam.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.net.*;
|
||||
import mindustry.net.Net.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
import java.util.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@ -307,24 +305,8 @@ public class DesktopLauncher extends ClientLauncher{
|
||||
}
|
||||
}
|
||||
|
||||
try{
|
||||
Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
|
||||
NetworkInterface out;
|
||||
for(out = e.nextElement(); (out.getHardwareAddress() == null || out.isVirtual() || !validAddress(out.getHardwareAddress())) && e.hasMoreElements(); out = e.nextElement());
|
||||
|
||||
byte[] bytes = out.getHardwareAddress();
|
||||
byte[] result = new byte[8];
|
||||
System.arraycopy(bytes, 0, result, 0, bytes.length);
|
||||
|
||||
String str = new String(Base64Coder.encode(result));
|
||||
|
||||
if(str.equals("AAAAAAAAAOA=") || str.equals("AAAAAAAAAAA=")) throw new RuntimeException("Bad UUID.");
|
||||
|
||||
return str;
|
||||
}catch(Exception e){
|
||||
return super.getUUID();
|
||||
}
|
||||
}
|
||||
|
||||
private static void message(String message){
|
||||
SDL.SDL_ShowSimpleMessageBox(SDL.SDL_MESSAGEBOX_ERROR, "oh no", message);
|
||||
|
Reference in New Issue
Block a user