Skip to content

Commit 32528cb

Browse files
author
FirstGearGames
committed
4.6.22R
- Fixed removed 'useLocalSpace' references from MovementSettingsDrawer (#1019). - Changed Beta ReplicateStates moved into Stable; old states have been removed.
1 parent f8a9985 commit 32528cb

8 files changed

Lines changed: 6 additions & 172 deletions

File tree

Assets/FishNet/Demos/Prediction/CharacterController/Scripts/CharacterControllerPrediction.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if !FISHNET_STABLE_REPLICATESTATES
2-
using System;
1+
using System;
32
using FishNet.Component.Prediction;
43
using FishNet.Connection;
54
using FishNet.Object.Prediction;
@@ -497,5 +496,4 @@ private bool TryRemoveStamina(float value)
497496
return true;
498497
}
499498
}
500-
}
501-
#endif
499+
}
Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1 @@
1-
#if !FISHNET_STABLE_REPLICATESTATES
2-
using UnityEngine;
3-
using UnityEngine.UI;
4-
5-
namespace FishNet.Demo.Prediction.CharacterControllers
6-
{
7-
/// <summary>
8-
/// This is a basic implementation of hooking up the UI to the owners character stamina.
9-
/// </summary>
10-
public class StaminaCanvas : MonoBehaviour
11-
{
12-
[SerializeField]
13-
private Image _staminaBar;
14-
private CharacterControllerPrediction _character;
15-
16-
private void Awake()
17-
{
18-
CharacterControllerPrediction.OnOwner += CCP_OnOwner;
19-
}
20-
21-
private void OnDestroy()
22-
{
23-
CharacterControllerPrediction.OnOwner -= CCP_OnOwner;
24-
}
25-
26-
private void Update()
27-
{
28-
if (_character == null)
29-
return;
30-
31-
float fillAmount = _character.Stamina / CharacterControllerPrediction.Maximum_Stamina;
32-
_staminaBar.fillAmount = fillAmount;
33-
}
34-
35-
private void CCP_OnOwner(CharacterControllerPrediction ccp)
36-
{
37-
_character = ccp;
38-
}
39-
}
40-
}
41-
#endif
1+
//Intentionally left blank.

Assets/FishNet/Runtime/Editor/Configuring/BetaModeMenu.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ namespace FishNet.Editing.Beta
77
public class BetaModeMenu : MonoBehaviour
88
{
99
#region const.
10-
private const string STABLE_REPLICATESTATES_DEFINE = "FISHNET_STABLE_REPLICATESTATES";
1110
private const string STABLE_RECURSIVE_DESPAWNS_DEFINE = "FISHNET_STABLE_RECURSIVE_DESPAWNS";
1211
private const string THREADED_TICKSMOOTHERS_DEFINE = "FISHNET_THREADED_TICKSMOOTHERS";
1312
private const string THREADED_COLLIDER_ROLLBACK_DEFINE = "FISHNET_THREADED_COLLIDER_ROLLBACK";
@@ -29,22 +28,6 @@ private static void SetBetaRecursiveDespawns(bool useStable)
2928
}
3029
#endregion
3130

32-
#region Beta ReplicateStates
33-
#if FISHNET_STABLE_REPLICATESTATES
34-
[MenuItem("Tools/Fish-Networking/Beta/Enable ReplicateStates", false, -1101)]
35-
private static void EnableBetaReplicateStates() => SetBetaReplicateStates(useStable: false);
36-
#else
37-
[MenuItem("Tools/Fish-Networking/Beta/Disable ReplicateStates", false, -1101)]
38-
private static void DisableBetaReplicateStates() => SetBetaReplicateStates(useStable: true);
39-
#endif
40-
private static void SetBetaReplicateStates(bool useStable)
41-
{
42-
bool result = DeveloperMenu.RemoveOrAddDefine(STABLE_REPLICATESTATES_DEFINE, removeDefine: !useStable);
43-
if (result)
44-
Debug.LogWarning($"Beta ReplicateStates are now {GetBetaEnabledText(useStable)}.");
45-
}
46-
#endregion
47-
4831
#region Beta ThreadedSmothers
4932
/* Changes by https://github.com/belplaton
5033
* Content: Threaded TickSmoothers

Assets/FishNet/Runtime/Generated/Component/TickSmoothing/Editor/MovementSettingsDrawer.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
2626
SerializedProperty adaptiveInterpolationValue = property.FindPropertyRelative("AdaptiveInterpolationValue");
2727
SerializedProperty interpolationValue = property.FindPropertyRelative("InterpolationValue");
2828
SerializedProperty smoothedProperties = property.FindPropertyRelative("SmoothedProperties");
29-
SerializedProperty useLocalSpace = property.FindPropertyRelative("UseLocalSpace");
3029
SerializedProperty snapNonSmoothedProperties = property.FindPropertyRelative("SnapNonSmoothedProperties");
3130

3231
_propertyDrawer.DrawProperty(enableTeleport, "Enable Teleport");
@@ -38,7 +37,6 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
3837
_propertyDrawer.DrawProperty(interpolationValue, "Interpolation Value", indent: 1);
3938

4039
_propertyDrawer.DrawProperty(smoothedProperties, "Smoothed Properties");
41-
_propertyDrawer.DrawProperty(useLocalSpace, "Use Local Space");
4240
if ((uint)smoothedProperties.intValue != (uint)TransformPropertiesFlag.Everything)
4341
_propertyDrawer.DrawProperty(snapNonSmoothedProperties, "Snap Non-Smoothed Properties", indent: 1);
4442

Assets/FishNet/Runtime/Managing/NetworkManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ internal void SetBroadcastName<T>(ushort key) where T : struct, IBroadcast
239239
/// <summary>
240240
/// Version of this release.
241241
/// </summary>
242-
public const string FISHNET_VERSION = "4.6.21";
242+
public const string FISHNET_VERSION = "4.6.22";
243243
/// <summary>
244244
/// Maximum framerate allowed.
245245
/// </summary>

Assets/FishNet/Runtime/Object/NetworkBehaviour/NetworkBehaviour.Prediction.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -575,12 +575,8 @@ private bool HasServerRigidbodyTransformChanged(bool updateLastValues)
575575

576576
SetReplicateTick(dataTick, createdReplicate: true);
577577

578-
#if !FISHNET_STABLE_REPLICATESTATES
579578
// Owner always replicates with new data.
580579
del.Invoke(dataContainer.Data, ReplicateState.Ticked | ReplicateState.Created, dataContainer.Channel);
581-
#else
582-
del.Invoke(dataContainer.Data, ReplicateState.CurrentCreated, dataContainer.Channel);
583-
#endif
584580
}
585581

586582
/// <summary>
@@ -759,11 +755,7 @@ internal virtual void Replicate_Replay_Start(uint replayTick) { }
759755
if (findResult == ReplicateTickFinder.DataPlacementResult.Exact)
760756
{
761757
dataContainer = replicatesHistory[replicateIndex];
762-
#if !FISHNET_STABLE_REPLICATESTATES
763758
state = ReplicateState.Replayed | ReplicateState.Ticked | ReplicateState.Created;
764-
#else
765-
state = ReplicateState.ReplayedCreated;
766-
#endif
767759

768760
//SetReplicateTick(data.GetTick(), true);
769761
del.Invoke(dataContainer.Data, state, dataContainer.Channel);
@@ -789,7 +781,6 @@ internal virtual void Replicate_Replay_Start(uint replayTick) { }
789781
{
790782
dataContainer = replicatesHistory[replicateIndex];
791783

792-
#if !FISHNET_STABLE_REPLICATESTATES
793784
state = ReplicateState.Replayed;
794785

795786
bool isCreated = dataContainer.IsCreated;
@@ -801,10 +792,6 @@ internal virtual void Replicate_Replay_Start(uint replayTick) { }
801792
* and not yet ticked if state order is inserted rather than append. */
802793
if (replayTick <= _lastOrderedReplicatedTick || isCreated)
803794
state |= ReplicateState.Ticked;
804-
#else
805-
//state = ReplicateState.ReplayedCreated;
806-
state = (dataContainer.IsCreated) ? ReplicateState.ReplayedCreated : ReplicateState.ReplayedFuture;
807-
#endif
808795
}
809796
else
810797
{
@@ -820,11 +807,7 @@ internal virtual void Replicate_Replay_Start(uint replayTick) { }
820807
void SetDataToDefault()
821808
{
822809
dataContainer = ReplicateDataContainer<T>.GetDefault(replayTick);
823-
#if !FISHNET_STABLE_REPLICATESTATES
824810
state = ReplicateState.Replayed;
825-
#else
826-
state = ReplicateState.ReplayedFuture;
827-
#endif
828811
}
829812

830813
del.Invoke(dataContainer.Data, state, dataContainer.Channel);
Lines changed: 1 addition & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if !FISHNET_STABLE_REPLICATESTATES
2-
using System;
1+
using System;
32
using FishNet.Utility;
43
using System.Runtime.CompilerServices;
54

@@ -88,90 +87,3 @@ public static class ReplicateStateExtensions
8887
public static bool FastContains(this ReplicateState whole, ReplicateState part) => (whole & part) == part;
8988
}
9089
}
91-
#else
92-
using FishNet.Utility;
93-
using System.Runtime.CompilerServices;
94-
95-
[assembly: InternalsVisibleTo(UtilityConstants.CODEGEN_ASSEMBLY_NAME)]
96-
97-
namespace FishNet.Object
98-
{
99-
public enum ReplicateState : byte
100-
{
101-
/// <summary>
102-
/// The default value of this state.
103-
/// This value should never occur when a replicate runs.
104-
/// </summary>
105-
Invalid = 0,
106-
/// <summary>
107-
/// Value is seen on server and clients.
108-
/// Client or server has data on the object for the tick.
109-
/// Clients will only see this value on spectated objects when PredictionManager is using Appended state order.
110-
/// </summary>
111-
CurrentCreated = 1,
112-
/// <summary>
113-
/// Value is only seen on server when they do not own the object.
114-
/// Server does not have data on this non-owned object for the tick but expected to, such as a state should have arrived but did not.
115-
/// </summary>
116-
[System.Obsolete("This is currently not used but may be in a later release. Please read summary for value.")]
117-
CurrentPredicted = 2,
118-
/// <summary>
119-
/// Value is only seen on clients when they do not own the object.
120-
/// Client does not have data for the tick but expected to, such as a state should have arrived but did not.
121-
/// Client is currently reconciling.
122-
/// </summary>
123-
[System.Obsolete("This is currently not used but may be in a later release. Please read summary for value.")]
124-
ReplayedPredicted = 3,
125-
/// <summary>
126-
/// Value is only seen on clients.
127-
/// Client has data on the object for the tick.
128-
/// Client is currently reconciling.
129-
/// </summary>
130-
ReplayedCreated = 4,
131-
/// <summary>
132-
/// Value is only seen on clients when they do not own the object.
133-
/// Tick is in the future and data cannot yet be known.
134-
/// This can be used to exit replicate early to not process actions, or create actions based on previous datas.
135-
/// </summary>
136-
CurrentFuture = 5,
137-
/// <summary>
138-
/// Value is only seen on clients when they do not own the object.
139-
/// Tick is in the future and data cannot yet be known.
140-
/// Client is currently reconciling.
141-
/// This can be used to exit replicate early to not process actions, or create actions based on previous datas.
142-
/// </summary>
143-
ReplayedFuture = 6,
144-
}
145-
146-
public static class ReplicateStateExtensions
147-
{
148-
/// <summary>
149-
/// Returns if value is valid.
150-
/// This should never be false.
151-
/// </summary>
152-
public static bool IsValid(this ReplicateState value) => (value != ReplicateState.Invalid);
153-
154-
/// <summary>
155-
/// Returns if value is replayed.
156-
/// </summary>
157-
#pragma warning disable CS0618 // Type or member is obsolete
158-
public static bool IsReplayed(this ReplicateState value) => (value == ReplicateState.ReplayedPredicted || value == ReplicateState.ReplayedCreated || value == ReplicateState.ReplayedFuture);
159-
#pragma warning restore CS0618 // Type or member is obsolete
160-
/// <summary>
161-
/// Returns if value is user created.
162-
/// </summary>
163-
public static bool IsCreated(this ReplicateState value) => (value == ReplicateState.CurrentCreated || value == ReplicateState.ReplayedCreated);
164-
165-
/// <summary>
166-
/// Returns if value is predicted.
167-
/// </summary>
168-
#pragma warning disable CS0618 // Type or member is obsolete
169-
public static bool IsPredicted(this ReplicateState value) => (value == ReplicateState.ReplayedPredicted);
170-
#pragma warning restore CS0618 // Type or member is obsolete
171-
/// <summary>
172-
/// Returns if value is in the future.
173-
/// </summary>
174-
public static bool IsFuture(this ReplicateState value) => (value == ReplicateState.CurrentFuture || value == ReplicateState.ReplayedFuture);
175-
}
176-
}
177-
#endif

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.21",
3+
"version": "4.6.22",
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)