13
0

Add FightServerConnection

Dieser Commit ist enthalten in:
jojo 2020-08-21 21:42:23 +02:00
Ursprung 89691e0c24
Commit 3f18ed9c1c
3 geänderte Dateien mit 6 neuen und 11 gelöschten Zeilen

2
.idea/.gitignore generiert vendored
Datei anzeigen

@ -1,2 +0,0 @@
# Default ignored files
/workspace.xml

6
.idea/vcs.xml generiert
Datei anzeigen

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

Datei anzeigen

@ -67,6 +67,9 @@ public class FightServerConnection {
* 1 - No Connect * 1 - No Connect
* 2 - Error while cleanup * 2 - Error while cleanup
* 3 - Error while pre cleanup * 3 - Error while pre cleanup
* 4 - Error while writing
* 5 - Error while reading
* 6 - Error while flushing
*/ */
private int errorCode = 0; private int errorCode = 0;
@ -128,7 +131,7 @@ public class FightServerConnection {
try { try {
return inputStream.read(); return inputStream.read();
} catch (IOException e) { } catch (IOException e) {
errorCode = 3; errorCode = 5;
return -2; return -2;
} }
} }
@ -139,7 +142,7 @@ public class FightServerConnection {
inputStream.read(bytes); inputStream.read(bytes);
return bytes; return bytes;
} catch (IOException e) { } catch (IOException e) {
errorCode = 3; errorCode = 5;
return new byte[length]; return new byte[length];
} }
} }
@ -176,7 +179,7 @@ public class FightServerConnection {
try { try {
outputStream.flush(); outputStream.flush();
} catch (IOException e) { } catch (IOException e) {
errorCode = 5; errorCode = 6;
} }
} }