Multiplayer fix
This commit is contained in:
@@ -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){
|
||||
|
||||
@@ -338,6 +338,11 @@ public class TypeIO{
|
||||
|
||||
//on the network, plans must be capped by size
|
||||
public static void writePlansQueueNet(Writes write, Queue<BuildPlan> 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<BuildPlan> readPlansQueue(Reads read){
|
||||
int used = read.i();
|
||||
if(used == -1) return null;
|
||||
var out = new Queue<BuildPlan>();
|
||||
for(int i = 0; i < used; i++){
|
||||
out.add(readPlan(read));
|
||||
|
||||
Reference in New Issue
Block a user