Skip to content

Commit 1d17590

Browse files
author
FirstGearGames
committed
4.6.14
- Fixed harmless duplicate DefaultPrefabObjects error. - Fixed builds not completing due to misplaced using statement. - Added NetworkTransform.UseScaledTime.
1 parent dab5e79 commit 1d17590

File tree

10 files changed

+31
-90
lines changed

10 files changed

+31
-90
lines changed

Assets/FishNet/CodeGenerating/Processing/Rpc/RpcProcessor.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,6 @@ private MethodDefinition CreateRpcLogicMethod(List<AttributeData> datas, Created
854854
TypeDefinition typeDef = cr.TypeDef;
855855
MethodDefinition originalMd = cr.OriginalMethodDef;
856856

857-
858-
859857
//Methodname for logic methods do not use prefixes because there can be only one.
860858
string methodName = $"{LOGIC_PREFIX}{GetMethodNameAsParameters(originalMd)}";
861859

@@ -968,8 +966,6 @@ private void RedirectOriginalToWriter(List<CreatedRpc> createdRpcs)
968966
* entry. */
969967
MethodDefinition originalMd = createdRpcs[0].OriginalMethodDef;
970968

971-
972-
973969
ILProcessor processor = originalMd.Body.GetILProcessor();
974970
originalMd.Body.Instructions.Clear();
975971

Assets/FishNet/Runtime/Generated/Component/NetworkAnimator/NetworkAnimator.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,6 @@ private void InitializeOnce()
647647
foreach (AnimatorControllerParameter item in _animator.parameters)
648648
{
649649
bool process = !_animator.IsParameterControlledByCurve(item.name);
650-
651650
if (process)
652651
{
653652
//Over 250 parameters; who would do this!?

Assets/FishNet/Runtime/Generated/Component/NetworkTransform/Editor/NetworkTransformEditor.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class NetworkTransformEditor : Editor
1414
private SerializedProperty _componentConfiguration;
1515
private SerializedProperty _synchronizeParent;
1616
private SerializedProperty _packing;
17+
private SerializedProperty _useScaledTime;
1718
private SerializedProperty _interpolation;
1819
private SerializedProperty _extrapolation;
1920
private SerializedProperty _enableTeleport;
@@ -35,6 +36,7 @@ protected virtual void OnEnable()
3536
_componentConfiguration = serializedObject.FindProperty(nameof(_componentConfiguration));
3637
_synchronizeParent = serializedObject.FindProperty(nameof(_synchronizeParent));
3738
_packing = serializedObject.FindProperty(nameof(_packing));
39+
_useScaledTime = serializedObject.FindProperty(nameof(_useScaledTime));
3840
_interpolation = serializedObject.FindProperty(nameof(_interpolation));
3941
_extrapolation = serializedObject.FindProperty(nameof(_extrapolation));
4042
_enableTeleport = serializedObject.FindProperty(nameof(_enableTeleport));
@@ -59,7 +61,6 @@ public override void OnInspectorGUI()
5961
LayoutTools.AddObjectField("Script:", MonoScript.FromMonoBehaviour((NetworkTransform)target), typeof(NetworkTransform), false, EditorLayoutEnableType.Disabled);
6062

6163
bool isPro = false;
62-
6364
if (isPro)
6465
EditorGUILayout.HelpBox(EditingConstants.PRO_ASSETS_UNLOCKED_TEXT, MessageType.None);
6566
else
@@ -77,6 +78,7 @@ public override void OnInspectorGUI()
7778
//Smoothing.
7879
EditorGUILayout.LabelField("Smoothing", EditorStyles.boldLabel);
7980
EditorGUI.indentLevel++;
81+
EditorGUILayout.PropertyField(_useScaledTime);
8082
EditorGUILayout.PropertyField(_interpolation);
8183
EditorGUILayout.PropertyField(_extrapolation, new GUIContent("* Extrapolation"));
8284
EditorGUILayout.PropertyField(_enableTeleport);

Assets/FishNet/Runtime/Generated/Component/NetworkTransform/NetworkTransform.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,12 @@ public void InitializeState() { }
371371
Scale = AutoPackType.Unpacked
372372
};
373373
/// <summary>
374+
/// True to use scaled deltaTime when smoothing.
375+
/// </summary>
376+
[Tooltip("True to use scaled deltaTime when smoothing.")]
377+
[SerializeField]
378+
private bool _useScaledTime = true;
379+
/// <summary>
374380
/// How many ticks to interpolate.
375381
/// </summary>
376382
[Tooltip("How many ticks to interpolate.")]
@@ -761,7 +767,8 @@ private void TryClearGoalDatas_OwnershipChange(NetworkConnection prevOwner, bool
761767

762768
private void TimeManager_OnUpdate()
763769
{
764-
MoveToTarget(Time.deltaTime);
770+
float deltaTime = _useScaledTime ? Time.deltaTime : Time.unscaledDeltaTime;
771+
MoveToTarget(deltaTime);
765772
}
766773

767774
/// <summary>
@@ -1680,17 +1687,15 @@ private void MoveToTarget(float delta)
16801687
//No more in buffer, see if can extrapolate.
16811688
else
16821689
{
1683-
1684-
/* If everything matches up then end queue.
1690+
/* If everything matches up then end queue.
16851691
* Otherwise let it play out until stuff
16861692
* aligns. Generally the time remaining is enough
16871693
* but every once in awhile something goes funky
16881694
* and it's thrown off. */
16891695
if (!HasChanged(td))
16901696
_currentGoalData = null;
16911697
OnInterpolationComplete?.Invoke();
1692-
1693-
}
1698+
}
16941699
}
16951700
}
16961701

@@ -2200,8 +2205,7 @@ private void SetExtrapolatedData(TransformData prev, TransformData next, Channel
22002205
//Default value.
22012206
next.ExtrapolationState = TransformData.ExtrapolateState.Disabled;
22022207

2203-
2204-
}
2208+
}
22052209

22062210
/// <summary>
22072211
/// Updates a client with transform data.

Assets/FishNet/Runtime/Managing/NetworkManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ internal void SetBroadcastName<T>(ushort key) where T : struct, IBroadcast
227227
/// <summary>
228228
/// Version of this release.
229229
/// </summary>
230-
public const string FISHNET_VERSION = "4.6.13";
230+
public const string FISHNET_VERSION = "4.6.14";
231231
/// <summary>
232232
/// Maximum framerate allowed.
233233
/// </summary>

Assets/FishNet/Runtime/Managing/Object/PrefabObjects/DefaultPrefabObjects.cs

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
using FishNet.Documenting;
2-
using FishNet.Object.Helping;
32
using System.Collections.Generic;
43
using UnityEngine;
54
using GameKit.Dependencies.Utilities;
6-
#if UNITY_EDITOR
75
using System.Text;
8-
using FishNet.Editing;
6+
#if UNITY_EDITOR
97
using UnityEditor;
108
#endif
119
using FishNet.Object;
@@ -17,32 +15,10 @@ namespace FishNet.Managing.Object
1715
public class DefaultPrefabObjects : SinglePrefabObjects
1816
{
1917
/// <summary>
20-
/// Instance of this class.
18+
/// Used for version rebuilding.
2119
/// </summary>
22-
/// <remarks>This is used to ensure only one copy of this class exists on disk.</remarks>
23-
[System.NonSerialized]
24-
internal static DefaultPrefabObjects Instance;
25-
2620
private StringBuilder _stringBuilder = new();
27-
28-
public DefaultPrefabObjects()
29-
{
30-
if (Instance != null)
31-
{
32-
string searchLiteral = "\"t: DefaultPrefabObjects\"";
33-
Debug.LogError($"{nameof(DefaultPrefabObjects)} already exists. There should be only one instance of {nameof(DefaultPrefabObjects)} in memory, as well on disk. Search (without quotations) {searchLiteral} in your Project tab and delete all copies. A new file will be automatically generated after all {nameof(DefaultPrefabObjects)} are removed.");
34-
35-
return;
36-
}
37-
38-
Instance = this;
39-
}
4021

41-
~DefaultPrefabObjects()
42-
{
43-
if (Instance == this)
44-
Instance = null;
45-
}
4622

4723
/// <summary>
4824
/// Sets asset path hashes for prefabs starting at index, or if missing.

Assets/FishNet/Runtime/Plugins/ColliderRollback/Scripts/RollbackManager.cs

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -78,32 +78,27 @@ internal void InitializeOnce_Internal(NetworkManager manager)
7878
[Obsolete("Use Rollback(Vector3, Vector3, float, PreciseTick, RollbackPhysicsType.Physics, bool) instead.")] //Remove on V5
7979
public void Rollback(Vector3 origin, Vector3 normalizedDirection, float distance, PreciseTick pt, bool asOwnerAndClientHost = false)
8080
{
81-
82-
}
81+
}
8382

8483
[Obsolete("Use Rollback(Scene, Vector3, Vector3, float, PreciseTick, RollbackPhysicsType.Physics, bool) instead.")] //Remove on V5
8584
public void Rollback(Scene scene, Vector3 origin, Vector3 normalizedDirection, float distance, PreciseTick pt, bool asOwnerAndClientHost = false)
8685
{
87-
88-
}
86+
}
8987

9088
[Obsolete("Use Rollback(int, Vector3, Vector3, float, PreciseTick, RollbackPhysicsType.Physics, bool) instead.")] //Remove on V5
9189
public void Rollback(int sceneHandle, Vector3 origin, Vector3 normalizedDirection, float distance, PreciseTick pt, bool asOwnerAndClientHost = false)
9290
{
93-
94-
}
91+
}
9592

9693
[Obsolete("Use Rollback(Scene, Vector3, Vector3, float, PreciseTick, RollbackPhysicsType.Physics2D, bool) instead.")] //Remove on V5
9794
public void Rollback(Scene scene, Vector2 origin, Vector2 normalizedDirection, float distance, PreciseTick pt, bool asOwnerAndClientHost = false)
9895
{
99-
100-
}
96+
}
10197

10298
[Obsolete("Use Rollback(Vector3, Vector3, float, PreciseTick, RollbackPhysicsType.Physics2D, bool) instead.")] //Remove on V5
10399
public void Rollback(Vector2 origin, Vector2 normalizedDirection, float distance, PreciseTick pt, bool asOwnerAndClientHost = false)
104100
{
105-
106-
}
101+
}
107102

108103
/// <summary>
109104
/// Rolls back all colliders.
@@ -113,8 +108,7 @@ public void Rollback(Vector2 origin, Vector2 normalizedDirection, float distance
113108
/// <param name = "asOwnerAndClientHost">True if IsOwner of the object the raycast is for. This can be ignored and only provides more accurate results for clientHost.</param>
114109
public void Rollback(PreciseTick pt, RollbackPhysicsType physicsType, bool asOwnerAndClientHost = false)
115110
{
116-
117-
}
111+
}
118112

119113
/// <summary>
120114
/// Rolls back all colliders in a scene.
@@ -125,8 +119,7 @@ public void Rollback(PreciseTick pt, RollbackPhysicsType physicsType, bool asOwn
125119
/// <param name = "asOwnerAndClientHost">True if IsOwner of the object the raycast is for. This can be ignored and only provides more accurate results for clientHost.</param>
126120
public void Rollback(Scene scene, PreciseTick pt, RollbackPhysicsType physicsType, bool asOwnerAndClientHost = false)
127121
{
128-
129-
}
122+
}
130123

131124
/// <summary>
132125
/// Rolls back all colliders in a scene.
@@ -137,8 +130,7 @@ public void Rollback(Scene scene, PreciseTick pt, RollbackPhysicsType physicsTyp
137130
/// <param name = "asOwnerAndClientHost">True if IsOwner of the object the raycast is for. This can be ignored and only provides more accurate results for clientHost.</param>
138131
public void Rollback(int sceneHandle, PreciseTick pt, RollbackPhysicsType physicsType, bool asOwnerAndClientHost = false)
139132
{
140-
141-
}
133+
}
142134

143135
/// <summary>
144136
/// Rolls back colliders hit by a test cast against bounding boxes.
@@ -151,8 +143,7 @@ public void Rollback(int sceneHandle, PreciseTick pt, RollbackPhysicsType physic
151143
/// <param name = "asOwnerAndClientHost">True if IsOwner of the object the raycast is for. This can be ignored and only provides more accurate results for clientHost.</param>
152144
public void Rollback(Vector3 origin, Vector3 normalizedDirection, float distance, PreciseTick pt, RollbackPhysicsType physicsType, bool asOwnerAndClientHost = false)
153145
{
154-
155-
}
146+
}
156147

157148
/// <summary>
158149
/// Rolls back colliders hit by a test cast against bounding boxes, in a specific scene.
@@ -166,8 +157,7 @@ public void Rollback(Vector3 origin, Vector3 normalizedDirection, float distance
166157
/// <param name = "asOwnerAndClientHost">True if IsOwner of the object the raycast is for. This can be ignored and only provides more accurate results for clientHost.</param>
167158
public void Rollback(Scene scene, Vector3 origin, Vector3 normalizedDirection, float distance, PreciseTick pt, RollbackPhysicsType physicsType, bool asOwnerAndClientHost = false)
168159
{
169-
170-
}
160+
}
171161

172162
/// <summary>
173163
/// Rolls back colliders hit by a test cast against bounding boxes, in a specific scene.
@@ -181,19 +171,14 @@ public void Rollback(Scene scene, Vector3 origin, Vector3 normalizedDirection, f
181171
/// <param name = "asOwnerAndClientHost">True if IsOwner of the object the raycast is for. This can be ignored and only provides more accurate results for clientHost.</param>
182172
public void Rollback(int sceneHandle, Vector3 origin, Vector3 normalizedDirection, float distance, PreciseTick pt, RollbackPhysicsType physicsType, bool asOwnerAndClientHost = false)
183173
{
184-
185-
}
186-
187-
174+
}
188175

189176
/// <summary>
190177
/// Returns all ColliderRollback objects back to their original position.
191178
/// </summary>
192179
public void Return()
193180
{
194-
195-
}
181+
}
196182

197-
198-
}
183+
}
199184
}

Assets/FishNet/Runtime/Plugins/Yak/Core/ClientSocket.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,15 @@ internal bool StartConnection()
2828
return true;
2929
}
3030

31-
32-
3331
/// <summary>
3432
/// Stops the local socket.
3533
/// </summary>
3634
internal bool StopConnection()
3735
{
38-
3936
return true;
4037
}
4138

42-
43-
44-
45-
46-
47-
4839
#region Local server.
49-
5040
#endregion
5141
}
5242
}

Assets/FishNet/Runtime/Plugins/Yak/Core/ServerSocket.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,11 @@ internal bool StartConnection()
4444
return true;
4545
}
4646

47-
48-
4947
/// <summary>
5048
/// Stops the local socket.
5149
/// </summary>
5250
internal bool StopConnection()
5351
{
54-
5552
return true;
5653
}
5754

@@ -61,18 +58,10 @@ internal bool StopConnection()
6158
/// <param name = "connectionId">ConnectionId of the client to disconnect.</param>
6259
internal bool StopConnection(int connectionId)
6360
{
64-
6561
return true;
6662
}
6763

68-
69-
70-
71-
7264
#region Local client.
73-
74-
75-
7665
#endregion
7766
}
7867
}

Assets/FishNet/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.firstgeargames.fishnet",
3-
"version": "4.6.13",
3+
"version": "4.6.14",
44
"displayName": "FishNet: Networking Evolved",
55
"description": "A feature-rich Unity networking solution aimed towards reliability, ease of use, efficiency, and flexibility.",
66
"unity": "2021.3",

0 commit comments

Comments
 (0)