From 84fdd7e3fd2822372da187a2208eec68580f1b9c Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 27 Feb 2022 20:08:47 -0500 Subject: [PATCH] Multiplayer fix --- core/src/mindustry/core/NetServer.java | 6 +++--- core/src/mindustry/io/TypeIO.java | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 3b23963492..af75998907 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -999,20 +999,20 @@ public class NetServer implements ApplicationListener{ return result.toString(); } - String checkColor(String str){ + static String checkColor(String str){ for(int i = 1; i < str.length(); i++){ if(str.charAt(i) == ']'){ String color = str.substring(1, i); if(Colors.get(color.toUpperCase()) != null || Colors.get(color.toLowerCase()) != null){ Color result = (Colors.get(color.toLowerCase()) == null ? Colors.get(color.toUpperCase()) : Colors.get(color.toLowerCase())); - if(result.a <= 0.8f){ + if(result.a < 1f){ return str.substring(i + 1); } }else{ try{ Color result = Color.valueOf(color); - if(result.a <= 0.8f){ + if(result.a < 1f){ return str.substring(i + 1); } }catch(Exception e){ diff --git a/core/src/mindustry/io/TypeIO.java b/core/src/mindustry/io/TypeIO.java index 0c0df21a63..b5a84d176c 100644 --- a/core/src/mindustry/io/TypeIO.java +++ b/core/src/mindustry/io/TypeIO.java @@ -338,6 +338,11 @@ public class TypeIO{ //on the network, plans must be capped by size public static void writePlansQueueNet(Writes write, Queue plans){ + if(plans == null){ + write.i(-1); + return; + } + int used = getMaxPlans(plans); write.i(used); @@ -348,6 +353,7 @@ public class TypeIO{ public static Queue readPlansQueue(Reads read){ int used = read.i(); + if(used == -1) return null; var out = new Queue(); for(int i = 0; i < used; i++){ out.add(readPlan(read));