Skip to content

Commit f409568

Browse files
committed
Updated sandbox whitelists
1 parent c8e13eb commit f409568

3 files changed

Lines changed: 13 additions & 65 deletions

File tree

Source/Stationeers.Addons/PluginCompiler/Whitelists/GameWhitelist.cs

Lines changed: 12 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -7,70 +7,19 @@ internal sealed class GameWhitelist : IWhitelistRegistry
77
public void Register(PluginWhitelist whitelist)
88
{
99
whitelist.WhitelistTypes();
10-
whitelist.BlacklistTypes();
11-
whitelist.WhitelistTypesNamespaces(
12-
// ::.*
13-
typeof(Bread),
14-
15-
// Assets.*
16-
typeof(Reagents.Recipe),
17-
typeof(Assets.Features.AtmosphericScattering.Code.AtmosphericScatteringSun),
18-
typeof(Assets.Scripts.Composition),
19-
typeof(Assets.Scripts.AI.BehaviorType),
20-
typeof(Assets.Scripts.Atmospherics.Chemistry),
21-
typeof(Assets.Scripts.Database.DatabaseConnector),
22-
typeof(Assets.Scripts.Database.DatabaseConnector),
23-
typeof(Assets.Scripts.Effects.EffectType),
24-
typeof(Assets.Scripts.Objects.Electrical.Autolathe),
25-
typeof(Assets.Scripts.Objects.Pipes.HydroponicTray),
26-
typeof(Assets.Scripts.Objects.Appliances.Appliance),
27-
typeof(Assets.Scripts.Objects.Chutes.Harvester),
28-
typeof(Assets.Scripts.Objects.Clothing.Clothing),
29-
typeof(Assets.Scripts.Objects.Entities.Animal),
30-
typeof(Assets.Scripts.Objects.Items.Backpack),
31-
typeof(Assets.Scripts.Objects.Motherboards.CameraDisplay),
32-
typeof(Assets.Scripts.Objects.Structures.Airlock),
33-
typeof(Assets.Scripts.Objects.Weapons.Torpedo),
34-
typeof(Assets.Scripts.Objects.SpaceShuttle.LaunchPad),
35-
typeof(Assets.Scripts.Events.Tutorial),
36-
typeof(Assets.Scripts.Inventory.SlotDisplay),
37-
typeof(Assets.Scripts.Leaderboard.LeaderboardManager),
38-
typeof(Assets.Scripts.Networking.ChatMessage),
39-
typeof(Assets.Scripts.Networks.CableNetwork),
40-
typeof(Assets.Scripts.Objects.Attack),
41-
typeof(Assets.Scripts.Ping.PingManager),
42-
typeof(Assets.Scripts.Serialization.XmlSaveLoad), // Is this safe?
43-
typeof(Assets.Scripts.Sound.AudioManager),
44-
typeof(Assets.Scripts.Util.Permutation),
45-
typeof(Assets.Scripts.Vehicles.Vehicle),
46-
typeof(Assets.Scripts.Voxel.Minables),
47-
typeof(Assets.Scripts.Weather.StormDirection),
48-
typeof(Assets.Scripts.AssetCreation.ThingCreation),
49-
typeof(Assets.Scripts.AwayMission.AwayMissionInfo),
50-
typeof(Assets.Scripts.FirstPerson.FirstPersonHelmet),
51-
typeof(Assets.Scripts.GridSystem.Cell),
52-
typeof(Assets.Scripts.PlayerInfo.PlayerDetail),
53-
typeof(Assets.Scripts.SeasonalEvents.SeasonalEvent),
54-
typeof(Assets.Scripts.UI.Digit),
55-
56-
// Objects.*
57-
typeof(Objects.DirtCanister),
58-
typeof(Objects.Electrical.Fridge),
59-
typeof(Objects.Items.Consumable),
60-
typeof(Objects.Pipes.OrganPipe),
61-
typeof(Objects.SpaceShuttle.CouplingUnitDirection),
62-
typeof(Objects.Structures.Frame),
63-
64-
// ImGui
65-
typeof(ImGuiNET.ImGui),
66-
typeof(ImGuiNET.Unity.DearImGui),
67-
68-
// UniTask
69-
typeof(Cysharp.Threading.Tasks.Channel),
70-
typeof(Cysharp.Threading.Tasks.Linq.IAsyncWriter<>),
71-
typeof(Cysharp.Threading.Tasks.Triggers.AsyncAwakeTrigger),
72-
typeof(Cysharp.Threading.Tasks.CompilerServices.AsyncUniTaskMethodBuilder<>)
10+
whitelist.BlacklistTypes(
11+
typeof(Assets.Scripts.Serialization.SaveLoad),
12+
typeof(Assets.Scripts.Serialization.XmlSaveLoad),
13+
typeof(Assets.Scripts.Serialization.ReplaySaveLoad),
14+
typeof(Assets.Scripts.Serialization.XmlSerialization)
15+
);
16+
17+
// Allow all namespaces from the game assembly, but exclude some
18+
whitelist.WhitelistAssembly(typeof(Bread),
19+
typeof(Assets.Scripts.OpenNat.Mapping),
20+
typeof(Open.Nat.Mapping)
7321
);
22+
7423
}
7524
}
7625
}

Source/Stationeers.Addons/PluginCompiler/Whitelists/SystemWhitelist.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public void Register(PluginWhitelist whitelist)
3434
typeof(System.IO.BinaryReader),
3535
typeof(System.IO.BinaryWriter),
3636
typeof(System.IO.StreamReader),
37-
typeof(System.IO.StreamWriter),
3837
typeof(System.IO.StringReader),
3938
typeof(System.IO.StringWriter),
4039
typeof(System.IO.MemoryStream), // Should be safe
@@ -86,7 +85,6 @@ public void Register(PluginWhitelist whitelist)
8685
typeof(System.InvalidOperationException),
8786
typeof(System.NotSupportedException)
8887
);
89-
whitelist.BlacklistTypes(/* none */);
9088

9189
whitelist.WhitelistMembers(
9290
ReflectionUtilities.GetMethodInfo<System.ValueType>("ToString"),

Source/Stationeers.Addons/PluginCompiler/Whitelists/UnityWhitelist.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public void Register(PluginWhitelist whitelist)
2424
typeof(UnityEngine.JsonUtility),
2525
typeof(UnityEngine.Assertions.Assert),
2626
typeof(UnityEngine.EventSystems.BaseInput),
27+
typeof(UnityEngine.Profiling.Profiler),
2728

2829
// TextMeshPro
2930
typeof(TMPro.TextMeshPro)

0 commit comments

Comments
 (0)