public void TestInitialize() { packetReceiver = new DeferringPacketReceiver(visibleCells); loadedCell = new AbsoluteEntityCell(loadedActionPosition, CELL_LEVEL); unloadedCell = new AbsoluteEntityCell(unloadedActionPosition, CELL_LEVEL); visibleCells.Add(loadedCell); }
public void TestInitialize() { packetReceiver = new DeferringPacketReceiver(visibleCells); Int3 loadedBatchId = LargeWorldStreamer.main.GetContainingBatch(loadedActionPosition); Int3 unloadedBatchId = LargeWorldStreamer.main.GetContainingBatch(unloadedActionPosition); loadedCell = new VisibleCell(loadedBatchId, cellId, 3); unloadedCell = new VisibleCell(unloadedBatchId, cellId, 3); visibleCells.Add(loadedCell); }
public void TestInitialize() { packetReceiver = new PacketReceiver(); NitroxModel.Helper.Map.Main = new NitroxModel_Subnautica.Helper.SubnauticaMap(); loadedCell = new AbsoluteEntityCell(loadedActionPosition, CELL_LEVEL); unloadedCell = new AbsoluteEntityCell(unloadedActionPosition, CELL_LEVEL); visibleCells.Add(loadedCell); }
private IEnumerator WaitAndAddCell(Int3 batchId, Int3 cellId, int level) { yield return(new WaitForSeconds(0.5f)); AbsoluteEntityCell cell = new AbsoluteEntityCell(batchId.Model(), cellId.Model(), level); if (!visibleCells.Contains(cell)) { visibleCells.Add(cell); added.Add(cell); } }
public void TestInitialize() { NitroxServiceLocator.InitializeDependencyContainer(new ClientAutoFacRegistrar(), new TestAutoFacRegistrar()); NitroxServiceLocator.BeginNewLifetimeScope(); packetReceiver = NitroxServiceLocator.LocateService <PacketReceiver>(); loadedCell = new AbsoluteEntityCell(loadedActionPosition, CELL_LEVEL); unloadedCell = new AbsoluteEntityCell(unloadedActionPosition, CELL_LEVEL); visibleCells.Add(loadedCell); }
private IEnumerator WaitAndAddCell(Int3 batchId, Int3 cellId, int level) { yield return(new WaitForSeconds(0.5f)); VisibleCell cell = new VisibleCell(batchId, cellId, level); if (!visibleCells.Contains(cell)) { visibleCells.Add(cell); added.Add(cell); packetReceiver.CellLoaded(cell); } }
public override void Unpack(BinaryReader reader) { Id = reader.ReadUInt32(); Bitfield = reader.ReadUInt32(); reader.BaseStream.Position += 4; // Skip ahead 4 bytes, because this is the CellId. Again. Twice. byte numSurfaces = reader.ReadByte(); byte numPortals = reader.ReadByte(); // Note that "portal" in this context does not refer to the swirly pink/purple thing, its basically connecting cells ushort numStabs = reader.ReadUInt16(); // I believe this is what cells can be seen from this one. So the engine knows what else it needs to load/draw. // Read what surfaces are used in this cell for (uint i = 0; i < numSurfaces; i++) { Shadows.Add(0x08000000u | reader.ReadUInt16()); // these are stored in the dat as short values, so we'll make them a full dword } EnvironmentId = (0x0D000000u | reader.ReadUInt16()); CellStructure = reader.ReadUInt16(); Position.Unpack(reader); CellPortals.Unpack(reader, numPortals); for (uint i = 0; i < numStabs; i++) { VisibleCells.Add(reader.ReadUInt16()); } if ((Bitfield & 2) != 0) { StaticObjects.Unpack(reader); } if ((Bitfield & 8) != 0) { RestrictionObj = reader.ReadUInt32(); } }