Skip to content

feat: Remove lag compensation related stuff from config #622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions com.unity.multiplayer.mlapi/Editor/NetworkManagerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class NetworkManagerEditor : Editor
private SerializedProperty m_MaxObjectUpdatesPerTickProperty;
private SerializedProperty m_ClientConnectionBufferTimeoutProperty;
private SerializedProperty m_ConnectionApprovalProperty;
private SerializedProperty m_SecondsHistoryProperty;
private SerializedProperty m_EnableTimeResyncProperty;
private SerializedProperty m_TimeResyncIntervalProperty;
private SerializedProperty m_EnableNetworkVariableProperty;
Expand Down Expand Up @@ -106,7 +105,6 @@ private void Init()
m_EventTickrateProperty = m_NetworkConfigProperty.FindPropertyRelative("EventTickrate");
m_ClientConnectionBufferTimeoutProperty = m_NetworkConfigProperty.FindPropertyRelative("ClientConnectionBufferTimeout");
m_ConnectionApprovalProperty = m_NetworkConfigProperty.FindPropertyRelative("ConnectionApproval");
m_SecondsHistoryProperty = m_NetworkConfigProperty.FindPropertyRelative("SecondsHistory");
m_EnableTimeResyncProperty = m_NetworkConfigProperty.FindPropertyRelative("EnableTimeResync");
m_TimeResyncIntervalProperty = m_NetworkConfigProperty.FindPropertyRelative("TimeResyncInterval");
m_EnableNetworkVariableProperty = m_NetworkConfigProperty.FindPropertyRelative("EnableNetworkVariable");
Expand Down Expand Up @@ -144,7 +142,6 @@ private void CheckNullProperties()
m_EventTickrateProperty = m_NetworkConfigProperty.FindPropertyRelative("EventTickrate");
m_ClientConnectionBufferTimeoutProperty = m_NetworkConfigProperty.FindPropertyRelative("ClientConnectionBufferTimeout");
m_ConnectionApprovalProperty = m_NetworkConfigProperty.FindPropertyRelative("ConnectionApproval");
m_SecondsHistoryProperty = m_NetworkConfigProperty.FindPropertyRelative("SecondsHistory");
m_EnableTimeResyncProperty = m_NetworkConfigProperty.FindPropertyRelative("EnableTimeResync");
m_TimeResyncIntervalProperty = m_NetworkConfigProperty.FindPropertyRelative("TimeResyncInterval");
m_EnableNetworkVariableProperty = m_NetworkConfigProperty.FindPropertyRelative("EnableNetworkVariable");
Expand Down Expand Up @@ -309,9 +306,6 @@ public override void OnInspectorGUI()
EditorGUILayout.PropertyField(m_ClientConnectionBufferTimeoutProperty);
}

EditorGUILayout.LabelField("Lag Compensation", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_SecondsHistoryProperty);

EditorGUILayout.LabelField("Spawning", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_CreatePlayerPrefabProperty);
EditorGUILayout.PropertyField(m_ForceSamePrefabsProperty);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class NetworkConfig
/// <summary>
/// The amount of times per second internal frame events will occur, e.g. send checking.
/// </summary>
[Tooltip("The amount of times per second the internal event loop will run. This includes for example NetworkVariable checking and LagCompensation tracking")]
[Tooltip("The amount of times per second the internal event loop will run. This includes for example NetworkVariable checking.")]
public int EventTickrate = 64;

/// <summary>
Expand All @@ -110,12 +110,6 @@ public class NetworkConfig
[Tooltip("The connection data sent along with connection requests")]
public byte[] ConnectionData = new byte[0];

/// <summary>
/// The amount of seconds to keep a lag compensation position history
/// </summary>
[Tooltip("The amount of seconds to keep lag compensation position history")]
public int SecondsHistory = 5;

/// <summary>
/// If your logic uses the NetworkTime, this should probably be turned off. If however it's needed to maximize accuracy, this is recommended to be turned on
/// </summary>
Expand Down Expand Up @@ -233,7 +227,6 @@ public string ToBase64()
writer.WriteInt32Packed(config.EventTickrate);
writer.WriteInt32Packed(config.ClientConnectionBufferTimeout);
writer.WriteBool(config.ConnectionApproval);
writer.WriteInt32Packed(config.SecondsHistory);
writer.WriteInt32Packed(config.LoadSceneTimeOut);
writer.WriteBool(config.EnableTimeResync);
writer.WriteBool(config.EnsureNetworkVariableLengthSafety);
Expand Down Expand Up @@ -278,7 +271,6 @@ public void FromBase64(string base64)
config.EventTickrate = reader.ReadInt32Packed();
config.ClientConnectionBufferTimeout = reader.ReadInt32Packed();
config.ConnectionApproval = reader.ReadBool();
config.SecondsHistory = reader.ReadInt32Packed();
config.LoadSceneTimeOut = reader.ReadInt32Packed();
config.EnableTimeResync = reader.ReadBool();
config.EnsureNetworkVariableLengthSafety = reader.ReadBool();
Expand Down