commit 425e3247d389dac87a20a54e06e065f9b68651da Author: NorbiPeti Date: Sat Nov 30 02:27:23 2019 +0100 Basic layout, create and inject engine diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b230ab5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +bin/ +obj/ +/packages/ \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/GCDC.sln b/GCDC.sln new file mode 100644 index 0000000..efbc04a --- /dev/null +++ b/GCDC.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GCDC", "GCDC\GCDC.csproj", "{65169A16-0FFD-4769-ACAB-4C15A4C74C3D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {65169A16-0FFD-4769-ACAB-4C15A4C74C3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65169A16-0FFD-4769-ACAB-4C15A4C74C3D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65169A16-0FFD-4769-ACAB-4C15A4C74C3D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65169A16-0FFD-4769-ACAB-4C15A4C74C3D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/GCDC/DiscordEngineInjectionPatch.cs b/GCDC/DiscordEngineInjectionPatch.cs new file mode 100644 index 0000000..1af4a60 --- /dev/null +++ b/GCDC/DiscordEngineInjectionPatch.cs @@ -0,0 +1,34 @@ +using System; +using System.Reflection; +using Harmony; +using RobocraftX; +using RobocraftX.GUI.CommandLine; +using RobocraftX.Multiplayer; +using Svelto.Context; +using Svelto.ECS; +using Unity.Entities; +using UnityEngine; + +namespace GCDC +{ + [HarmonyPatch] + public class DiscordEngineInjectionPatch + { + static void Postfix(UnityContext contextHolder, EnginesRoot enginesRoot, World physicsWorld, Action reloadGame, MultiplayerInitParameters multiplayerParameters) + { + enginesRoot.AddEngine(new TextBlockUpdateEngine()); + Debug.Log($"Added text block update engine"); + } + + static MethodBase TargetMethod(HarmonyInstance instance) + { + return _ComposeMethodInfo(CommandLineCompositionRoot.Compose>); + } + + private static MethodInfo _ComposeMethodInfo(Action, EnginesRoot, World, Action, MultiplayerInitParameters> a) + { + return a.Method; + } + + } +} \ No newline at end of file diff --git a/GCDC/GCDC.csproj b/GCDC/GCDC.csproj new file mode 100644 index 0000000..5a4785a --- /dev/null +++ b/GCDC/GCDC.csproj @@ -0,0 +1,226 @@ + + + + + Debug + AnyCPU + {65169A16-0FFD-4769-ACAB-4C15A4C74C3D} + Library + Properties + GCDC + GCDC + v4.7.2 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ref\CommandLine.dll + + + ref\FullGame.dll + + + ref\Gamecraft.Blocks.ConsoleBlock.dll + + + IllusionPlugin.dll + + + ref\Robocraft.MainGame.AutoEnterSimulation.dll + + + ref\RobocraftX.AccountPreferences.dll + + + ref\RobocraftX.Blocks.dll + + + ref\RobocraftX.Blocks.Ghost.dll + + + ref\RobocraftX.Blocks.Triggers.dll + + + ref\RobocraftX.Character.dll + + + ref\RobocraftX.Common.dll + + + ref\RobocraftX.Crosshair.dll + + + ref\RobocraftX.EntityStreamUtility.dll + + + ref\RobocraftX.FrontEnd.dll + + + ref\RobocraftX.GameSignalHandling.dll + + + ref\RobocraftX.GUI.dll + + + ref\RobocraftX.GUI.DebugDisplay.dll + + + ref\RobocraftX.GUI.RemoveBlock.dll + + + ref\RobocraftX.GUI.ScaleGhost.dll + + + ref\RobocraftX.GUI.SignalLabel.dll + + + ref\RobocraftX.GUIs.WorkshopPrefabs.dll + + + ref\RobocraftX.Input.dll + + + ref\RobocraftX.Inventory.dll + + + ref\RobocraftX.MachineEditor.dll + + + ref\RobocraftX.MainGame.dll + + + ref\RobocraftX.MainSimulation.dll + + + ref\RobocraftX.Multiplayer.dll + + + ref\RobocraftX.Multiplayer.NetworkEntityStream.dll + + + ref\RobocraftX.MultiplayerInput.dll + + + ref\RobocraftX.Party.dll + + + ref\RobocraftX.PartyGui.dll + + + ref\RobocraftX.Physics.dll + + + ref\RobocraftX.PilotSeat.dll + + + ref\RobocraftX.Player.dll + + + ref\RobocraftX.Priority.dll + + + ref\RobocraftX.Rendering.dll + + + ref\RobocraftX.Rendering.Mock.dll + + + ref\RobocraftX.SaveAndLoad.dll + + + ref\RobocraftX.SaveGameDialog.dll + + + ref\RobocraftX.Serializers.dll + + + ref\RobocraftX.Services.dll + + + ref\RobocraftX.SignalHandling.dll + + + ref\RobocraftX.StateSync.dll + + + ref\RobocraftX_SpawnPoints.dll + + + ref\RobocraftX_TextBlock.dll + + + ref\RobocratX.SimulationCompositionRoot.dll + + + ref\Svelto.Common.dll + + + ref\Svelto.ECS.dll + + + ref\Svelto.Services.dll + + + ref\Svelto.Tasks.dll + + + + + + + ref\Unity.Entities.dll + + + ref\Unity.Physics.dll + + + ref\UnityEngine.dll + + + ref\UnityEngine.CoreModule.dll + + + ref\uREPL.dll + + + + + + + + + + + + + + + + + + diff --git a/GCDC/GCDCPlugin.cs b/GCDC/GCDCPlugin.cs new file mode 100644 index 0000000..3697ebe --- /dev/null +++ b/GCDC/GCDCPlugin.cs @@ -0,0 +1,40 @@ +using IllusionPlugin; + +namespace GCDC +{ + public class GCDCPlugin : IPlugin + { + public string Name { get; } = "GCDC"; + public string Version { get; } = "v0.0.1"; + + public void OnApplicationStart() + { + throw new System.NotImplementedException(); + } + + public void OnApplicationQuit() + { + throw new System.NotImplementedException(); + } + + public void OnLevelWasLoaded(int level) + { + throw new System.NotImplementedException(); + } + + public void OnLevelWasInitialized(int level) + { + throw new System.NotImplementedException(); + } + + public void OnUpdate() + { + throw new System.NotImplementedException(); + } + + public void OnFixedUpdate() + { + throw new System.NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/GCDC/IllusionPlugin.dll b/GCDC/IllusionPlugin.dll new file mode 100644 index 0000000..aa7fa2e Binary files /dev/null and b/GCDC/IllusionPlugin.dll differ diff --git a/GCDC/Properties/AssemblyInfo.cs b/GCDC/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8f195b9 --- /dev/null +++ b/GCDC/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("GCDC")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("GCDC")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("65169A16-0FFD-4769-ACAB-4C15A4C74C3D")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/GCDC/TextBlockUpdateEngine.cs b/GCDC/TextBlockUpdateEngine.cs new file mode 100644 index 0000000..ac1bb0b --- /dev/null +++ b/GCDC/TextBlockUpdateEngine.cs @@ -0,0 +1,25 @@ +using RobocraftX.Common.Input; +using RobocraftX.Common.Utilities; +using RobocraftX.StateSync; +using Svelto.ECS; +using Unity.Jobs; +using uREPL; + +namespace GCDC +{ + public class TextBlockUpdateEngine : IQueryingEntitiesEngine, IEngine, IDeterministicSim + { + public void Ready() + { + } + + public IEntitiesDB entitiesDB { get; set; } + public JobHandle SimulatePhysicsStep(in float deltaTime, in PhysicsUtility utility, in PlayerInput[] playerInputs) + { + //TODO + return new JobHandle(); + } + + public string name { get; } = "GCDC-TextUpdate"; + } +} \ No newline at end of file