Not Closing Rooms Fix

This commit is contained in:
brausjonas
2023-04-01 15:02:44 +02:00
parent 52fa2643db
commit 42c6d0ac6a
11 changed files with 213 additions and 62 deletions
+2 -1
View File
@@ -52,7 +52,7 @@
}</component>
<component name="RunManager" selected="Attach to Unity Editor.Attach to Unity Editor">
<configuration name="Standalone Player" type="RunUnityExe" factoryName="Unity Executable">
<option name="EXE_PATH" value="$USER_HOME$/OneDrive/Desktop/Build/FlufflParty.exe" />
<option name="EXE_PATH" value="$USER_HOME$/OneDrive/Desktop/Build\FlufflParty.exe" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="C:\Users\braus\OneDrive\Desktop\FlufflPartyTestBuild" />
<option name="PASS_PARENT_ENVS" value="1" />
@@ -144,6 +144,7 @@
<workItem from="1680292381793" duration="2472000" />
<workItem from="1680300799136" duration="1217000" />
<workItem from="1680305492453" duration="112000" />
<workItem from="1680352698218" duration="452000" />
</task>
<servers />
</component>
+139 -3
View File
@@ -2930,7 +2930,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -0.000030517578, y: -0.37069702}
m_AnchoredPosition: {x: 0, y: -0.37069702}
m_SizeDelta: {x: 0, y: 460.7464}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1440669665
@@ -3136,12 +3136,13 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2072539373}
- {fileID: 1797005344}
m_Father: {fileID: 1780335805}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -74.20001, y: 57.312}
m_AnchoredPosition: {x: -37.7, y: 57.312}
m_SizeDelta: {x: 200, y: 40}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1574528323
@@ -3709,7 +3710,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &1780335805
RectTransform:
m_ObjectHideFlags: 0
@@ -4055,6 +4056,141 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1795888347}
m_CullTransparentMesh: 1
--- !u!1 &1797005343
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1797005344}
- component: {fileID: 1797005346}
- component: {fileID: 1797005345}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1797005344
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1797005343}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1574528322}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -200.00002, y: 0}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1797005345
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1797005343}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'Share first then:'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 3f776446f6429de4b92b7db92e77952e, type: 2}
m_sharedMaterial: {fileID: -996942129922571021, guid: 3f776446f6429de4b92b7db92e77952e, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 23.1
m_fontSizeBase: 23.1
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &1797005346
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1797005343}
m_CullTransparentMesh: 1
--- !u!1 &1805136054
GameObject:
m_ObjectHideFlags: 0
@@ -111,6 +111,13 @@ public class StartHandler : MonoBehaviour
public void ButtonBack()
{
client.Close();
client = new TcpClient("185.245.96.48", 8051);
Stream stream = client.GetStream();
stream.Write(new byte[]{3, 0, 0, 0, 0, 0, 0, 0, 0, 0});
byte[] roomCode = Encoding.ASCII.GetBytes(PlayerPrefs.GetString("roomcode"));
stream.Write(roomCode);
SceneManager.LoadScene(0, LoadSceneMode.Single);
}
@@ -840,7 +840,7 @@ PlayerSettings:
allowUnsafeCode: 0
useDeterministicCompilation: 1
enableRoslynAnalyzers: 1
selectedPlatform: 1
selectedPlatform: 2
additionalIl2CppArgs:
scriptingRuntimeVersion: 1
gcIncremental: 1
@@ -12,10 +12,10 @@ EditorUserSettings:
value: 55010d0300055a5a595a592641730d44104e4c287b2e71662c7b186bb3b86069
flags: 0
RecentlyUsedSceneGuid-2:
value: 0000025f04075d0f0c0a5c7149205a4417154f782e7923357e7a4560e3b4653b
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
flags: 0
RecentlyUsedSceneGuid-3:
value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a
value: 0000025f04075d0f0c0a5c7149205a4417154f782e7923357e7a4560e3b4653b
flags: 0
UnityRemoteDevice:
value: 225f4d46245b0d4902070862342649191512
@@ -14,14 +14,14 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_PixelRect:
serializedVersion: 2
x: 2127
y: 126
width: 1436
height: 674
x: 613
y: 243
width: 641
height: 662
m_ShowMode: 0
m_Title: Project Settings
m_Title: Build Settings
m_RootView: {fileID: 4}
m_MinSize: {x: 310, y: 221}
m_MinSize: {x: 640, y: 601}
m_MaxSize: {x: 4000, y: 4021}
m_Maximized: 0
--- !u!114 &2
@@ -58,16 +58,16 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name: ProjectSettingsWindow
m_Name: BuildPlayerWindow
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 0
y: 0
width: 1436
height: 674
m_MinSize: {x: 310, y: 221}
width: 641
height: 662
m_MinSize: {x: 640, y: 601}
m_MaxSize: {x: 4000, y: 4021}
m_ActualView: {fileID: 16}
m_Panes:
@@ -92,12 +92,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1436
height: 674
m_MinSize: {x: 310, y: 221}
width: 641
height: 662
m_MinSize: {x: 640, y: 601}
m_MaxSize: {x: 4000, y: 4021}
vertical: 0
controlID: 475
controlID: 1715
--- !u!114 &5
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -192,7 +192,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 1
controlID: 54
controlID: 178
--- !u!114 &9
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -217,7 +217,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 55
controlID: 179
--- !u!114 &10
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -242,7 +242,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 56
controlID: 122
--- !u!114 &11
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -267,7 +267,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 57
controlID: 123
--- !u!114 &12
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -385,35 +385,30 @@ MonoBehaviour:
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 13854, guid: 0000000000000000e000000000000000, type: 0}
m_Script: {fileID: 12043, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_MinSize: {x: 310, y: 200}
m_MinSize: {x: 640, y: 580}
m_MaxSize: {x: 4000, y: 4000}
m_TitleContent:
m_Text: Project Settings
m_Image: {fileID: -5712115415447495865, guid: 0000000000000000d000000000000000, type: 0}
m_Text: Build Settings
m_Image: {fileID: 0}
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 2127
y: 126
width: 1436
height: 653
x: 613
y: 243
width: 641
height: 641
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
m_SaveData: []
m_PosLeft: {x: 0, y: 0}
m_PosRight: {x: 0, y: 0}
m_Scope: 1
m_SplitterFlex: 0.2
m_SearchText:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 4dcf9b58
m_LastClickedID: 1486606157
m_ExpandedIDs: 0478ab97a01a5fa600000000c53aba5a
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs:
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -472,22 +467,22 @@ MonoBehaviour:
m_SkipHidden: 0
m_SearchArea: 1
m_Folders:
- Assets/Materials
- Assets
m_Globs: []
m_OriginalText:
m_ViewMode: 1
m_StartGridSize: 64
m_LastFolders:
- Assets/Materials
- Assets
m_LastFoldersGridSize: -1
m_LastProjectPath: D:\Unity\flufflparty\FlufflParty
m_LockTracker:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 277}
m_SelectedIDs: 1a6a0000
m_LastClickedID: 27162
m_ExpandedIDs: 0000000096690000986900009a6900009c6900009e69000000ca9a3b
scrollPos: {x: 0, y: 79}
m_SelectedIDs: 9c690000
m_LastClickedID: 27036
m_ExpandedIDs: 000000009c6900009e690000a0690000a2690000a469000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -515,7 +510,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 0000000096690000986900009a6900009c6900009e690000
m_ExpandedIDs: 000000009c6900009e690000a0690000a2690000a4690000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -542,7 +537,7 @@ MonoBehaviour:
m_ListAreaState:
m_SelectedInstanceIDs:
m_LastClickedInstanceID: 0
m_HadKeyboardFocusLastEvent: 0
m_HadKeyboardFocusLastEvent: 1
m_ExpandedInstanceIDs: c6230000906400007e6d0000485d00002c610000fa0b020046650000
m_RenameOverlay:
m_UserAcceptedRename: 0
@@ -604,7 +599,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: cc91ffff2092ffff1a96ffff4896ffff469cffff9a9cffff66a0ffff94a0ffff06fbffff
m_ExpandedIDs: e0d3ffff32d4ffff58d8ffff88d8ffff8edbffffdedbffff04e0ffff34e0fffface9ffff06fbffffee6d00003c6e0000686e0000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -620,7 +615,7 @@ MonoBehaviour:
m_IsRenaming: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 0
m_ClientGUIView: {fileID: 13}
m_ClientGUIView: {fileID: 12}
m_SearchString:
m_ExpandedScenes: []
m_CurrenRootInstanceID: 0
@@ -1013,14 +1008,14 @@ MonoBehaviour:
m_OverrideSceneCullingMask: 6917529027641081856
m_SceneIsLit: 1
m_SceneLighting: 1
m_2DMode: 0
m_2DMode: 1
m_isRotationLocked: 0
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: 88.2527, y: 15.438611, z: 131.604}
m_Target: {x: 884.68835, y: 244.03244, z: 2.0766582}
speed: 2
m_Value: {x: 88.2527, y: 15.438611, z: 131.604}
m_Value: {x: 884.68835, y: 244.03244, z: 2.0766582}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
@@ -1067,17 +1062,17 @@ MonoBehaviour:
m_GridAxis: 1
m_gridOpacity: 0.5
m_Rotation:
m_Target: {x: -0.03943621, y: -0.9346003, z: 0.3361925, w: -0.10956729}
m_Target: {x: 0, y: 0, z: 0, w: 1}
speed: 2
m_Value: {x: -0.039434966, y: -0.9345708, z: 0.33618188, w: -0.10956383}
m_Value: {x: -0, y: -0, z: 0, w: -0.99999994}
m_Size:
m_Target: 1.1898067
m_Target: 335.76297
speed: 2
m_Value: 1.1898067
m_Value: 335.76297
m_Ortho:
m_Target: 0
m_Target: 1
speed: 2
m_Value: 0
m_Value: 1
m_CameraSettings:
m_Speed: 1.005
m_SpeedNormalized: 0.5
@@ -1091,7 +1086,7 @@ MonoBehaviour:
m_FarClip: 10000
m_DynamicClip: 1
m_OcclusionCulling: 0
m_LastSceneViewRotation: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226}
m_LastSceneViewRotation: {x: -0.03943621, y: -0.9346003, z: 0.3361925, w: -0.10956729}
m_LastSceneViewOrtho: 0
m_ReplacementShader: {fileID: 0}
m_ReplacementString:
+2
View File
@@ -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
View File
@@ -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);
}
}
}