Skip to content

Commit

Permalink
Moved GameConnectionManager.cs to the embedded folder
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Apr 24, 2024
1 parent 68354ea commit 61778b4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Embedded\GameConnectionManager.cs" />
<EmbeddedResource Include="GlueControl\Embedded\GameConnectionManager.cs" />
<EmbeddedResource Include="Embedded\Json\GlueJsonManager.cs" />
<EmbeddedResource Include="Embedded\Json\JsonContainer.cs" />
<EmbeddedResource Include="Embedded\Json\JsonManager.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public static class EmbeddedCodeManager
"CommandReceiver.cs",

"Dtos.cs",
"GameConnectionManager.cs",
"GlueCallsClassGenerationManager.cs",

"Editing.CameraLogic.cs",
Expand Down Expand Up @@ -91,6 +92,12 @@ public static void EmbedAll(bool fullyGenerate)

// This was a typo in old projects:
RemoveEmbeddedFile("Runtime/DynamicEntitys.Generated.cs", saveAfterRemoving:true);

// this was moved:
FilePath oldGameConnectionManagerLocation = GlueState.Self.CurrentGlueProjectDirectory + "GlueCommunication/GameConnectionManager.Generated.cs";
GlueCommands.Self.ProjectCommands.RemoveFromProjects(oldGameConnectionManagerLocation);


}

public static void RemoveAll()
Expand Down
14 changes: 0 additions & 14 deletions FRBDK/Glue/GameCommunicationPlugin/MainGameCommunicationPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using GameCommunicationPlugin.CodeGeneration;
using EmbeddedCodeManager = GameCommunicationPlugin.CodeGeneration.EmbeddedCodeManager;
using ToolsUtilities;
using GameCommunicationPlugin.GlueControl.ViewModels;
using OfficialPluginsCore.Compiler.CommandReceiving;
Expand All @@ -38,7 +37,6 @@ public class MainGameCommunicationPlugin : PluginBase

public override bool ShutDown(PluginShutDownReason shutDownReason)
{
ReactToLoadedGlux -= HandleGluxLoaded;
_gameCommunicationManager.OnPacketReceived -= HandleOnPacketReceived;
_gameCommunicationManager.Dispose();
_gameCommunicationManager = null;
Expand All @@ -54,8 +52,6 @@ public override void StartUp()
_gameCommunicationManager.OnPacketReceived += HandleOnPacketReceived;
GameConnectionManager.Self = _gameCommunicationManager;

ReactToLoadedGlux += HandleGluxLoaded;

game1GlueCommunicationGenerator = new Game1GlueCommunicationGenerator(true, 8888);
RegisterCodeGenerator(game1GlueCommunicationGenerator);

Expand Down Expand Up @@ -96,15 +92,5 @@ private async Task<object> HandleOnPacketReceived(GameConnectionManager.Packet p
return toReturn;
}

private void HandleGluxLoaded()
{
if (GameCommunicationHelper.IsFrbNewEnough())
{
EmbeddedCodeManager.Embed(new System.Collections.Generic.List<string>
{
"GameConnectionManager.cs"
});
}
}
}
}

0 comments on commit 61778b4

Please sign in to comment.