Skip to content

Commit

Permalink
4.0.9 (file returns fixed)
Browse files Browse the repository at this point in the history
- Changed GeneratedComparer<T> renamed to PublicPropertyComparer<T>.
- Fixed PredictionManager.RedundancyCount being different between WebGL and server builds.
- Fixed Prediction 2 states not splitting properly when large.
- Improved simplified IntermediateLayer.
- Added Tugboat IPv6 toggling. (#566)
- Added Tugboat DontRoute. (#540)
- Changed Prediction 2 ReplicateV2 and ReconcileV2 renamed to Replicate and Reconcile.
- Improved demo scenes now use their own prefab collection lists. (#549)
- Fixed Prediction 1 demo scene prefabs. (#552)
- Added Server/ClientManager.SetFrameRate.
- Fixed OnStopNetworking calling on clientHost before client was able to deinitialize.
- Fixed SyncTypes not clearing dirty state when values were written for despawn. (#574)
- Improved updated PredictedObject.Rigidbodies API for Unity 2021.
- Improved SyncTypes of collections no longer allocate during initialization.
- Fixed jitter on Prediction 2 smoothing.
- Added a variety of GetXYZMoveRates functions to MoveRates.
- Added MoveRates and MoveRatesCls.MoveToTarget.
- Removed MoveRatesCls.Multiply
- Improved exposed SyncVar.SetInitialValues.
- Added NetworkManager.GetPooledInstantiated makeActive and parent options.
- Added ObjectPool.RetrievObject makeActive and parent options.
- Fixed transform values being applied incorrectly during spawns.
- Fixed possible memory leak if an object was stored to DefaultObjectPool then destroyed, and object pool was never used afterwards.
- Changed Prediction V2 PredictionManager.IsReplaying() renamed to PredictionManager.IsReconciling().
- Fixed Prediction V2 calling dispose on replicate datas early.
- Added Prediction V2 PredictionManager.ClientReplayTick.
- Added Prediction V2 PredictionManager.ServerReplayTick.
- Added Prediction V2 PredictionManager.ClientStateTick.
- Added Prediction V2 PredictionManager.ServerStateTick.
- Added Prediction V2 NetworkBehaviour.IsReconiling.
- Added NetworkBehaviour.Write/ReadPayload.
- Removed SyncType forwarding for predicted spawns; Write/ReadPayload should now be used.
- Added Writer/ReaderPool.StoreAndDefault.
- Fixed Unity stripping necessary NetworkTransform code for Android builds.
- Changed FishNet\Plugins is now reserved for user imported plugins. Internal plugins have been moved to FishNet\Runtime\Plugins.
  • Loading branch information
FirstGearGames committed Jan 26, 2024
1 parent 16499f1 commit 71950d1
Show file tree
Hide file tree
Showing 88 changed files with 7,490 additions and 7,479 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ internal void CreateReplicateDelegate(MethodDefinition originalMethodDef, Method
/// <param name="rpcType"></param>
internal void CreateRpcDelegate(bool runLocally, TypeDefinition typeDef, MethodDefinition readerMethodDef, RpcType rpcType, uint methodHash, CustomAttribute rpcAttribute)
{



MethodDefinition methodDef = typeDef.GetMethod(NetworkBehaviourProcessor.NETWORKINITIALIZE_EARLY_INTERNAL_NAME);
ILProcessor processor = methodDef.Body.GetILProcessor();
Expand Down
4 changes: 2 additions & 2 deletions Assets/FishNet/CodeGenerating/ILCore/FishNetILPP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ private bool CreateQOLAttributes(CodegenSession session)
bool modified = false;

bool codeStripping = false;


List<TypeDefinition> allTypeDefs = session.Module.Types.ToList();

/* First pass, potentially only pass.
Expand All @@ -315,7 +315,7 @@ private bool CreateQOLAttributes(CodegenSession session)
modified |= session.GetClass<QolAttributeProcessor>().Process(td, codeStripping);
}




return modified;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ internal bool ProcessLocal(TypeDefinition typeDef)
CreateNetworkInitializeMethods(td, out networkInitializeIfDisabledMd);
CallNetworkInitializesFromNetworkInitializeIfDisabled(networkInitializeIfDisabledMd);




/* Prediction. */
/* Run prediction first since prediction will modify
Expand Down Expand Up @@ -200,7 +200,7 @@ internal bool NonNetworkBehaviourHasInvalidAttributes(Collection<TypeDefinition>
return false;
}




/// <summary>
/// Calls the next awake method if the nested awake was created by codegen.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal bool Process(TypeDefinition typeDef, bool moveStrippedCalls)
bool modified = false;
List<MethodDefinition> methods = typeDef.Methods.ToList();




foreach (MethodDefinition md in methods)
{
Expand Down Expand Up @@ -152,14 +152,14 @@ private void CreateAttributeMethod(MethodDefinition methodDef, CustomAttribute q

bool StripMethod(MethodDefinition md)
{



//Fall through.
return false;
}
}



}

}
12 changes: 6 additions & 6 deletions Assets/FishNet/CodeGenerating/Processing/Rpc/RpcProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ private MethodDefinition CreateRpcWriterMethod(List<ParameterDefinition> seriali
{
intentionallyNull = false;




string methodName = $"{WRITER_PREFIX}{GetRpcMethodName(cr)}";
/* If method already exist then clear it. This
Expand Down Expand Up @@ -379,7 +379,7 @@ private bool CreateClientRpcWriterMethod(List<ParameterDefinition> serializedPar
/* Creates basic ServerRpc and ClientRpc
* conditions such as if requireOwnership ect..
* or if (!base.isClient) */


CreateClientRpcConditionsForServer(writerMd);

VariableDefinition channelVariableDef = CreateAndPopulateChannelVariable(writerMd, channelParameterDef);
Expand Down Expand Up @@ -437,7 +437,7 @@ private bool CreateServerRpcWriterMethod(List<ParameterDefinition> serializedPar
/* Creates basic ServerRpc
* conditions such as if requireOwnership ect..
* or if (!base.isClient) */


CreateServerRpcConditionsForClient(writerMd, cr.Attribute);

VariableDefinition channelVariableDef = CreateAndPopulateChannelVariable(writerMd, channelParameterDef);
Expand Down Expand Up @@ -503,7 +503,7 @@ private MethodDefinition CreateRpcReaderMethod(List<ParameterDefinition> seriali
MethodDefinition logicMd = cr.LogicMethodDef;
CustomAttribute rpcAttribute = cr.Attribute;




string methodName = $"{READER_PREFIX}{GetRpcMethodName(cr)}";
/* If method already exist then just return it. This
Expand Down Expand Up @@ -876,7 +876,7 @@ private MethodDefinition CreateRpcLogicMethod(List<AttributeData> datas, Created
TypeDefinition typeDef = cr.TypeDef;
MethodDefinition originalMd = cr.OriginalMethodDef;




//Methodname for logic methods do not use prefixes because there can be only one.
string methodName = $"{LOGIC_PREFIX}{GetMethodNameAsParameters(originalMd)}";
Expand Down Expand Up @@ -933,7 +933,7 @@ private void RedirectOriginalToWriter(List<CreatedRpc> createdRpcs)
* entry. */
MethodDefinition originalMd = createdRpcs[0].OriginalMethodDef;




ILProcessor processor = originalMd.Body.GetILProcessor();
originalMd.Body.Instructions.Clear();
Expand Down
32 changes: 16 additions & 16 deletions Assets/FishNet/Demos/ColliderRollback/Scripts/DestroyAfterDelay.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
using UnityEngine;

namespace FishNet.Example.ColliderRollbacks
{
public class DestroyAfterDelay : MonoBehaviour
{
[SerializeField]
private float _delay = 1f;

private void Awake()
{
Destroy(gameObject, _delay);
}

}

using UnityEngine;

namespace FishNet.Example.ColliderRollbacks
{
public class DestroyAfterDelay : MonoBehaviour
{
[SerializeField]
private float _delay = 1f;

private void Awake()
{
Destroy(gameObject, _delay);
}

}

}
132 changes: 66 additions & 66 deletions Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Aim.cs
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
using FishNet.Object;
using UnityEngine;


namespace FishNet.Example.ColliderRollbacks
{

/// <summary>
/// DEMO. CODE IS NOT OPTIMIZED.
/// Aims the camera.
/// </summary>
public class Aim : NetworkBehaviour
{

public PlayerCamera PlayerCamera { get; private set; }
private readonly Vector3 _offset = new Vector3(0f, 1.65f, 0f);

public override void OnStartClient()
{
if (base.IsOwner)
PlayerCamera = Camera.main.transform.GetComponent<PlayerCamera>();
}

private void Update()
{
if (!base.IsOwner || PlayerCamera == null)
return;

Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
MoveAim();
MoveCamera();
}

/// <summary>
/// Aims camera.
/// </summary>
private void MoveAim()
{
float speed = 2f;
//Yaw.
transform.Rotate(new Vector3(0f, Input.GetAxis("Mouse X") * speed, 0f));
//Pitch.
float pitch = PlayerCamera.transform.eulerAngles.x - (Input.GetAxis("Mouse Y") * speed);
/* If not signed on X then make it
* signed for easy clamping. */
if (pitch > 180f)
pitch -= 360f;
pitch = Mathf.Clamp(pitch, -89f, 89f);

PlayerCamera.transform.eulerAngles = new Vector3(pitch, transform.eulerAngles.y, transform.eulerAngles.z);
}

/// <summary>
/// Moves camera.
/// </summary>
private void MoveCamera()
{
PlayerCamera.transform.position = transform.position + _offset;
PlayerCamera.transform.rotation = Quaternion.Euler(PlayerCamera.transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z);
}

}



using FishNet.Object;
using UnityEngine;


namespace FishNet.Example.ColliderRollbacks
{

/// <summary>
/// DEMO. CODE IS NOT OPTIMIZED.
/// Aims the camera.
/// </summary>
public class Aim : NetworkBehaviour
{

public PlayerCamera PlayerCamera { get; private set; }
private readonly Vector3 _offset = new Vector3(0f, 1.65f, 0f);

public override void OnStartClient()
{
if (base.IsOwner)
PlayerCamera = Camera.main.transform.GetComponent<PlayerCamera>();
}

private void Update()
{
if (!base.IsOwner || PlayerCamera == null)
return;

Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
MoveAim();
MoveCamera();
}

/// <summary>
/// Aims camera.
/// </summary>
private void MoveAim()
{
float speed = 2f;
//Yaw.
transform.Rotate(new Vector3(0f, Input.GetAxis("Mouse X") * speed, 0f));
//Pitch.
float pitch = PlayerCamera.transform.eulerAngles.x - (Input.GetAxis("Mouse Y") * speed);
/* If not signed on X then make it
* signed for easy clamping. */
if (pitch > 180f)
pitch -= 360f;
pitch = Mathf.Clamp(pitch, -89f, 89f);

PlayerCamera.transform.eulerAngles = new Vector3(pitch, transform.eulerAngles.y, transform.eulerAngles.z);
}

/// <summary>
/// Moves camera.
/// </summary>
private void MoveCamera()
{
PlayerCamera.transform.position = transform.position + _offset;
PlayerCamera.transform.rotation = Quaternion.Euler(PlayerCamera.transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z);
}

}



}
44 changes: 22 additions & 22 deletions Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Fire.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
using FishNet.Component.ColliderRollback;
using FishNet.Managing.Timing;
using FishNet.Object;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;


namespace FishNet.Example.ColliderRollbacks
{

/// <summary>
/// DEMO. CODE IS NOT OPTIMIZED.
/// Fires at objects.
/// </summary>
public class Fire : NetworkBehaviour
{


}
}

using FishNet.Component.ColliderRollback;
using FishNet.Managing.Timing;
using FishNet.Object;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;


namespace FishNet.Example.ColliderRollbacks
{

/// <summary>
/// DEMO. CODE IS NOT OPTIMIZED.
/// Fires at objects.
/// </summary>
public class Fire : NetworkBehaviour
{


}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using UnityEngine;

namespace FishNet.Example.ColliderRollbacks
{

/// <summary>
/// DEMO. CODE IS NOT OPTIMIZED.
/// Doesn't do much...
/// </summary>
public class PlayerCamera : MonoBehaviour
{
/// <summary>
/// MuzzleFlash on the weapon.
/// </summary>
public Transform MuzzleFlash;

}

using UnityEngine;

namespace FishNet.Example.ColliderRollbacks
{

/// <summary>
/// DEMO. CODE IS NOT OPTIMIZED.
/// Doesn't do much...
/// </summary>
public class PlayerCamera : MonoBehaviour
{
/// <summary>
/// MuzzleFlash on the weapon.
/// </summary>
public Transform MuzzleFlash;

}

}
Loading

0 comments on commit 71950d1

Please sign in to comment.