Quality Slider for Android (only)
This commit is contained in:
@@ -23,4 +23,22 @@ public class Client
|
||||
this.socket = socket;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void close()
|
||||
{
|
||||
try
|
||||
{
|
||||
input.close();
|
||||
}catch(Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
try
|
||||
{
|
||||
output.close();
|
||||
}catch(Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,6 +348,7 @@ public class Room
|
||||
{
|
||||
//127 is the action for room cick
|
||||
players[0].output.write(new byte[]{127, 0, 0, 0, 0, 0, 0, 0, 0, 0});
|
||||
players[0].close();
|
||||
}
|
||||
|
||||
} catch (Exception ex)
|
||||
@@ -359,6 +360,7 @@ public class Room
|
||||
if (players[1] != null)
|
||||
{
|
||||
players[1].output.write(new byte[]{127, 0, 0, 0, 0, 0, 0, 0, 0, 0});
|
||||
players[1].close();
|
||||
}
|
||||
|
||||
} catch (Exception ex)
|
||||
@@ -370,6 +372,7 @@ public class Room
|
||||
if (players[2] != null)
|
||||
{
|
||||
players[2].output.write(new byte[]{127, 0, 0, 0, 0, 0, 0, 0, 0, 0});
|
||||
players[2].close();
|
||||
}
|
||||
|
||||
} catch (Exception ex)
|
||||
@@ -381,6 +384,7 @@ public class Room
|
||||
if (players[3] != null)
|
||||
{
|
||||
players[3].output.write(new byte[]{127, 0, 0, 0, 0, 0, 0, 0, 0, 0});
|
||||
players[3].close();
|
||||
}
|
||||
|
||||
} catch (Exception ex)
|
||||
|
||||
@@ -83,6 +83,9 @@ public class Server
|
||||
* !!!!!!!!!!!!!!!!!!! 0 is not used because of possible empty arrays read in because of inital connection errors !!!!!!!!!!!!!!!!!!!!
|
||||
*/
|
||||
case 0:
|
||||
case 126:
|
||||
client.close();
|
||||
client = null;
|
||||
Integer.parseInt("crash");
|
||||
break;
|
||||
|
||||
@@ -100,6 +103,8 @@ public class Server
|
||||
|
||||
//LOG
|
||||
System.out.println("Room " + new String(code, StandardCharsets.US_ASCII) + " successfully created!");
|
||||
client.close();
|
||||
client = null;
|
||||
break;
|
||||
//in this case a player wants to join an existing room (even the room creator will join via this method)
|
||||
case 1:
|
||||
@@ -137,9 +142,6 @@ public class Server
|
||||
output.write(new byte[]{127, 0, 0, 0, 0, 0, 0, 0, 0, 0});
|
||||
}
|
||||
|
||||
break;
|
||||
case 126:
|
||||
Integer.parseInt("crash");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user