Compare commits

...

4 Commits

Author SHA1 Message Date
JesusLuvsYooh
a5a347b47f
Merge 9efd8a9473 into 451c297a43 2024-11-13 03:12:53 +02:00
miwarnec
451c297a43 NTHybrid: fix name and Unity 2019 support
Some checks failed
Main / Run Unity Tests (push) Has been cancelled
Main / Delete Old Workflow Runs (push) Has been cancelled
Main / Semantic Release (push) Has been cancelled
2024-11-11 16:58:42 +01:00
JesusLuvsYooh
1e04c9833b
Updated Server/Client attribute help text. (#3942)
Some checks are pending
Main / Run Unity Tests (push) Waiting to run
Main / Semantic Release (push) Blocked by required conditions
Main / Delete Old Workflow Runs (push) Waiting to run
Hopefully adds additional support in preventing confusion.
2024-11-11 13:06:29 +01:00
JesusLuvsYooh
9efd8a9473 Check if counter is more than. Allows for runtime changing of SIM. 2024-08-08 23:22:39 +01:00
4 changed files with 11 additions and 11 deletions

View File

@ -367,7 +367,7 @@ protected virtual void OnClientToServerDeltaSync(byte baselineTick, Vector3 posi
bufferSizeLimit,
new TransformSnapshot(
timestamp, // arrival remote timestamp. NOT remote time.
Time.timeAsDouble,
NetworkTime.localTime, // Unity 2019 doesn't have Time.timeAsDouble yet
position,
rotation,
scale
@ -711,7 +711,7 @@ protected virtual void OnServerToClientDeltaSync(byte baselineTick, Vector3 posi
bufferSizeLimit,
new TransformSnapshot(
timestamp, // arrival remote timestamp. NOT remote time.
Time.timeAsDouble,
NetworkTime.localTime, // Unity 2019 doesn't have Time.timeAsDouble yet
position,
rotation,
scale

View File

@ -61,7 +61,7 @@ void LateUpdate()
// instead.
if (isServer || (IsClientWithAuthority && NetworkClient.ready))
{
if (sendIntervalCounter == sendIntervalMultiplier && (!onlySyncOnChange || Changed(Construct())))
if (sendIntervalCounter >= sendIntervalMultiplier && (!onlySyncOnChange || Changed(Construct())))
SetDirty();
CheckLastSendTime();
@ -129,7 +129,7 @@ protected virtual void CheckLastSendTime()
// timeAsDouble not available in older Unity versions.
if (AccurateInterval.Elapsed(NetworkTime.localTime, NetworkServer.sendInterval, ref lastSendIntervalTime))
{
if (sendIntervalCounter == sendIntervalMultiplier)
if (sendIntervalCounter >= sendIntervalMultiplier)
sendIntervalCounter = 0;
sendIntervalCounter++;
}

View File

@ -48,28 +48,28 @@ public class TargetRpcAttribute : Attribute
}
/// <summary>
/// Prevents clients from running this method.
/// <para>Prints a warning if a client tries to execute this method.</para>
/// Only an active server will run this method.
/// <para>Prints a warning if a client or in-active server tries to execute this method.</para>
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class ServerAttribute : Attribute {}
/// <summary>
/// Prevents clients from running this method.
/// Only an active server will run this method.
/// <para>No warning is thrown.</para>
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class ServerCallbackAttribute : Attribute {}
/// <summary>
/// Prevents the server from running this method.
/// <para>Prints a warning if the server tries to execute this method.</para>
/// Only an active client will run this method.
/// <para>Prints a warning if the server or in-active client tries to execute this method.</para>
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class ClientAttribute : Attribute {}
/// <summary>
/// Prevents the server from running this method.
/// Only an active client will run this method.
/// <para>No warning is printed.</para>
/// </summary>
[AttributeUsage(AttributeTargets.Method)]