diff --git a/Content.Client/ClientContentIoC.cs b/Content.Client/ClientContentIoC.cs new file mode 100644 index 0000000..69e3fee --- /dev/null +++ b/Content.Client/ClientContentIoC.cs @@ -0,0 +1,12 @@ +using Robust.Shared.IoC; + +namespace Content.Client +{ + internal static class ClientContentIoC + { + public static void Register() + { + // DEVNOTE: IoCManager registrations for the client go here and only here. + } + } +} \ No newline at end of file diff --git a/Content.Client/EntryPoint.cs b/Content.Client/EntryPoint.cs new file mode 100644 index 0000000..ff90a81 --- /dev/null +++ b/Content.Client/EntryPoint.cs @@ -0,0 +1,55 @@ +using Robust.Shared.ContentPack; +using Robust.Shared.Interfaces.Configuration; +using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.Interfaces.Map; +using Robust.Shared.IoC; +using Robust.Shared.Map; +using Robust.Shared.Prototypes; +using Robust.Shared.Timing; + +namespace Content.Client +{ + public class EntryPoint: GameClient + { + public override void Init() + { + var factory = IoCManager.Resolve(); + var prototypes = IoCManager.Resolve(); + + factory.DoAutoRegistrations(); + + foreach (var ignoreName in IgnoredComponents.List) + { + factory.RegisterIgnore(ignoreName); + } + + foreach (var ignoreName in IgnoredPrototypes.List) + { + prototypes.RegisterIgnore(ignoreName); + } + + ClientContentIoC.Register(); + + IoCManager.BuildGraph(); + + // DEVNOTE: This is generally where you'll be setting up the IoCManager further. + + IoCManager.InjectDependencies(this); + } + + public override void PostInit() + { + base.PostInit(); + + // DEVNOTE: Further setup, this is the spot you should start trying to connect to the server from. + } + + public override void Update(ModUpdateLevel level, FrameEventArgs frameEventArgs) + { + base.Update(level, frameEventArgs); + // DEVNOTE: Game update loop goes here. Usually you'll want some independent GameTicker. + } + } + + +} \ No newline at end of file diff --git a/Content.Client/IgnoredComponents.cs b/Content.Client/IgnoredComponents.cs new file mode 100644 index 0000000..10604cd --- /dev/null +++ b/Content.Client/IgnoredComponents.cs @@ -0,0 +1,9 @@ +namespace Content.Client +{ + public static class IgnoredComponents + { + public static string[] List => new string[] { + // Stick components you want ignored here. + }; + } +} \ No newline at end of file diff --git a/Content.Client/IgnoredPrototypes.cs b/Content.Client/IgnoredPrototypes.cs new file mode 100644 index 0000000..b97fb7d --- /dev/null +++ b/Content.Client/IgnoredPrototypes.cs @@ -0,0 +1,9 @@ +namespace Content.Client +{ + public static class IgnoredPrototypes + { + public static string[] List => new string[] { + // Stick prototypes you want ignored here. + }; + } +} \ No newline at end of file diff --git a/Content.Client/Program.cs b/Content.Client/Program.cs index 26f9c0f..6074217 100644 --- a/Content.Client/Program.cs +++ b/Content.Client/Program.cs @@ -4,9 +4,6 @@ namespace Content.Client { internal static class Program { - public static void Main(string[] args) - { - ContentStart.Start(args); - } + public static void Main(string[] args) => ContentStart.Start(args); } } \ No newline at end of file diff --git a/Content.Client/app.config b/Content.Client/app.config new file mode 100644 index 0000000..e1d9d49 --- /dev/null +++ b/Content.Client/app.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Content.Server/EntryPoint.cs b/Content.Server/EntryPoint.cs new file mode 100644 index 0000000..6a1cd13 --- /dev/null +++ b/Content.Server/EntryPoint.cs @@ -0,0 +1,41 @@ +using Robust.Shared.ContentPack; +using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.IoC; +using Robust.Shared.Timing; + +namespace Content.Server +{ + public class EntryPoint: GameServer + { + public override void Init() { + base.Init(); + + var factory = IoCManager.Resolve(); + + factory.DoAutoRegistrations(); + + foreach (var ignoreName in IgnoredComponents.List) + { + factory.RegisterIgnore(ignoreName); + } + + ServerContentIoC.Register(); + + IoCManager.BuildGraph(); + + // DEVNOTE: This is generally where you'll be setting up the IoCManager further. + } + + public override void PostInit() + { + base.PostInit(); + // DEVNOTE: Can also initialize IoC stuff more here. + } + + public override void Update(ModUpdateLevel level, FrameEventArgs frameEventArgs) + { + base.Update(level, frameEventArgs); + // DEVNOTE: Game update loop goes here. Usually you'll want some independent GameTicker. + } + } +} \ No newline at end of file diff --git a/Content.Server/IgnoredComponents.cs b/Content.Server/IgnoredComponents.cs new file mode 100644 index 0000000..494b458 --- /dev/null +++ b/Content.Server/IgnoredComponents.cs @@ -0,0 +1,9 @@ +namespace Content.Server +{ + public static class IgnoredComponents + { + public static string[] List => new string[] { + // Stick components you want ignored here. + }; + } +} \ No newline at end of file diff --git a/Content.Server/Program.cs b/Content.Server/Program.cs index 6d0e9e2..b46cefc 100644 --- a/Content.Server/Program.cs +++ b/Content.Server/Program.cs @@ -4,9 +4,6 @@ namespace Content.Server { internal static class Program { - public static void Main(string[] args) - { - ContentStart.Start(args); - } + public static void Main(string[] args) => ContentStart.Start(args); } } \ No newline at end of file diff --git a/Content.Server/ServerContentIoC.cs b/Content.Server/ServerContentIoC.cs new file mode 100644 index 0000000..62fe807 --- /dev/null +++ b/Content.Server/ServerContentIoC.cs @@ -0,0 +1,12 @@ +using Robust.Shared.IoC; + +namespace Content.Server +{ + internal static class ServerContentIoC + { + public static void Register() + { + // DEVNOTE: IoCManager registrations for the server go here and only here. + } + } +} \ No newline at end of file diff --git a/Content.Server/app.config b/Content.Server/app.config new file mode 100644 index 0000000..e1d9d49 --- /dev/null +++ b/Content.Server/app.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Content.Shared/EntryPoint.cs b/Content.Shared/EntryPoint.cs new file mode 100644 index 0000000..b4f1cc0 --- /dev/null +++ b/Content.Shared/EntryPoint.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using Robust.Shared.ContentPack; +using Robust.Shared.IoC; +using Robust.Shared.Localization; +using Robust.Shared.Localization.Macros; +using Robust.Shared.Prototypes; + +namespace Content.Shared +{ + public class EntryPoint: GameShared + { + // See line 25. Controls the default game culture and language. + // Robust calls this culture, but you might find it more fitting to call it the game + // language. Robust doesn't support changing this mid-game. Load your config file early + // if you want that. + private const string Culture = "en-US"; + + public override void PreInit() + { + Console.WriteLine("BLUH"); + IoCManager.InjectDependencies(this); + var textMacroFactory = IoCManager.Resolve(); + textMacroFactory.DoAutoRegistrations(); + + // Default to en-US. + // DEVNOTE: If you want your game to be multiregional at runtime, you'll need to + // do something more complicated here. + Loc.LoadCulture(new CultureInfo(Culture)); + // TODO: Document what else you might want to put here + } + + public override void Init() + { + // TODO: Document what you put here + } + + public override void PostInit() + { + base.PostInit(); + // DEVNOTE: You might want to put special init handlers for, say, tiles here. + // TODO: Document what else you might want to put here + } + } +} \ No newline at end of file diff --git a/Content.Shared/GameConfigVars.cs b/Content.Shared/GameConfigVars.cs new file mode 100644 index 0000000..cab45c8 --- /dev/null +++ b/Content.Shared/GameConfigVars.cs @@ -0,0 +1,21 @@ +using Robust.Shared; +using Robust.Shared.Configuration; + +namespace Content.Shared +{ + // DEVNOTE: This is the same as SS14's CCVars. Except it's not named CCVars as that name is + // hot garbage. + [CVarDefs] + public sealed class GameConfigVars: CVars + { + // Declare persistent game config variables here. + // ``` + // public static readonly CVarDef + // VariableName = CVarDef.Create("namespace.varname", default_value, CVar.TYPE | CVar.OTHERTYPE) + // ``` + // This is a good spot to store your database config, among other things. + + public static readonly CVarDef + DummyCVarForTemplate = CVarDef.Create("dummy.whydoineedthis", true, CVar.ARCHIVE); + } +} \ No newline at end of file diff --git a/Content.Shared/app.config b/Content.Shared/app.config new file mode 100644 index 0000000..e1d9d49 --- /dev/null +++ b/Content.Shared/app.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file