diff --git a/TestVelGameServer/Assets/Samples/VelNet/1.0.4/Example/test.unity b/TestVelGameServer/Assets/Samples/VelNet/1.0.4/Example/test.unity index d52b46e..a9d0e78 100644 --- a/TestVelGameServer/Assets/Samples/VelNet/1.0.4/Example/test.unity +++ b/TestVelGameServer/Assets/Samples/VelNet/1.0.4/Example/test.unity @@ -629,7 +629,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: autoConnect: 1 - autoRejoin: 1 + autoRejoin: 0 userInput: {fileID: 626742069} sendInput: {fileID: 0} roomInput: {fileID: 711524768} @@ -2428,6 +2428,7 @@ GameObject: - component: {fileID: 1099803615} - component: {fileID: 1099803616} - component: {fileID: 1099803613} + - component: {fileID: 1099803614} m_Layer: 0 m_Name: NetworkManager m_TagString: Untagged @@ -2448,6 +2449,18 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: playerPrefab: {fileID: 6139051692386484099, guid: d4158ab9c4a204cdbba28d3273fc1fb3, type: 3} +--- !u!114 &1099803614 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1099803612} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5ea1fe0eb58e4184bbb2edcc99c51119, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!4 &1099803615 Transform: m_ObjectHideFlags: 0 diff --git a/TestVelGameServer/Packages/VelNetUnity/Runtime/VelNetManager.cs b/TestVelGameServer/Packages/VelNetUnity/Runtime/VelNetManager.cs index 56f9c10..00f6398 100644 --- a/TestVelGameServer/Packages/VelNetUnity/Runtime/VelNetManager.cs +++ b/TestVelGameServer/Packages/VelNetUnity/Runtime/VelNetManager.cs @@ -473,7 +473,15 @@ namespace VelNet { if (masterPlayer == null) { - masterPlayer = players[cm.masterId]; + if (players.ContainsKey(cm.masterId)) + { + masterPlayer = players[cm.masterId]; + } + else + { + masterPlayer = players.Aggregate((p1, p2) => p1.Value.userid.CompareTo(p2.Value.userid) > 0 ? p1 : p2).Value; + Debug.LogError("Got an invalid master client id from the server. Using fallback."); + } // no master player yet, add the scene objects @@ -755,11 +763,11 @@ namespace VelNet AddMessage(m); break; } - //new master + // new master case MessageReceivedType.MASTER_MESSAGE: { ChangeMasterMessage m = new ChangeMasterMessage(); - m.masterId = GetIntFromBytes(ReadExact(stream, 4)); //sender is the new master + m.masterId = GetIntFromBytes(ReadExact(stream, 4)); // sender is the new master AddMessage(m); break; } diff --git a/TestVelGameServer/Packages/manifest.json b/TestVelGameServer/Packages/manifest.json index ce7db77..6473ec9 100644 --- a/TestVelGameServer/Packages/manifest.json +++ b/TestVelGameServer/Packages/manifest.json @@ -1,10 +1,11 @@ { "dependencies": { - "com.unity.collab-proxy": "1.15.7", + "com.franzco.unityutilities": "https://github.com/AntonFranzluebbers/unityutilities.git", + "com.unity.collab-proxy": "1.15.15", "com.unity.ide.rider": "2.0.7", - "com.unity.ide.visualstudio": "2.0.14", - "com.unity.ide.vscode": "1.2.4", - "com.unity.test-framework": "1.1.30", + "com.unity.ide.visualstudio": "2.0.15", + "com.unity.ide.vscode": "1.2.5", + "com.unity.test-framework": "1.1.31", "com.unity.textmeshpro": "3.0.6", "com.unity.timeline": "1.4.8", "com.unity.ugui": "1.0.0", diff --git a/TestVelGameServer/Packages/packages-lock.json b/TestVelGameServer/Packages/packages-lock.json index 012ff4f..fce163d 100644 --- a/TestVelGameServer/Packages/packages-lock.json +++ b/TestVelGameServer/Packages/packages-lock.json @@ -1,11 +1,20 @@ { "dependencies": { + "com.franzco.unityutilities": { + "version": "https://github.com/AntonFranzluebbers/unityutilities.git", + "depth": 0, + "source": "git", + "dependencies": { + "com.unity.nuget.newtonsoft-json": "2.0.0-preview", + "com.unity.xr.legacyinputhelpers": "2.1.7" + }, + "hash": "330ff73d80febbf9b505dd0ebd86d370d12fc73d" + }, "com.unity.collab-proxy": { - "version": "1.15.7", + "version": "1.15.15", "depth": 0, "source": "registry", "dependencies": { - "com.unity.nuget.newtonsoft-json": "2.0.0", "com.unity.services.core": "1.0.1" }, "url": "https://packages.unity.com" @@ -27,7 +36,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.visualstudio": { - "version": "2.0.14", + "version": "2.0.15", "depth": 0, "source": "registry", "dependencies": { @@ -36,14 +45,14 @@ "url": "https://packages.unity.com" }, "com.unity.ide.vscode": { - "version": "1.2.4", + "version": "1.2.5", "depth": 0, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" }, "com.unity.nuget.newtonsoft-json": { - "version": "2.0.0", + "version": "2.0.0-preview", "depth": 1, "source": "registry", "dependencies": {}, @@ -59,7 +68,7 @@ "url": "https://packages.unity.com" }, "com.unity.test-framework": { - "version": "1.1.30", + "version": "1.1.31", "depth": 0, "source": "registry", "dependencies": { @@ -99,6 +108,16 @@ "com.unity.modules.imgui": "1.0.0" } }, + "com.unity.xr.legacyinputhelpers": { + "version": "2.1.8", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.xr": "1.0.0" + }, + "url": "https://packages.unity.com" + }, "edu.uga.engr.vel.velnet": { "version": "file:VelNetUnity", "depth": 0, diff --git a/TestVelGameServer/ProjectSettings/InputManager.asset b/TestVelGameServer/ProjectSettings/InputManager.asset index 17c8f53..450ed27 100644 --- a/TestVelGameServer/ProjectSettings/InputManager.asset +++ b/TestVelGameServer/ProjectSettings/InputManager.asset @@ -293,3 +293,291 @@ InputManager: type: 0 axis: 0 joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Thumbstick_X_Left + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Thumbstick_X_Right + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 3 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Thumbstick_Y_Left + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Thumbstick_Y_Right + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 4 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Thumbstick_X_Left + descriptiveName: Secondary 2D Axis for WMR + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 16 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Thumbstick_X_Right + descriptiveName: Secondary 2D Axis for WMR + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 18 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Thumbstick_Y_Left + descriptiveName: Secondary 2D Axis for WMR + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 17 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Thumbstick_Y_Right + descriptiveName: Secondary 2D Axis for WMR + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 19 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Trigger_Left + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 8 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Trigger_Right + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 9 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Grip_Left + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 10 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Grip_Right + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 11 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Button2_Left + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 3 + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 0 + axis: -1 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Button2_Right + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 1 + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 0 + axis: -1 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Button1_Left + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 2 + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 0 + axis: -1 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Button1_Right + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 0 + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 0 + axis: -1 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Thumbstick_Press_Left + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 8 + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 0 + axis: -1 + joyNum: 0 + - serializedVersion: 3 + m_Name: VR_Thumbstick_Press_Right + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 9 + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.001 + sensitivity: 1 + snap: 0 + invert: 0 + type: 0 + axis: -1 + joyNum: 0 diff --git a/TestVelGameServer/ProjectSettings/PackageManagerSettings.asset b/TestVelGameServer/ProjectSettings/PackageManagerSettings.asset index be4a797..568fee6 100644 --- a/TestVelGameServer/ProjectSettings/PackageManagerSettings.asset +++ b/TestVelGameServer/ProjectSettings/PackageManagerSettings.asset @@ -12,11 +12,11 @@ MonoBehaviour: m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} m_Name: m_EditorClassIdentifier: - m_EnablePreviewPackages: 0 + m_EnablePreviewPackages: 1 m_EnablePackageDependencies: 0 m_AdvancedSettingsExpanded: 1 m_ScopedRegistriesSettingsExpanded: 1 - oneTimeWarningShown: 0 + oneTimeWarningShown: 1 m_Registries: - m_Id: main m_Name: diff --git a/TestVelGameServer/ProjectSettings/ProjectSettings.asset b/TestVelGameServer/ProjectSettings/ProjectSettings.asset index 798752b..37ee07f 100644 --- a/TestVelGameServer/ProjectSettings/ProjectSettings.asset +++ b/TestVelGameServer/ProjectSettings/ProjectSettings.asset @@ -714,7 +714,8 @@ PlayerSettings: gcIncremental: 1 assemblyVersionValidation: 1 gcWBarrierValidation: 0 - apiCompatibilityLevelPerPlatform: {} + apiCompatibilityLevelPerPlatform: + Standalone: 3 m_RenderingPath: 1 m_MobileRenderingPath: 1 metroPackageName: Template_3D