Minor code optimization

This commit is contained in:
David Berdik 2017-07-19 11:58:41 -04:00
parent 4ebdfd07b1
commit 5ccb99e022

View File

@ -72,40 +72,10 @@ public class BugReport {
wr.flush();
BufferedReader rd = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
String serverResponse;
while((serverResponse = rd.readLine()) != null) {
if(serverResponse.equals("1")) {
// Report Failed - Unofficial Version
rd.close();
wr.close();
return "1";
}
else if(serverResponse.equals("2")) {
// Report Failed - Unsupported Version
rd.close();
wr.close();
return "2";
}
else if(serverResponse.equals("3")) {
// Report Successful - Get the Report ID
String reportID = rd.readLine();
rd.close();
wr.close();
return reportID;
}
else if(serverResponse.equals("4")) {
// Report Failed - Server is Banned
rd.close();
wr.close();
return "4";
}
else if(serverResponse.equals("5")) {
// Report Failed - Player UUID is Banned
rd.close();
wr.close();
return "5";
}
}
String serverResponse = rd.readLine();
rd.close();
wr.close();
return serverResponse;
} catch (Exception e){}
} catch (Exception e){}
// The report failed because for some reason, the server could not be reached.