first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
using NitroxServer.Serialization;
namespace NitroxServer_Subnautica.Serialization
{
class SubnauticaServerJsonSerializer : ServerJsonSerializer
{
public SubnauticaServerJsonSerializer()
{
}
}
}

View File

@@ -0,0 +1,30 @@
using NitroxModel.DataStructures.Unity;
using NitroxModel_Subnautica.DataStructures.Surrogates;
using NitroxServer.Serialization;
using UnityEngine;
namespace NitroxServer_Subnautica.Serialization
{
class SubnauticaServerProtoBufSerializer : ServerProtoBufSerializer
{
public SubnauticaServerProtoBufSerializer(params string[] assemblies) : base(assemblies)
{
RegisterHardCodedTypes();
}
// Register here all hard coded types, that come from NitroxModel-Subnautica or NitroxServer-Subnautica
private void RegisterHardCodedTypes()
{
Model.Add(typeof(Light), true);
Model.Add(typeof(BoxCollider), true);
Model.Add(typeof(SphereCollider), true);
Model.Add(typeof(MeshCollider), true);
Model.Add(typeof(Vector3), false).SetSurrogate(typeof(Vector3Surrogate));
Model.Add(typeof(NitroxVector3), false).SetSurrogate(typeof(Vector3Surrogate));
Model.Add(typeof(Quaternion), false).SetSurrogate(typeof(QuaternionSurrogate));
Model.Add(typeof(NitroxQuaternion), false).SetSurrogate(typeof(QuaternionSurrogate));
Model.Add(typeof(Transform), false).SetSurrogate(typeof(NitroxTransform));
Model.Add(typeof(GameObject), false).SetSurrogate(typeof(NitroxServer.UnityStubs.GameObject));
}
}
}