2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 13:33:13 +00:00
This commit is contained in:
2023-07-01 15:32:23 +03:00
parent 7ce0037e40
commit b6f5a8d9dd
12 changed files with 73 additions and 27 deletions

View File

@ -317,6 +317,11 @@ public static class DataSerializer
var resource = (IResource)value;
var rt = new byte[4];
if (resource.Instance == null || resource.Instance.IsDestroyed)
{
return (TransmissionTypeIdentifier.Null, new byte[0]);
}
if (Codec.IsLocalResource(resource, connection))
{
@ -327,9 +332,13 @@ public static class DataSerializer
}
else
{
//rt.Append((value as IResource).Instance.Template.ClassId, (value as IResource).Instance.Id);
connection.cache.Add(value as IResource, DateTime.UtcNow);
Console.WriteLine("Adding to cache " + resource.Instance.Id);
fixed (byte* ptr = rt)
*((uint*)ptr) = resource.Instance.Id;