From 425e3247d389dac87a20a54e06e065f9b68651da Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 30 Nov 2019 02:27:23 +0100 Subject: [PATCH] Basic layout, create and inject engine --- .gitignore | 3 + .idea/.gitignore | 0 GCDC.sln | 16 ++ GCDC/DiscordEngineInjectionPatch.cs | 34 +++++ GCDC/GCDC.csproj | 226 ++++++++++++++++++++++++++++ GCDC/GCDCPlugin.cs | 40 +++++ GCDC/IllusionPlugin.dll | Bin 0 -> 6656 bytes GCDC/Properties/AssemblyInfo.cs | 35 +++++ GCDC/TextBlockUpdateEngine.cs | 25 +++ 9 files changed, 379 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 GCDC.sln create mode 100644 GCDC/DiscordEngineInjectionPatch.cs create mode 100644 GCDC/GCDC.csproj create mode 100644 GCDC/GCDCPlugin.cs create mode 100644 GCDC/IllusionPlugin.dll create mode 100644 GCDC/Properties/AssemblyInfo.cs create mode 100644 GCDC/TextBlockUpdateEngine.cs 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 0000000000000000000000000000000000000000..aa7fa2e7bde11b7bad935de118a11c36e033c226 GIT binary patch literal 6656 zcmeHLYiu0V6+ZLW^?JS8_>~8Qlp#*(632^QA&&y}W1VChCvm)f@GwngcgO1?vop)g ztQ)5SB|i$JfSR-w0zrQi2{lx-fK)_iOIv{ywH5qme-x=g2(?mCrAqWiA5bFF@7$TS z*Kvr1R3s|(+H>xC-E+>p_uO-5Xa60iNg*N?&&7*G=g@N-5b(<21jNZ}f0CphH@n7$*Ppi02$<@nRLAPzk*YbwuR&C9+wamesR(6U;dey4<=Fs%m2+^pd(24B# z@2Yuwhc;SRIH#0bX(M|w@&rP9$ud^!uFZChGEVOpm zJ;=xa(OF)IOWP5m1bA=VNOaAmvMbRVQLIiL1HHG7PW#3&AGFm10GXI;7&j=JE z*K-S?L~H{e>LJPrHWYK#^mmBY4=>dOUS)fM}?W6zE=FS2T`IrU<>WiRc21 zNP_#xL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JtriCJU>kA(NNy+@<5#->24asQJ6tTwTrk)O`Kl@MmrX{sWhp^B({J literal 0 HcmV?d00001 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