From 833eff783d5155c2303ae8db19ad1dc1a1fb40a5 Mon Sep 17 00:00:00 2001 From: MrGadget1024 <9826063+MrGadget1024@users.noreply.github.com> Date: Sat, 25 Mar 2023 14:01:00 -0400 Subject: [PATCH] bunch of changes --- Assets/Mirror/Core/NetworkManager.cs | 2 +- .../Examples/Basic/Scenes/Example.unity | 6 +++--- .../Mirror/Examples/TestNT/Prefabs/Bot.prefab | 2 +- .../Examples/TestNT/Prefabs/BotNinja.prefab | 2 +- .../Examples/TestNT/Prefabs/LoginUI.prefab | 6 +++--- .../Examples/TestNT/Prefabs/NPCNinja.prefab | 2 +- .../TestNT/Prefabs/PlayerNinja.prefab | 14 ++++++-------- .../Examples/TestNT/Scenes/OfflineKcp.unity | 18 +++++++++++++++--- .../Scripts/TestNTNetworkAuthenticator.cs | 1 + .../TestNT/Scripts/TestNTNetworkManager.cs | 19 +++++++++++-------- 10 files changed, 43 insertions(+), 29 deletions(-) diff --git a/Assets/Mirror/Core/NetworkManager.cs b/Assets/Mirror/Core/NetworkManager.cs index 471d521d4..b5d990bc5 100644 --- a/Assets/Mirror/Core/NetworkManager.cs +++ b/Assets/Mirror/Core/NetworkManager.cs @@ -1150,7 +1150,7 @@ void OnServerAddPlayerInternal(NetworkConnectionToClient conn, AddPlayerMessage void OnClientConnectInternal() { - //Debug.Log("NetworkManager.OnClientConnectInternal"); + Debug.Log("NetworkManager.OnClientConnectInternal"); if (authenticator != null) { diff --git a/Assets/Mirror/Examples/Basic/Scenes/Example.unity b/Assets/Mirror/Examples/Basic/Scenes/Example.unity index 16b898011..27f46753c 100644 --- a/Assets/Mirror/Examples/Basic/Scenes/Example.unity +++ b/Assets/Mirror/Examples/Basic/Scenes/Example.unity @@ -168,7 +168,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6b0fecffa3f624585964b0d0eb21b18e, type: 3} m_Name: m_EditorClassIdentifier: - Port: 7777 + Port: 27777 DualMode: 1 NoDelay: 1 Interval: 10 @@ -182,7 +182,7 @@ MonoBehaviour: MaximizeSocketBuffers: 1 ReliableMaxMessageSize: 298449 UnreliableMaxMessageSize: 1199 - debugLog: 0 + debugLog: 1 statisticsGUI: 0 statisticsLog: 0 --- !u!114 &249891956 @@ -205,7 +205,7 @@ MonoBehaviour: offlineScene: onlineScene: transport: {fileID: 249891955} - networkAddress: localhost + networkAddress: mirror.clevertech.net maxConnections: 100 authenticator: {fileID: 0} playerPrefab: {fileID: 897184729387425976, guid: dc2c4328591bef748abb8df795c17202, type: 3} diff --git a/Assets/Mirror/Examples/TestNT/Prefabs/Bot.prefab b/Assets/Mirror/Examples/TestNT/Prefabs/Bot.prefab index 1eb358c68..9acd9d018 100644 --- a/Assets/Mirror/Examples/TestNT/Prefabs/Bot.prefab +++ b/Assets/Mirror/Examples/TestNT/Prefabs/Bot.prefab @@ -124,7 +124,7 @@ MonoBehaviour: compressRotation: 1 positionPrecision: 0.02 scalePrecision: 0.02 - timelineOffset: 0 + timelineOffset: 1 --- !u!114 &4832621091644330542 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Mirror/Examples/TestNT/Prefabs/BotNinja.prefab b/Assets/Mirror/Examples/TestNT/Prefabs/BotNinja.prefab index edd61d0ce..4ff8281fa 100644 --- a/Assets/Mirror/Examples/TestNT/Prefabs/BotNinja.prefab +++ b/Assets/Mirror/Examples/TestNT/Prefabs/BotNinja.prefab @@ -124,7 +124,7 @@ MonoBehaviour: compressRotation: 1 positionPrecision: 0.01 scalePrecision: 0.01 - timelineOffset: 0 + timelineOffset: 1 --- !u!114 &7128055435883173568 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Mirror/Examples/TestNT/Prefabs/LoginUI.prefab b/Assets/Mirror/Examples/TestNT/Prefabs/LoginUI.prefab index cf7b530da..69eee3a68 100644 --- a/Assets/Mirror/Examples/TestNT/Prefabs/LoginUI.prefab +++ b/Assets/Mirror/Examples/TestNT/Prefabs/LoginUI.prefab @@ -201,7 +201,7 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 - m_IsOn: 0 + m_IsOn: 1 --- !u!1 &5678319890717791513 GameObject: m_ObjectHideFlags: 0 @@ -865,7 +865,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &5678319891107958446 RectTransform: m_ObjectHideFlags: 0 @@ -2810,7 +2810,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &5678319892247375076 RectTransform: m_ObjectHideFlags: 0 diff --git a/Assets/Mirror/Examples/TestNT/Prefabs/NPCNinja.prefab b/Assets/Mirror/Examples/TestNT/Prefabs/NPCNinja.prefab index 3988abb84..2d359c537 100644 --- a/Assets/Mirror/Examples/TestNT/Prefabs/NPCNinja.prefab +++ b/Assets/Mirror/Examples/TestNT/Prefabs/NPCNinja.prefab @@ -124,7 +124,7 @@ MonoBehaviour: compressRotation: 1 positionPrecision: 0.01 scalePrecision: 0.01 - timelineOffset: 0 + timelineOffset: 1 --- !u!114 &5677112931370300479 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Mirror/Examples/TestNT/Prefabs/PlayerNinja.prefab b/Assets/Mirror/Examples/TestNT/Prefabs/PlayerNinja.prefab index aa27047a6..55688ed1c 100644 --- a/Assets/Mirror/Examples/TestNT/Prefabs/PlayerNinja.prefab +++ b/Assets/Mirror/Examples/TestNT/Prefabs/PlayerNinja.prefab @@ -285,7 +285,7 @@ MonoBehaviour: m_GameObject: {fileID: 9193589764031967748} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d65c9604d9da1bc4a8f827172ba44b69, type: 3} + m_Script: {fileID: 11500000, guid: 8ff3ba0becae47b8b9381191598957c8, type: 3} m_Name: m_EditorClassIdentifier: syncDirection: 1 @@ -309,8 +309,7 @@ MonoBehaviour: compressRotation: 1 positionPrecision: 0.01 scalePrecision: 0.01 - velocity: {x: 0, y: 0, z: 0} - angVelocity: {x: 0, y: 0, z: 0} + timelineOffset: 0 --- !u!114 &6969103901093452950 MonoBehaviour: m_ObjectHideFlags: 0 @@ -358,13 +357,12 @@ MonoBehaviour: syncDirection: 0 syncMode: 0 syncInterval: 0.1 - NTRCustomSendInterval: {fileID: -609796368898801164} - NetworkTransformReliable: {fileID: 0} + NTRCustomSendInterval: {fileID: 0} + NetworkTransform: {fileID: 0} + NetworkTransformReliable: {fileID: -609796368898801164} clientBufferText: {fileID: 4288642511615728719} serverBufferText: {fileID: 7369590239940030542} snapIntText: {fileID: 5933576731196700504} - catchupColor: {r: 1, g: 0, b: 0, a: 1} - slowdownColor: {r: 0, g: 0, b: 1, a: 1} serverSnapCount: 0 clientSnapCount: 0 --- !u!114 &3312899339913779786 @@ -382,7 +380,7 @@ MonoBehaviour: syncDirection: 0 syncMode: 0 syncInterval: 0.1 - NTR: {fileID: -609796368898801164} + NTR: {fileID: 0} animator: {fileID: 0} characterController: {fileID: 8232044822362603360} physicsMaterial: {fileID: 13400000, guid: c3ac683db06890b49a15dd5009dbd6e8, type: 2} diff --git a/Assets/Mirror/Examples/TestNT/Scenes/OfflineKcp.unity b/Assets/Mirror/Examples/TestNT/Scenes/OfflineKcp.unity index fc54df594..12f62db5a 100644 --- a/Assets/Mirror/Examples/TestNT/Scenes/OfflineKcp.unity +++ b/Assets/Mirror/Examples/TestNT/Scenes/OfflineKcp.unity @@ -205,6 +205,10 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 5678319890702232806, guid: 7cf6fcfd5a32c1545bc85a85bfa9c80b, type: 3} + propertyPath: m_IsOn + value: 1 + objectReference: {fileID: 0} - target: {fileID: 5678319890702232806, guid: 7cf6fcfd5a32c1545bc85a85bfa9c80b, type: 3} propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[2].m_Target value: @@ -213,6 +217,10 @@ PrefabInstance: propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[2].m_MethodName value: SetNinja objectReference: {fileID: 0} + - target: {fileID: 5678319891107958447, guid: 7cf6fcfd5a32c1545bc85a85bfa9c80b, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 5678319891227221139, guid: 7cf6fcfd5a32c1545bc85a85bfa9c80b, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size value: 7 @@ -389,6 +397,10 @@ PrefabInstance: propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName value: SetMultiplier objectReference: {fileID: 0} + - target: {fileID: 5678319892247375077, guid: 7cf6fcfd5a32c1545bc85a85bfa9c80b, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 7cf6fcfd5a32c1545bc85a85bfa9c80b, type: 3} --- !u!1 &821201133 @@ -504,7 +516,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] playerName: - useNinja: 0 + useNinja: 1 isBot: 0 multiplier: 3 --- !u!114 &821201140 @@ -561,7 +573,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6b0fecffa3f624585964b0d0eb21b18e, type: 3} m_Name: m_EditorClassIdentifier: - Port: 7777 + Port: 27777 DualMode: 1 NoDelay: 1 Interval: 10 @@ -575,7 +587,7 @@ MonoBehaviour: MaximizeSocketBuffers: 1 ReliableMaxMessageSize: 298449 UnreliableMaxMessageSize: 1199 - debugLog: 0 + debugLog: 1 statisticsGUI: 0 statisticsLog: 0 --- !u!1 &1511259233 diff --git a/Assets/Mirror/Examples/TestNT/Scripts/TestNTNetworkAuthenticator.cs b/Assets/Mirror/Examples/TestNT/Scripts/TestNTNetworkAuthenticator.cs index d670bd5d1..77d5e07f6 100644 --- a/Assets/Mirror/Examples/TestNT/Scripts/TestNTNetworkAuthenticator.cs +++ b/Assets/Mirror/Examples/TestNT/Scripts/TestNTNetworkAuthenticator.cs @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using Mirror; diff --git a/Assets/Mirror/Examples/TestNT/Scripts/TestNTNetworkManager.cs b/Assets/Mirror/Examples/TestNT/Scripts/TestNTNetworkManager.cs index 7f6f5334e..0392de4cf 100644 --- a/Assets/Mirror/Examples/TestNT/Scripts/TestNTNetworkManager.cs +++ b/Assets/Mirror/Examples/TestNT/Scripts/TestNTNetworkManager.cs @@ -49,12 +49,12 @@ public void OnSelectServer(int server) if (transport is SimpleWebTransport swt) { - swt.port = 7778; + swt.port = 7777; swt.clientUseWss = true; } if (transport is KcpTransport kcp) - kcp.Port = 7778; + kcp.Port = 27777; } if (server == 1) { @@ -75,12 +75,12 @@ public void OnSelectServer(int server) if (transport is SimpleWebTransport swt) { - swt.port = 27778; + swt.port = 7777; swt.clientUseWss = false; } if (transport is KcpTransport kcp) - kcp.Port = 27778; + kcp.Port = 27777; } } @@ -95,10 +95,10 @@ public override void Start() Application.targetFrameRate = 30; if (Transport.active is SimpleWebTransport swt) - swt.port = 27778; + swt.port = 27777; - if (Transport.active is kcp2k.KcpTransport kcp) - kcp.Port = 27778; + if (Transport.active is KcpTransport kcp) + kcp.Port = 27777; ProcessCmdLineArgs(); @@ -122,6 +122,9 @@ public override void Start() swt.clientUseWss = true; } + if (Transport.active is KcpTransport kcp) + kcp.Port = 27777; + ProcessCmdLineArgs(); ((TestNTNetworkAuthenticator)authenticator).SetPlayername($"Bot[{sendRate}] ", true); @@ -211,7 +214,7 @@ public override void OnServerAddPlayer(NetworkConnectionToClient conn) } if (authData.useNinja) - player.GetComponent().sendIntervalMultiplier = authData.multiplier; + player.GetComponent().sendIntervalMultiplier = authData.multiplier; player.transform.LookAt(new Vector3(0f, 1f, 0f));