Not Closing Rooms Fix
This commit is contained in:
Generated
+2
@@ -95,6 +95,8 @@
|
||||
<workItem from="1680262711476" duration="4141000" />
|
||||
<workItem from="1680274202300" duration="433000" />
|
||||
<workItem from="1680295523012" duration="646000" />
|
||||
<workItem from="1680352829832" duration="680000" />
|
||||
<workItem from="1680353695912" duration="91000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
+11
-1
@@ -25,7 +25,7 @@ public class Server
|
||||
rooms.remove(code);
|
||||
|
||||
//LOG
|
||||
System.out.println("Room" + code + " successfully deleted");
|
||||
System.out.println("Room " + code + " successfully deleted");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,6 +88,12 @@ public class Server
|
||||
client = null;
|
||||
Integer.parseInt("crash");
|
||||
break;
|
||||
case 3:
|
||||
byte[] roomCodeToClose = new byte[10];
|
||||
input.read(roomCodeToClose);
|
||||
String roomCodeToCloseString = new String(roomCodeToClose, StandardCharsets.US_ASCII);
|
||||
deleteRoom(roomCodeToCloseString);
|
||||
break;
|
||||
|
||||
//this case generates a new room and sends the room code to the requester (not for join)
|
||||
case 2:
|
||||
@@ -183,6 +189,10 @@ public class Server
|
||||
else
|
||||
{
|
||||
code[i] = (byte) (Math.random() * 25 + 97);
|
||||
while(code[i] == 111)
|
||||
{
|
||||
code[i] = (byte) (Math.random() * 25 + 97);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user