Removed legacy IO code

This commit is contained in:
Anuken
2020-05-21 16:50:49 -04:00
parent 61d9fd3d72
commit 14e79b50d2
13 changed files with 181 additions and 184 deletions

View File

@@ -0,0 +1,36 @@
package mindustry.io.legacy;
import arc.*;
import arc.struct.*;
import mindustry.ui.dialogs.JoinDialog.*;
import java.io.*;
public class LegacyIO{
public static Array<Server> readServers(){
Array<Server> arr = new Array<>();
try{
byte[] bytes = Core.settings.getBytes("server-list");
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(bytes));
int length = stream.readInt();
if(length > 0){
//name of type, irrelevant
stream.readUTF();
for(int i = 0; i < length; i++){
Server server = new Server();
server.ip = stream.readUTF();
server.port = stream.readInt();
arr.add(server);
}
}
}catch(Exception e){
e.printStackTrace();
}
return arr;
}
}