Skip to content

Commit

Permalink
Adds example nuget lib to example module
Browse files Browse the repository at this point in the history
  • Loading branch information
RainOrigami committed Aug 15, 2023
1 parent 4c2574c commit 790cc59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ExampleModule/Example.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using BattleBitAPI.Common;
using BattleBitAPIRunner;
using Newtonsoft.Json;
using System.Diagnostics;

namespace ExampleModule
Expand All @@ -14,7 +15,8 @@ public override Task<bool> OnPlayerTypedMessage(RunnerPlayer player, ChatChannel
{
if (msg == "ping")
{
this.Server.SayToChat("pong");
// Usage of packages is supported
this.Server.SayToChat(JsonConvert.SerializeObject("pong"));
}

// Since modules can be loaded and unloaded at runtime, it's recommended to check for the module every time it's used.
Expand Down
4 changes: 4 additions & 0 deletions ExampleModule/ExampleModule.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BattleBitAPIRunner\BattleBitAPIRunner.csproj" />
<ProjectReference Include="..\ExampleModuleIntegration\ExampleModuleIntegration.csproj" />
Expand Down

0 comments on commit 790cc59

Please sign in to comment.