Skip to content

Commit

Permalink
feat: update dependency and switch to jetstream
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed Oct 4, 2022
1 parent ec37159 commit 9780cc8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 36 deletions.
58 changes: 31 additions & 27 deletions GamingAPIPlugins/GamingAPIPlugins.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461</TargetFrameworks>
Expand All @@ -9,11 +9,15 @@
<FileVersion>0.9.0.0</FileVersion>
<RepositoryUrl>https://github.com/GamingAPI/umod-rust-server-plugin.git</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<None Remove="Managed\System.Configuration.Install.dll" />
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>Managed\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Accessibility"/>
<Reference Include="Accessibility" />
<Reference Include="ApexAI">
<HintPath>Managed\ApexAI.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -202,38 +206,38 @@
<Reference Include="Rust.World">
<HintPath>Managed\Rust.World.dll</HintPath>
</Reference>
<Reference Include="System"/>
<Reference Include="System" />
<Reference Include="System.Buffers">
<HintPath>Managed\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition"/>
<Reference Include="System.ComponentModel.DataAnnotations"/>
<Reference Include="System.Configuration"/>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install"/>
<Reference Include="System.Data"/>
<Reference Include="System.Data" />
<Reference Include="System.Data.SQLite">
<HintPath>Managed\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Design"/>
<Reference Include="System.Design" />
<Reference Include="System.Diagnostics.StackTrace, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Managed\System.Diagnostics.StackTrace.dll</HintPath>
</Reference>
<Reference Include="System.DirectoryServices"/>
<Reference Include="System.Drawing"/>
<Reference Include="System.Drawing.Design"/>
<Reference Include="System.EnterpriseServices"/>
<Reference Include="System.DirectoryServices" />
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Design" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Globalization.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Managed\System.Globalization.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.IO.Compression"/>
<Reference Include="System.IO.Compression.FileSystem"/>
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Memory">
<HintPath>Managed\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http"/>
<Reference Include="System.Numerics"/>
<Reference Include="System.Net.Http" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors">
<HintPath>Managed\System.Numerics.Vectors.dll</HintPath>
</Reference>
Expand All @@ -243,23 +247,23 @@
<Reference Include="System.Runtime.CompilerServices.Unsafe">
<HintPath>Managed\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization"/>
<Reference Include="System.Runtime.Serialization.Formatters.Soap"/>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Runtime.Serialization.Formatters.Soap" />
<Reference Include="System.Runtime.Serialization.Xml">
<HintPath>Managed\System.Runtime.Serialization.Xml.dll</HintPath>
</Reference>
<Reference Include="System.Security"/>
<Reference Include="System.Security" />
<Reference Include="System.ServiceModel.Internals, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Managed\System.ServiceModel.Internals.dll</HintPath>
</Reference>
<Reference Include="System.Transactions"/>
<Reference Include="System.Web"/>
<Reference Include="System.Web.ApplicationServices"/>
<Reference Include="System.Web.Services"/>
<Reference Include="System.Windows.Forms"/>
<Reference Include="System.Xml"/>
<Reference Include="System.Xml.Linq"/>
<Reference Include="System.Transactions" />
<Reference Include="System.Web" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml.XPath.XDocument, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Managed\System.Xml.XPath.XDocument.dll</HintPath>
Expand Down Expand Up @@ -449,7 +453,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Oxide.Ext.GamingApi" Version="0.13.0"/>
<PackageReference Include="Oxide.Ext.GamingApi" Version="0.15.0" />
</ItemGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
Expand Down
18 changes: 9 additions & 9 deletions GamingAPIPlugins/plugins/GamingAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private void Init()
{
Timestamp = System.DateTime.Now.ToString()
};
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdEventsStarted(message, DefaultPluginInformation.GetServerId());
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdEventsStartedJetStream(message, DefaultPluginInformation.GetServerId());
});
}

Expand All @@ -42,7 +42,7 @@ object OnPlayerChat(BasePlayer player, string message, Chat.ChatChannel channel)
PlayerName = player.displayName
};

DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdEventsPlayerSteamIdChatted(chatMessage, DefaultPluginInformation.GetServerId(), player.UserIDString);
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdEventsPlayerSteamIdChattedJetStream(chatMessage, DefaultPluginInformation.GetServerId(), player.UserIDString);
});
return null;
}
Expand All @@ -54,7 +54,7 @@ private void ResourceGathered(BasePlayer player, Item item)
{
GamingApiMessageQueue.Instance.AddToMessageQueue(MessageImportance.NORMAL, (System.Action success, System.Action failed) =>
{
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdPlayersSteamIdEventsGatheredResources(ConvertToResouceRequestMessage(item, player), DefaultPluginInformation.GetServerId(), player.IPlayer.Id);
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdPlayersSteamIdEventsGatheredResourcesJetStream(ConvertToResouceRequestMessage(item, player), DefaultPluginInformation.GetServerId(), player.IPlayer.Id);
});
}

Expand Down Expand Up @@ -122,7 +122,7 @@ void OnPlayerRespawned(BasePlayer player)
}
};

DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdPlayersSteamIdEventsRespawned(playerRespawn, DefaultPluginInformation.GetServerId(), player.IPlayer.Id);
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdPlayersSteamIdEventsRespawnedJetStream(playerRespawn, DefaultPluginInformation.GetServerId(), player.IPlayer.Id);
});
}

Expand All @@ -140,7 +140,7 @@ void OnPlayerDisconnected(BasePlayer player, string reason)
//Must be the lowest importance to ensure all other events are are processed first
GamingApiMessageQueue.Instance.AddToMessageQueue(MessageImportance.LOWEST, (System.Action success, System.Action failed) =>
{
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdPlayersSteamIdEventsDisconnected(p, DefaultPluginInformation.GetServerId(), player.IPlayer.Id);
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdPlayersSteamIdEventsDisconnectedJetStream(p, DefaultPluginInformation.GetServerId(), player.IPlayer.Id);
});
}

Expand All @@ -161,7 +161,7 @@ void OnPlayerInit(BasePlayer player)

GamingApiMessageQueue.Instance.AddToMessageQueue(MessageImportance.IMPORTANT, (System.Action success, System.Action failed) =>
{
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdPlayersSteamIdEventsConnected(p, DefaultPluginInformation.GetServerId(), player.IPlayer.Id);
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdPlayersSteamIdEventsConnectedJetStream(p, DefaultPluginInformation.GetServerId(), player.IPlayer.Id);
});
}

Expand All @@ -172,7 +172,7 @@ void OnNewSave(string filename)
{
GamingApiMessageQueue.Instance.AddToMessageQueue(MessageImportance.STRICT, (System.Action success, System.Action failed) =>
{
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdEventsWiped(DefaultPluginInformation.GetServerId());
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdEventsWipedJetStream(DefaultPluginInformation.GetServerId());
});
}

Expand All @@ -191,7 +191,7 @@ void OnWeaponPickup(BasePlayer player, Item item)
};
GamingApiMessageQueue.Instance.AddToMessageQueue(MessageImportance.IMPORTANT, (System.Action success, System.Action failed) =>
{
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdPlayersSteamIdEventsItemsItemIdPickup(i, DefaultPluginInformation.GetServerId(), player.IPlayer.Id, "" + item.info.itemid);
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdPlayersSteamIdEventsItemsItemIdPickupJetStream(i, DefaultPluginInformation.GetServerId(), player.IPlayer.Id, "" + item.info.itemid);
});
}

Expand Down Expand Up @@ -254,7 +254,7 @@ void OnPlayerDamage(BasePlayer player, HitInfo info)
poph.SteamId = attacker.IPlayer.Id;
GamingApiMessageQueue.Instance.AddToMessageQueue(MessageImportance.IMPORTANT, (System.Action success, System.Action failed) =>
{
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdPlayersSteamIdEventsCombatHit(pophWrapper, DefaultPluginInformation.GetServerId(), player.IPlayer.Id);
DefaultPluginInformation.GetInstance().NatsClient.PublishToV0RustServersServerIdPlayersSteamIdEventsCombatHitJetStream(pophWrapper, DefaultPluginInformation.GetServerId(), player.IPlayer.Id);
});
});
}
Expand Down

0 comments on commit 9780cc8

Please sign in to comment.