Smooth Camera and Room Exist check

This commit is contained in:
brausjonas
2023-01-28 11:32:12 +01:00
parent cf9a17a8ff
commit fc84f233ec
18 changed files with 172 additions and 83 deletions
+15 -14
View File
@@ -33,21 +33,21 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"WebServerToolWindowFactoryState": "false",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"project.structure.last.edited": "Artifacts",
"project.structure.proportion": "0.0",
"project.structure.side.proportion": "0.2",
"vue.rearranger.settings.migration": "true"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;project.structure.last.edited&quot;: &quot;Artifacts&quot;,
&quot;project.structure.proportion&quot;: &quot;0.0&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}]]></component>
}</component>
<component name="RunManager">
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Main" />
@@ -72,6 +72,7 @@
<updated>1674839030210</updated>
<workItem from="1674839031467" duration="221000" />
<workItem from="1674839402490" duration="20380000" />
<workItem from="1674897525328" duration="2102000" />
</task>
<servers />
</component>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+18
View File
@@ -111,6 +111,15 @@ public class Room
}
break;
case 0:
try
{
for (int i = 0; i < players.length; i++)
{
players[player].output.write(new byte[]{127, 0, 0, 0, 0, 0, 0, 0, 0, 0});
}
} catch (IOException ex)
{
}
server.deleteRoom(roomCode);
for(int i = 0; i < threads.size(); i++)
{
@@ -121,6 +130,15 @@ public class Room
} catch (IOException e)
{
try
{
for (int i = 0; i < players.length; i++)
{
players[player].output.write(new byte[]{127, 0, 0, 0, 0, 0, 0, 0, 0, 0});
}
} catch (IOException ex)
{
}
for(int i = 0; i < threads.size(); i++)
{
threads.get(i).stop();
+10 -2
View File
@@ -64,9 +64,17 @@ public class Server
input.read(readData);
String roomCode = new String(readData, StandardCharsets.US_ASCII);
Client client1 = new Client(output, input, client);
rooms.get(roomCode).addClient(client1);
if(rooms.containsKey(roomCode))
{
Client client1 = new Client(output, input, client);
rooms.get(roomCode).addClient(client1);
}
else
{
output.write(new byte[]{127, 0, 0, 0, 0, 0, 0, 0, 0, 0});
}
break;
}