diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs index 0e9dea5..708dd63 100644 --- a/CodeGenerator/Program.cs +++ b/CodeGenerator/Program.cs @@ -11,11 +11,11 @@ namespace CodeGenerator public static void Main(string[] args) { var bcg = new BlockClassGenerator(); - bcg.Generate("Engine", null, new Dictionary + /*bcg.Generate("Engine", null, new Dictionary { - { "engineOn", "On" } + { "engineOn", "On" } - TODO: Internal struct }, typeof(EngineBlockComponent), // Simulation time properties - typeof(EngineBlockTweakableComponent), typeof(EngineBlockReadonlyComponent)); + typeof(EngineBlockTweakableComponent), typeof(EngineBlockReadonlyComponent));*/ bcg.Generate("DampedSpring", "DAMPEDSPRING_BLOCK_GROUP", new Dictionary { {"maxExtent", "MaxExtension"} diff --git a/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs b/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs index ed249bf..d0aa1df 100644 --- a/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs +++ b/TechbloxModdingAPI/App/AntiAntiCheatPatch.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using HarmonyLib; using Svelto.Tasks; +using Techblox.Anticheat.Client; namespace TechbloxModdingAPI.App { @@ -22,6 +23,7 @@ namespace TechbloxModdingAPI.App harmony.Patch(AccessTools.Method(type, "StopProtectedSession"), new HarmonyMethod(((AntiAnticheatDelegateBool) AntiAntiCheat).Method)); harmony.Patch(AccessTools.Method("Techblox.Services.Eos.Anticheat.Client.EosGetPendingMessagesToSendServiceRequest:Execute"), new HarmonyMethod(((AntiAnticheatDelegateTask)AntiAntiCheatTask).Method)); harmony.Patch(AccessTools.Method("Techblox.Anticheat.Client.Engines.ShowFeedbackDialogEngine:PollAnticheatStatus"), new HarmonyMethod(((AntiAnticheatDelegateTask)AntiAntiCheatTask).Method)); + harmony.Patch(AccessTools.Method(typeof(AnticheatClientCompositionRoot), "ClientComposeTimeRunning"), new HarmonyMethod(((Func)AntiAntiCheat).Method)); } private static bool AntiAntiCheat() => false; diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockCloneEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockCloneEngine.cs index a8cd39e..3d64280 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockCloneEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockCloneEngine.cs @@ -48,8 +48,8 @@ namespace TechbloxModdingAPI.Blocks.Engines pickedBlock.pickedBlockEntityID = sourceID; pickedBlock.placedBlockEntityID = targetID; pickedBlock.placedBlockTweaksMustCopy = true; - if (entitiesDB.Exists(pickedBlock.pickedBlockEntityID) - && entitiesDB.Exists(pickedBlock.placedBlockEntityID)) + if (entitiesDB.Exists(pickedBlock.pickedBlockEntityID) + && entitiesDB.Exists(pickedBlock.placedBlockEntityID)) { copyFromBlock.Invoke(Patch.copyEngine, new object[] {pickedBlock.ID, pickedBlock}); diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs index c305f93..8cbf88d 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEngine.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -79,6 +80,10 @@ namespace TechbloxModdingAPI.Blocks.Engines public ref T GetBlockInfo(Block block) where T : unmanaged, IEntityComponent { + #if DEBUG + if (!typeof(BlockTagEntityStruct).IsAssignableFrom(typeof(T)) && block.Exists && block.InitData.Valid) + throw new ArgumentException("The block exists but the init data has not been removed!"); + #endif return ref entitiesDB.QueryEntityOrDefault(block); } @@ -111,7 +116,7 @@ namespace TechbloxModdingAPI.Blocks.Engines : uint.MaxValue; if (prefabAssetID == uint.MaxValue) { - if (entitiesDB.QueryEntityOptional(block)) //The block exists + if (entitiesDB.QueryEntityOptional(block)) //The block exists throw new BlockException("Prefab asset ID not found for block " + block); //Set by the game return; } @@ -136,7 +141,7 @@ namespace TechbloxModdingAPI.Blocks.Engines public bool BlockExists(EGID blockID) { - return entitiesDB.Exists(blockID); + return entitiesDB.Exists(blockID); } public SimBody[] GetSimBodiesFromID(byte id) @@ -202,10 +207,10 @@ namespace TechbloxModdingAPI.Blocks.Engines public EGID? FindBlockEGID(uint id) { - var groups = entitiesDB.FindGroups(); + var groups = entitiesDB.FindGroups(); foreach (ExclusiveGroupStruct group in groups) { - if (entitiesDB.Exists(id, group)) + if (entitiesDB.Exists(id, group)) return new EGID(id, group); } diff --git a/TechbloxModdingAPI/Blocks/Engines/BlockEventsEngine.cs b/TechbloxModdingAPI/Blocks/Engines/BlockEventsEngine.cs index 4da3f65..4b7a514 100644 --- a/TechbloxModdingAPI/Blocks/Engines/BlockEventsEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/BlockEventsEngine.cs @@ -26,18 +26,13 @@ namespace TechbloxModdingAPI.Blocks.Engines public string Name { get; } = "TechbloxModdingAPIBlockEventsEngine"; public bool isRemovable { get; } = false; - private bool shouldAddRemove; public void Add(ref BlockTagEntityStruct entityComponent, EGID egid) { - if (!(shouldAddRemove = !shouldAddRemove)) - return; Placed.Invoke(this, new BlockPlacedRemovedEventArgs {ID = egid}); } public void Remove(ref BlockTagEntityStruct entityComponent, EGID egid) { - if (!(shouldAddRemove = !shouldAddRemove)) - return; Removed.Invoke(this, new BlockPlacedRemovedEventArgs {ID = egid}); } } diff --git a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs index f4ea4c0..8f06ecc 100644 --- a/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs +++ b/TechbloxModdingAPI/Blocks/Engines/PlacementEngine.cs @@ -54,7 +54,6 @@ namespace TechbloxModdingAPI.Blocks.Engines //RobocraftX.CR.MachineEditing.PlaceSingleBlockEngine DBEntityStruct dbEntity = new DBEntityStruct {DBID = block}; - //TODO: Test EntityInitializer structInitializer = _blockEntityFactory.Build(CommonExclusiveGroups.blockIDGeneratorClient.Next(), block); //The ghost block index is only used for triggers uint prefabAssetID = structInitializer.Has() ? structInitializer.Get().prefabAssetID diff --git a/TechbloxModdingAPI/EcsObjectBase.cs b/TechbloxModdingAPI/EcsObjectBase.cs index ba42dc8..13a74f9 100644 --- a/TechbloxModdingAPI/EcsObjectBase.cs +++ b/TechbloxModdingAPI/EcsObjectBase.cs @@ -62,6 +62,13 @@ namespace TechbloxModdingAPI var id = initializer(this); if (!dict.ContainsKey(id)) // Multiple instances may be created dict.Add(id, this); + else + { + Logging.MetaDebugLog($"An object of this type and ID is already stored: {GetType()} - {id}"); + Logging.MetaDebugLog(this); + Logging.MetaDebugLog(dict[id]); + } + Id = id; } diff --git a/TechbloxModdingAPI/Engines/IReactionaryEngine.cs b/TechbloxModdingAPI/Engines/IReactionaryEngine.cs index d627866..739d626 100644 --- a/TechbloxModdingAPI/Engines/IReactionaryEngine.cs +++ b/TechbloxModdingAPI/Engines/IReactionaryEngine.cs @@ -14,7 +14,7 @@ namespace TechbloxModdingAPI.Engines /// /// Engine interface to handle ModEventEntityStruct events emitted by IEventEmitterEngines. /// - public interface IReactionaryEngine : IApiEngine, IReactOnAddAndRemove, IReactOnAddAndRemove where T : unmanaged, IEntityComponent + public interface IReactionaryEngine : IApiEngine, IReactOnAddAndRemove where T : unmanaged, IEntityComponent { } } diff --git a/TechbloxModdingAPI/Input/FakeInputPatch.cs b/TechbloxModdingAPI/Input/FakeInputPatch.cs index f1a3281..7168e05 100644 --- a/TechbloxModdingAPI/Input/FakeInputPatch.cs +++ b/TechbloxModdingAPI/Input/FakeInputPatch.cs @@ -13,7 +13,7 @@ namespace TechbloxModdingAPI.Input public static MethodBase TargetMethod() { - return AccessTools.Method("RobocraftX.Multiplayer.Input.NetworkInputRecorderEngine:RecordDeterministicInput"); + return AccessTools.Method("RobocraftX.Multiplayer.Input.DeterministicInputRecorderEngine:RecordDeterministicInput"); } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs b/TechbloxModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs index b3ae6de..b9139a6 100644 --- a/TechbloxModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs +++ b/TechbloxModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs @@ -7,7 +7,7 @@ using HarmonyLib; namespace TechbloxModdingAPI.Persistence { - [HarmonyPatch(typeof(SaveAndLoadCompositionRoot), "Compose")] + [HarmonyPatch(typeof(SaveAndLoadCompositionRoot), "ServerCompose")] class SaveAndLoadCompositionRootPatch { public static EnginesRoot currentEnginesRoot; diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index 63d13e0..e50a29f 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -71,7 +71,7 @@ namespace TechbloxModdingAPI get { if (localPlayer == null || localPlayer.Id != playerEngine.GetLocalPlayer()) - localPlayer = new Player(PlayerType.Local); + localPlayer = GetInstance(playerEngine.GetLocalPlayer()); return localPlayer; } } @@ -363,6 +363,15 @@ namespace TechbloxModdingAPI public PlayerBuildingMode BuildingMode => (PlayerBuildingMode)Math.Log((double)playerEngine .GetCharacterStruct(Id).Get().timeStoppedContext, 2); // It's a bit field in game now + public PlayerState State => + playerEngine.GetCharacterStruct(Id).Get().ID.groupID switch + { + var group when group == CharacterExclusiveGroups.MachineSpawningGroup => PlayerState.HoldingMachine, + var group when group == CharacterExclusiveGroups.OnFootGroup => PlayerState.OnFoot, + var group when group == CharacterExclusiveGroups.InPilotSeatGroup => PlayerState.InSeat, + _ => throw new ArgumentOutOfRangeException("", "Unknown player state") + }; + /// /// Whether the player is sprinting. /// diff --git a/TechbloxModdingAPI/Players/PlayerEngine.cs b/TechbloxModdingAPI/Players/PlayerEngine.cs index bf9c548..b6e38b1 100644 --- a/TechbloxModdingAPI/Players/PlayerEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEngine.cs @@ -9,16 +9,14 @@ using RobocraftX.CR.MachineEditing.BoxSelect; using RobocraftX.Physics; using RobocraftX.Blocks.Ghost; using Gamecraft.GUI.HUDFeedbackBlocks; -using RobocraftX.Blocks; using RobocraftX.Multiplayer; -using RobocraftX.PilotSeat; using RobocraftX.SimulationModeState; using Svelto.ECS; using Techblox.Camera; using Unity.Mathematics; using Svelto.ECS.DataStructures; -using Svelto.ECS.EntityStructs; using Techblox.BuildingDrone; +using Techblox.Character; using TechbloxModdingAPI.Engines; using TechbloxModdingAPI.Input; @@ -209,9 +207,9 @@ namespace TechbloxModdingAPI.Players { if (!TimeRunningModeUtil.IsTimeRunningMode(entitiesDB)) return; - PilotSeatGroupUtils.SwapTagTo(Functions, seatId); + /*PilotSeatGroupUtils.SwapTagTo(Functions, seatId); var opt = GetCharacterStruct(playerId, out var group); - if (!opt) return; + if (!opt) return; - TODO: This is server code and mods run in client code atm. We can only send inputs even in singleplayer as it is. ref CharacterPilotSeatEntityStruct charSeat = ref opt.Get(); var charId = new EGID(playerId, group); charSeat.pilotSeatEntity = entitiesDB.GetEntityReference(seatId); @@ -221,7 +219,7 @@ namespace TechbloxModdingAPI.Players ref var seat = ref entitiesDB.QueryEntity(seatId); seat.occupyingCharacter = entitiesDB.GetEntityReference(charId); charSeat.followCam = entitiesDB.QueryEntity(seatId).followCam; - Functions.SwapEntityGroup(charId, CharacterExclusiveGroups.InPilotSeatGroup); + Functions.SwapEntityGroup(charId, CharacterExclusiveGroups.InPilotSeatGroup);*/ } public void ExitSeat(uint playerId) @@ -242,6 +240,11 @@ namespace TechbloxModdingAPI.Players EGID egid = new EGID(playerId, CharacterExclusiveGroups.MachineSpawningGroup); if (!entitiesDB.Exists(egid)) return false; + if (entitiesDB.QueryEntity(egid).isMachinePlacementInvalid) + { + Logging.MetaDebugLog("Machine placement invalid"); + return false; + } //Functions.SwapEntityGroup(egid, CharacterExclusiveGroups.OnFootGroup); FakeInput.ActionInput(playerId, primary: true); return true; diff --git a/TechbloxModdingAPI/Players/PlayerEventsEngine.cs b/TechbloxModdingAPI/Players/PlayerEventsEngine.cs index 4461b71..cf90c40 100644 --- a/TechbloxModdingAPI/Players/PlayerEventsEngine.cs +++ b/TechbloxModdingAPI/Players/PlayerEventsEngine.cs @@ -1,3 +1,4 @@ +using System; using RobocraftX.Character; using RobocraftX.Character.Movement; using RobocraftX.Common.Input; diff --git a/TechbloxModdingAPI/Players/PlayerState.cs b/TechbloxModdingAPI/Players/PlayerState.cs new file mode 100644 index 0000000..6ec6cbd --- /dev/null +++ b/TechbloxModdingAPI/Players/PlayerState.cs @@ -0,0 +1,9 @@ +namespace TechbloxModdingAPI.Players +{ + public enum PlayerState + { + HoldingMachine, + OnFoot, + InSeat + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Players/PlayerTests.cs b/TechbloxModdingAPI/Players/PlayerTests.cs index 1fc4f49..9f3de75 100644 --- a/TechbloxModdingAPI/Players/PlayerTests.cs +++ b/TechbloxModdingAPI/Players/PlayerTests.cs @@ -29,7 +29,7 @@ namespace TechbloxModdingAPI.Players [APITestCase(TestType.EditMode)] public static void PositionTest() { - Player p = new Player(PlayerType.Local); + Player p = Player.LocalPlayer; if (!Assert.Errorless(() => { p.Teleport(0, 0, 0, relative: false); }, "Player.Teleport(origin) errored: ", "Player teleported to origin successfully.")) return; if (!Assert.CloseTo(p.Position, float3.zero, "Player is not close to origin despite being teleported there.", "Player.Position is at origin.")) return; if (!Assert.Errorless(() => { p.Position = float3.zero + 1; }, "Player.Position = origin+1 errored: ", "Player moved to origin+1.")) return; @@ -41,7 +41,7 @@ namespace TechbloxModdingAPI.Players { Player.LocalPlayer.SeatEntered += Assert.CallsBack("SeatEntered"); Player.LocalPlayer.SeatExited += Assert.CallsBack("SeatExited"); - Block.PlaceNew(BlockIDs.DriverSeat, -1f); + Block.PlaceNew(BlockIDs.DriverSeat, Player.LocalPlayer.Position); } [APITestCase(TestType.SimulationMode)] @@ -68,11 +68,21 @@ namespace TechbloxModdingAPI.Players } if (seats[0] is Seat seat) + { //TODO: Actually, the problem is likely that the player ID is different in build and sim Assert.Errorless(() => Player.LocalPlayer.EnterSeat(seat), "Failed to enter seat.", "Entered seat successfully."); + while (Player.LocalPlayer.State != PlayerState.InSeat) + { + bool cont = false; + Client.Instance.PromptUser(new SingleChoicePrompt("Testing", $"Enter the seat at {seat.Position} pls", "OK", () => cont = true)); + while (!cont) + yield return Yield.It; + yield return new WaitForSecondsEnumerator(5f).Continue(); + } + } else Assert.Fail("Found a seat that is not a seat!"); - yield return new WaitForSecondsEnumerator(1).Continue(); + yield return new WaitForSecondsEnumerator(5).Continue(); Assert.Errorless(() => Player.LocalPlayer.ExitSeat(), "Failed to exit seat.", "Exited seat successfully."); } diff --git a/TechbloxModdingAPI/TechbloxModdingAPI.csproj b/TechbloxModdingAPI/TechbloxModdingAPI.csproj index 6fe520b..c26813f 100644 --- a/TechbloxModdingAPI/TechbloxModdingAPI.csproj +++ b/TechbloxModdingAPI/TechbloxModdingAPI.csproj @@ -48,6 +48,14 @@ ..\ref\Techblox_Data\Managed\Assembly-CSharp.dll ..\..\ref\Techblox_Data\Managed\Assembly-CSharp.dll + + ..\ref\Techblox_Data\Managed\AWSSDK.Core.dll + ..\..\ref\Techblox_Data\Managed\AWSSDK.Core.dll + + + ..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll + ..\..\ref\Techblox_Data\Managed\AWSSDK.GameLift.dll + ..\ref\Techblox_Data\Managed\BevelEffect.dll ..\..\ref\Techblox_Data\Managed\BevelEffect.dll @@ -88,6 +96,10 @@ ..\ref\Techblox_Data\Managed\FMODUnityResonance.dll ..\..\ref\Techblox_Data\Managed\FMODUnityResonance.dll + + ..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll + ..\..\ref\Techblox_Data\Managed\FMODUnityWrapperClient.dll + ..\ref\Techblox_Data\Managed\FullGame.dll ..\..\ref\Techblox_Data\Managed\FullGame.dll @@ -312,6 +324,10 @@ ..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll ..\..\ref\Techblox_Data\Managed\Gamecraft.Wires.Mockup.dll + + ..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + ..\..\ref\Techblox_Data\Managed\GameLiftServerSDKNet45.dll + ..\ref\Techblox_Data\Managed\GameState.dll ..\..\ref\Techblox_Data\Managed\GameState.dll @@ -320,6 +336,10 @@ ..\ref\Techblox_Data\Managed\GhostShark.Outline.dll ..\..\ref\Techblox_Data\Managed\GhostShark.Outline.dll + + ..\ref\Techblox_Data\Managed\Google.Protobuf.dll + ..\..\ref\Techblox_Data\Managed\Google.Protobuf.dll + ..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll ..\..\ref\Techblox_Data\Managed\GPUInstancer.CrowdAnimations.dll @@ -340,10 +360,22 @@ ..\ref\Techblox_Data\Managed\JWT.dll ..\..\ref\Techblox_Data\Managed\JWT.dll + + ..\ref\Techblox_Data\Managed\LiteNetLib.dll + ..\..\ref\Techblox_Data\Managed\LiteNetLib.dll + + + ..\ref\Techblox_Data\Managed\log4net.dll + ..\..\ref\Techblox_Data\Managed\log4net.dll + ..\ref\Techblox_Data\Managed\LZ4.dll ..\..\ref\Techblox_Data\Managed\LZ4.dll + + ..\ref\Techblox_Data\Managed\Monobehaviours.dll + ..\..\ref\Techblox_Data\Managed\Monobehaviours.dll + ..\ref\Techblox_Data\Managed\mscorlib.dll ..\..\ref\Techblox_Data\Managed\mscorlib.dll @@ -376,6 +408,10 @@ ..\ref\Techblox_Data\Managed\Rewired_Windows.dll ..\..\ref\Techblox_Data\Managed\Rewired_Windows.dll + + ..\ref\Techblox_Data\Managed\RichFX.dll + ..\..\ref\Techblox_Data\Managed\RichFX.dll + ..\ref\Techblox_Data\Managed\RobocraftECS.dll ..\..\ref\Techblox_Data\Managed\RobocraftECS.dll @@ -404,6 +440,10 @@ ..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Building.Jobs.dll + + ..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.Audio.dll + ..\ref\Techblox_Data\Managed\RobocraftX.Character.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.Character.dll @@ -480,6 +520,10 @@ ..\ref\Techblox_Data\Managed\RobocraftX.MainGameMock.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.MainGameMock.dll + + ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.Audio.dll + ..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll ..\..\ref\Techblox_Data\Managed\RobocraftX.MainSimulation.dll @@ -564,6 +608,10 @@ ..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll ..\..\ref\Techblox_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + + ..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + ..\..\ref\Techblox_Data\Managed\ShaderVariantsGenerationTool.dll + ..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll ..\..\ref\Techblox_Data\Managed\SpecializedDescriptors.dll @@ -592,6 +640,22 @@ ..\ref\Techblox_Data\Managed\Svelto.Tasks.dll ..\..\ref\Techblox_Data\Managed\Svelto.Tasks.dll + + ..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll + ..\..\ref\Techblox_Data\Managed\Techblox.AdditionalParts.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Common.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Anticheat.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Anticheat.Server.dll + ..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.AtmosphereBlock.dll @@ -604,6 +668,18 @@ ..\ref\Techblox_Data\Managed\Techblox.Backend.dll ..\..\ref\Techblox_Data\Managed\Techblox.Backend.dll + + ..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BitBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BlockColours.dll + + + ..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll + ..\..\ref\Techblox_Data\Managed\Techblox.BlockLabels.dll + ..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.Blocks.LightBlock.dll @@ -620,10 +696,18 @@ ..\ref\Techblox_Data\Managed\Techblox.Camera.dll ..\..\ref\Techblox_Data\Managed\Techblox.Camera.dll + + ..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Common.Audio.dll + ..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll ..\..\ref\Techblox_Data\Managed\Techblox.ContextSensitiveTextHint.dll + + ..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + ..\..\ref\Techblox_Data\Managed\Techblox.ECSResourceManagers.dll + ..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.EngineBlock.dll @@ -660,6 +744,14 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Commands.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Controls.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.dll @@ -692,6 +784,10 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Inventory.Materials.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.LoadingBar.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Login.dll @@ -712,6 +808,10 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.ScreenCanvas.dll + ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Landscapes.dll @@ -720,10 +820,38 @@ ..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll ..\..\ref\Techblox_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + + ..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.UsernameDisplay.dll + + + ..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll + ..\..\ref\Techblox_Data\Managed\Techblox.GUI.WorldCanvas.dll + ..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll ..\..\ref\Techblox_Data\Managed\Techblox.InputCapture.dll + + ..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineSimulationPreprocessing.dll + + + ..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll + ..\..\ref\Techblox_Data\Managed\Techblox.MachineSpawning.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Matchmaking.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Multiplayer.UsernameMessages.dll + + + ..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll + ..\..\ref\Techblox_Data\Managed\Techblox.PlayUX.dll + ..\ref\Techblox_Data\Managed\Techblox.Pointer.dll ..\..\ref\Techblox_Data\Managed\Techblox.Pointer.dll @@ -756,22 +884,66 @@ ..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll ..\..\ref\Techblox_Data\Managed\Techblox.SaveGamesConversion.dll + + ..\ref\Techblox_Data\Managed\Techblox.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Client.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Anticheat.Server.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Common.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.dll + + ..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Server.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Eos.Server.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.GameDetails.dll + + ..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.LocalPreferences.dll + + + ..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + ..\..\ref\Techblox_Data\Managed\Techblox.Services.Matchmaking.dll + ..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll ..\..\ref\Techblox_Data\Managed\Techblox.Services.Storage.dll + + ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Audio.dll + + + ..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + ..\..\ref\Techblox_Data\Managed\Techblox.SignalHandling.Common.dll + ..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll ..\..\ref\Techblox_Data\Managed\Techblox.SwitchAnimation.dll + + ..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TextBlock.dll + + + ..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll + ..\..\ref\Techblox_Data\Managed\Techblox.TimerBlock.dll + ..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll ..\..\ref\Techblox_Data\Managed\Techblox.WheelRigBlock.dll @@ -1228,6 +1400,10 @@ ..\ref\Techblox_Data\Managed\VisualProfiler.dll ..\..\ref\Techblox_Data\Managed\VisualProfiler.dll + + ..\ref\Techblox_Data\Managed\websocket-sharp.dll + ..\..\ref\Techblox_Data\Managed\websocket-sharp.dll + ..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll ..\..\ref\Techblox_Data\Managed\Whinarn.UnityMeshSimplifier.Runtime.dll diff --git a/TechbloxModdingAPI/Tests/TestRoot.cs b/TechbloxModdingAPI/Tests/TestRoot.cs index bffae51..648d029 100644 --- a/TechbloxModdingAPI/Tests/TestRoot.cs +++ b/TechbloxModdingAPI/Tests/TestRoot.cs @@ -200,7 +200,8 @@ namespace TechbloxModdingAPI.Tests cont = false; } - yield return Yield.It; + if (cont) + yield return enumerator.Current; } while (cont); } diff --git a/TechbloxModdingAPI/Utility/FullGameFields.cs b/TechbloxModdingAPI/Utility/FullGameFields.cs index de9f487..f9eb6d1 100644 --- a/TechbloxModdingAPI/Utility/FullGameFields.cs +++ b/TechbloxModdingAPI/Utility/FullGameFields.cs @@ -122,11 +122,11 @@ namespace TechbloxModdingAPI.Utility } } - public static ECSResourceManagers _managers + public static ECSMainGameResourceManagers _managers { get { - return (ECSResourceManagers)fgcr?.Field("_managers").GetValue(); + return (ECSMainGameResourceManagers)fgcr?.Field("_gameManagers").GetValue(); } } diff --git a/TechbloxModdingAPI/Utility/WeakDictionary.cs b/TechbloxModdingAPI/Utility/WeakDictionary.cs index 287b044..35e55a5 100644 --- a/TechbloxModdingAPI/Utility/WeakDictionary.cs +++ b/TechbloxModdingAPI/Utility/WeakDictionary.cs @@ -54,7 +54,7 @@ namespace TechbloxModdingAPI.Utility public bool ContainsKey(TKey key) { - return _dictionary.ContainsKey(key); + return TryGetValue(key, out _); } public void Add(TKey key, TValue value) @@ -70,7 +70,9 @@ namespace TechbloxModdingAPI.Utility public bool TryGetValue(TKey key, out TValue value) { value = null; - return _dictionary.TryGetValue(key, out var reference) && reference.TryGetTarget(out value); + bool ret = _dictionary.TryGetValue(key, out var reference) && reference.TryGetTarget(out value); + if (!ret) _dictionary.Remove(key); + return ret; } public TValue this[TKey key]