Sector whitelist (#50)

* Sector whitelist

* Revert everything but the whitelist

* newline
This commit is contained in:
Ricardo Lopes 2020-03-06 22:32:32 +01:00 committed by GitHub
parent 9e0567358d
commit 9a51f77032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
using System.Collections.Generic;
using QSB.Messaging;
using UnityEngine;
using System.Linq;
namespace QSB.TransformSync
{
@ -11,6 +12,23 @@ namespace QSB.TransformSync
private Dictionary<uint, Transform> _playerSectors;
private Sector[] _allSectors;
private MessageHandler<SectorMessage> _sectorHandler;
private readonly Sector.Name[] sectorWhitelist = new Sector.Name[]{
Sector.Name.BrambleDimension,
Sector.Name.BrittleHollow,
Sector.Name.Comet,
Sector.Name.DarkBramble,
Sector.Name.EyeOfTheUniverse,
Sector.Name.GiantsDeep,
Sector.Name.HourglassTwin_A,
Sector.Name.HourglassTwin_B,
Sector.Name.OrbitalProbeCannon,
Sector.Name.QuantumMoon,
Sector.Name.SunStation,
Sector.Name.TimberHearth,
Sector.Name.TimberMoon,
Sector.Name.VolcanicMoon,
Sector.Name.WhiteHole
};
private void Start()
{
@ -92,7 +110,7 @@ namespace QSB.TransformSync
{
private static void PreAddSector(Sector sector, DynamicOccupant ____occupantType)
{
if (sector.GetName() == Sector.Name.Unnamed || sector.GetName() == Sector.Name.Ship || sector.GetName() == Sector.Name.Sun || sector.GetName() == Sector.Name.HourglassTwins)
if (!Instance.sectorWhitelist.Contains(sector.GetName()))
{
return;
}