Removed legacy IO code
This commit is contained in:
36
core/src/mindustry/io/legacy/LegacyIO.java
Normal file
36
core/src/mindustry/io/legacy/LegacyIO.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user