Add StickGame Assets

This commit is contained in:
Dzejkobik007
2024-03-24 22:21:16 +01:00
parent 5a5812c0c7
commit 6c8b523d1f
6643 changed files with 596260 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
using FishNet.Object;
using FishNet.Serializing;
using FishNet.Transporting;
using UnityEngine;
namespace FishNet.Managing.Utility
{
public class Packets
{
/// <summary>
/// Returns written data length for packet.
/// </summary>
internal static int GetPacketLength(ushort packetId, PooledReader reader, Channel channel)
{
/* Broadcast is a special circumstance where data
* will not be purged even if unreliable.
* This is because a broadcast receiver may not
* be set, which could be intentional. Because of this
* length is always sent to skip
* past the broadcast data.
*
* Reliables also need length read in the instance a client
* sends data to an object which server is despawning. Without
* parsing length the remainer data from client will be corrupt. */
PacketId pid = (PacketId)packetId;
if (channel == Channel.Reliable ||
pid == PacketId.Broadcast ||
pid == PacketId.SyncVar
)
{
return reader.ReadInt32();
}
//Unreliable purges remaining.
else if (channel == Channel.Unreliable)
{
return (int)MissingObjectPacketLength.PurgeRemaiming;
}
/* Unhandled. This shouldn't be possible
* since both reliable and unreliable is checked.
* There are no other options. This is merely here
* for a sanity check. */
else
{
LogError($"Operation is unhandled for packetId {(PacketId)packetId} on channel {channel}.");
return (int)MissingObjectPacketLength.PurgeRemaiming;
}
//Logs an error message.
void LogError(string message)
{
if (reader.NetworkManager != null)
reader.NetworkManager.LogError(message);
else
NetworkManager.StaticLogError(message);
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: facab6859c82ccd49b2d1c6b80404726
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: