r2mods/ilspy_dump/ror2_csproj/RoR2.Networking/NetworkExtensions.cs

42 lines
1.0 KiB
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using System;
using UnityEngine.Networking;
namespace RoR2.Networking;
public static class NetworkExtensions
{
public static void Write(this NetworkWriter writer, in NetworkDateTime networkDateTime)
{
NetworkDateTime.Serialize(in networkDateTime, writer);
}
public static NetworkDateTime ReadNetworkDateTime(this NetworkReader reader)
{
NetworkDateTime.Deserialize(out var networkDateTime, reader);
return networkDateTime;
}
public static void WriteNetworkGuid(this NetworkWriter networkWriter, in NetworkGuid guid)
{
guid.Serialize(networkWriter);
}
public static void WriteGuid(this NetworkWriter networkWriter, in Guid guid)
{
NetworkGuid guid2 = (NetworkGuid)guid;
networkWriter.WriteNetworkGuid(in guid2);
}
public static NetworkGuid ReadNetworkGuid(this NetworkReader networkReader)
{
NetworkGuid result = default(NetworkGuid);
result.Deserialize(networkReader);
return result;
}
public static Guid ReadGuid(this NetworkReader networkReader)
{
return (Guid)networkReader.ReadNetworkGuid();
}
}