Skip to content

Commit

Permalink
Release new version
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Jun 18, 2021
1 parent e22bd12 commit 7225d2c
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions BasicInfoAPI/src/main/conn/MinecraftServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public MinecraftServer(String host,int port)throws Exception {
try {
response = new Gson().fromJson(new PacketRecv(dataInputStream).popString(), Response.class);
}catch (EOFException e){//To change protocol.
System.out.println("ChangeProtocol");
socket=new Socket(host,port);
dataInputStream=new DataInputStream(socket.getInputStream());
dataOutputStream=new DataOutputStream(socket.getOutputStream());
Expand All @@ -56,7 +55,6 @@ public MinecraftServer(String host,int port)throws Exception {
ByteBase bbase=new ByteBase(b);
byte[] end=new byte[]{0,0};
if (new String(bbase.pop(end),StandardCharsets.UTF_16BE).equals("§1")){
System.out.println("packingResponse.");
response=new Response();
response.version=new Response.version();
response.version.protocol=Integer.parseInt
Expand All @@ -77,24 +75,11 @@ private short len(String l){
String utf16be=new String(l.getBytes(StandardCharsets.UTF_8),StandardCharsets.UTF_16BE);
return (short)utf16be.length();
}
private void listByte(byte[] bytes){
System.out.print("list:");
for(byte b:bytes){
System.out.print(b+" ");
}
System.out.println();
}
private class ByteBase{
byte[] arr;
int index=0;
ByteBase(byte[] byteArr){
this.arr=byteArr;
for (byte b:byteArr){
System.out.print(b+" ");
}
System.out.println();
String s=new String(arr,StandardCharsets.UTF_16BE);
System.out.println(s);
}
public byte[] pop(byte[] end){
ArrayList<Byte> byteArrayList=new ArrayList<>();
Expand All @@ -112,7 +97,6 @@ public byte[] pop(byte[] end){
for (int i=0;i<len;i++){
result[i]=byteArrayList.get(i);
}
listByte(result);
return result;
}
public byte pop(){
Expand Down

0 comments on commit 7225d2c

Please sign in to comment.