Skip to content

Commit

Permalink
add more test examples
Browse files Browse the repository at this point in the history
  • Loading branch information
HandyS11 committed May 30, 2024
1 parent 61810f3 commit 1733417
Show file tree
Hide file tree
Showing 31 changed files with 418 additions and 97 deletions.
71 changes: 60 additions & 11 deletions RustPlusApi.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SendTeamChat", "RustPlusApi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SetEntityValue", "RustPlusApi\Examples\SetEntityValue\SetEntityValue.csproj", "{4E5DCE64-A8E5-42C0-8786-EA1FF36CACE4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrobeEntity", "RustPlusApi\Examples\StrobeEntity\StrobeEntity.csproj", "{3C4E8016-7B7F-4C5E-A5CA-A92A3797AA2B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GetMapMarkers", "RustPlusApi\Examples\GetMapMarkers\GetMapMarkers.csproj", "{DD34FAE8-30AA-4787-A6D1-77C330A0928F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RustPlusApi.Fcm", "RustPlusApi\RustPlusApi.Fcm\RustPlusApi.Fcm.csproj", "{CFDFB335-A783-4F82-8094-3ED14E3EBC49}"
Expand Down Expand Up @@ -59,13 +57,29 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GetSmartSwitchChanges", "Ru
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GetStorageMonitorChanges", "RustPlusApi\Examples\GetStorageMonitorChanges\GetStorageMonitorChanges.csproj", "{2E65E71F-1C4E-4813-86C9-C5F5D3E60187}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetMapMarkersLegacy", "RustPlusApi\Examples\Legacy\GetMapMarkersLegacy\GetMapMarkersLegacy.csproj", "{70F7555D-DEC9-45E7-BB64-CB31704A2C0A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GetMapMarkersLegacy", "RustPlusApi\Examples\Legacy\GetMapMarkersLegacy\GetMapMarkersLegacy.csproj", "{70F7555D-DEC9-45E7-BB64-CB31704A2C0A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GetTeamChatLegacy", "RustPlusApi\Examples\Legacy\GetTeamChatLegacy\GetTeamChatLegacy.csproj", "{2223E2FE-9CAA-45DF-9F47-E52371018077}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GetTeamInfoLegacy", "RustPlusApi\Examples\Legacy\GetTeamInfoLegacy\GetTeamInfoLegacy.csproj", "{4E63E17B-7FD4-4B58-9F22-265B0EE92672}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GetTimeLegacy", "RustPlusApi\Examples\Legacy\GetTimeLegacy\GetTimeLegacy.csproj", "{4255A1A9-C7D8-45F5-81C3-BBCA96886DAA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PromoteToLeaderLegacy", "RustPlusApi\Examples\Legacy\PromoteToLeader\PromoteToLeaderLegacy.csproj", "{80F46159-40F8-4CA3-90A1-EAE62E6BF2F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SendTeamMessageLegacy", "RustPlusApi\Examples\Legacy\SendTeamMessageLegacy\SendTeamMessageLegacy.csproj", "{232323AD-2A44-4EF4-AD71-100563083FAD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetTeamChatChangesLegacy", "RustPlusApi\Examples\Legacy\GetTeamChatChangesLegacy\GetTeamChatChangesLegacy.csproj", "{F8EDEF6A-5EF8-4D01-9C6E-FB379ACF9C9E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetClanChatLegacy", "RustPlusApi\Examples\Legacy\GetClanChatLegacy\GetClanChatLegacy.csproj", "{D90102B3-1F28-42C9-AE3D-D19E689C4D4E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetClanChatChangesLegacy", "RustPlusApi\Examples\Legacy\GetClanChatChangesLegacy\GetClanChatChangesLegacy.csproj", "{248A7713-161F-4A78-9C33-14E5470DFB08}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetTeamChatLegacy", "RustPlusApi\Examples\Legacy\GetTeamChatLegacy\GetTeamChatLegacy.csproj", "{2223E2FE-9CAA-45DF-9F47-E52371018077}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SetEntityValueLegacy", "RustPlusApi\Examples\Legacy\SetEntityValueLegacy\SetEntityValueLegacy.csproj", "{F4BB95F4-2171-4087-889D-F65158AFD713}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetTeamInfoLegacy", "RustPlusApi\Examples\Legacy\GetTeamInfoLegacy\GetTeamInfoLegacy.csproj", "{4E63E17B-7FD4-4B58-9F22-265B0EE92672}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StrobeEntityLegacy", "RustPlusApi\Examples\Legacy\StrobeEntityLegacy\StrobeEntityLegacy.csproj", "{9A41A0A3-9FAD-42E2-BD22-E3B4E2DBA161}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetTimeLegacy", "RustPlusApi\Examples\Legacy\GetTimeLegacy\GetTimeLegacy.csproj", "{4255A1A9-C7D8-45F5-81C3-BBCA96886DAA}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToggleEntityLegacy", "RustPlusApi\Examples\Legacy\ToggleEntityLegacy\ToggleEntityLegacy.csproj", "{172AAEAA-0F46-457C-9494-8BBEE5377D66}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -105,10 +119,6 @@ Global
{4E5DCE64-A8E5-42C0-8786-EA1FF36CACE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4E5DCE64-A8E5-42C0-8786-EA1FF36CACE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4E5DCE64-A8E5-42C0-8786-EA1FF36CACE4}.Release|Any CPU.Build.0 = Release|Any CPU
{3C4E8016-7B7F-4C5E-A5CA-A92A3797AA2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3C4E8016-7B7F-4C5E-A5CA-A92A3797AA2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C4E8016-7B7F-4C5E-A5CA-A92A3797AA2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C4E8016-7B7F-4C5E-A5CA-A92A3797AA2B}.Release|Any CPU.Build.0 = Release|Any CPU
{DD34FAE8-30AA-4787-A6D1-77C330A0928F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD34FAE8-30AA-4787-A6D1-77C330A0928F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD34FAE8-30AA-4787-A6D1-77C330A0928F}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -189,6 +199,38 @@ Global
{4255A1A9-C7D8-45F5-81C3-BBCA96886DAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4255A1A9-C7D8-45F5-81C3-BBCA96886DAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4255A1A9-C7D8-45F5-81C3-BBCA96886DAA}.Release|Any CPU.Build.0 = Release|Any CPU
{80F46159-40F8-4CA3-90A1-EAE62E6BF2F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80F46159-40F8-4CA3-90A1-EAE62E6BF2F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80F46159-40F8-4CA3-90A1-EAE62E6BF2F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80F46159-40F8-4CA3-90A1-EAE62E6BF2F3}.Release|Any CPU.Build.0 = Release|Any CPU
{232323AD-2A44-4EF4-AD71-100563083FAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{232323AD-2A44-4EF4-AD71-100563083FAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{232323AD-2A44-4EF4-AD71-100563083FAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{232323AD-2A44-4EF4-AD71-100563083FAD}.Release|Any CPU.Build.0 = Release|Any CPU
{F8EDEF6A-5EF8-4D01-9C6E-FB379ACF9C9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8EDEF6A-5EF8-4D01-9C6E-FB379ACF9C9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8EDEF6A-5EF8-4D01-9C6E-FB379ACF9C9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8EDEF6A-5EF8-4D01-9C6E-FB379ACF9C9E}.Release|Any CPU.Build.0 = Release|Any CPU
{D90102B3-1F28-42C9-AE3D-D19E689C4D4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D90102B3-1F28-42C9-AE3D-D19E689C4D4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D90102B3-1F28-42C9-AE3D-D19E689C4D4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D90102B3-1F28-42C9-AE3D-D19E689C4D4E}.Release|Any CPU.Build.0 = Release|Any CPU
{248A7713-161F-4A78-9C33-14E5470DFB08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{248A7713-161F-4A78-9C33-14E5470DFB08}.Debug|Any CPU.Build.0 = Debug|Any CPU
{248A7713-161F-4A78-9C33-14E5470DFB08}.Release|Any CPU.ActiveCfg = Release|Any CPU
{248A7713-161F-4A78-9C33-14E5470DFB08}.Release|Any CPU.Build.0 = Release|Any CPU
{F4BB95F4-2171-4087-889D-F65158AFD713}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F4BB95F4-2171-4087-889D-F65158AFD713}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F4BB95F4-2171-4087-889D-F65158AFD713}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F4BB95F4-2171-4087-889D-F65158AFD713}.Release|Any CPU.Build.0 = Release|Any CPU
{9A41A0A3-9FAD-42E2-BD22-E3B4E2DBA161}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9A41A0A3-9FAD-42E2-BD22-E3B4E2DBA161}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A41A0A3-9FAD-42E2-BD22-E3B4E2DBA161}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9A41A0A3-9FAD-42E2-BD22-E3B4E2DBA161}.Release|Any CPU.Build.0 = Release|Any CPU
{172AAEAA-0F46-457C-9494-8BBEE5377D66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{172AAEAA-0F46-457C-9494-8BBEE5377D66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{172AAEAA-0F46-457C-9494-8BBEE5377D66}.Release|Any CPU.ActiveCfg = Release|Any CPU
{172AAEAA-0F46-457C-9494-8BBEE5377D66}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -201,7 +243,6 @@ Global
{E9F90342-34DE-4166-9769-483A3FA1F144} = {BC948ADE-1674-4955-B27C-F0E96100978E}
{D70DD514-081F-4055-8779-6626DA96D18D} = {BC948ADE-1674-4955-B27C-F0E96100978E}
{4E5DCE64-A8E5-42C0-8786-EA1FF36CACE4} = {BC948ADE-1674-4955-B27C-F0E96100978E}
{3C4E8016-7B7F-4C5E-A5CA-A92A3797AA2B} = {BC948ADE-1674-4955-B27C-F0E96100978E}
{DD34FAE8-30AA-4787-A6D1-77C330A0928F} = {BC948ADE-1674-4955-B27C-F0E96100978E}
{A4EF8656-723B-4E2E-9457-57DCB24CB409} = {BC948ADE-1674-4955-B27C-F0E96100978E}
{FF9758F9-2500-4CE1-AACE-8C67134046F4} = {A4EF8656-723B-4E2E-9457-57DCB24CB409}
Expand All @@ -223,6 +264,14 @@ Global
{2223E2FE-9CAA-45DF-9F47-E52371018077} = {EBB661D0-93FF-4742-AF91-9036027CD136}
{4E63E17B-7FD4-4B58-9F22-265B0EE92672} = {EBB661D0-93FF-4742-AF91-9036027CD136}
{4255A1A9-C7D8-45F5-81C3-BBCA96886DAA} = {EBB661D0-93FF-4742-AF91-9036027CD136}
{80F46159-40F8-4CA3-90A1-EAE62E6BF2F3} = {EBB661D0-93FF-4742-AF91-9036027CD136}
{232323AD-2A44-4EF4-AD71-100563083FAD} = {EBB661D0-93FF-4742-AF91-9036027CD136}
{F8EDEF6A-5EF8-4D01-9C6E-FB379ACF9C9E} = {EBB661D0-93FF-4742-AF91-9036027CD136}
{D90102B3-1F28-42C9-AE3D-D19E689C4D4E} = {EBB661D0-93FF-4742-AF91-9036027CD136}
{248A7713-161F-4A78-9C33-14E5470DFB08} = {EBB661D0-93FF-4742-AF91-9036027CD136}
{F4BB95F4-2171-4087-889D-F65158AFD713} = {EBB661D0-93FF-4742-AF91-9036027CD136}
{9A41A0A3-9FAD-42E2-BD22-E3B4E2DBA161} = {EBB661D0-93FF-4742-AF91-9036027CD136}
{172AAEAA-0F46-457C-9494-8BBEE5377D66} = {EBB661D0-93FF-4742-AF91-9036027CD136}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A4B4251F-ADA4-418D-95B5-27BA99A307A3}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\RustPlusApi\RustPlusApi.csproj" />
<ProjectReference Include="..\..\__Constants\__Constants.csproj" />
</ItemGroup>

</Project>
24 changes: 24 additions & 0 deletions RustPlusApi/Examples/Legacy/GetClanChatChangesLegacy/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Newtonsoft.Json;

using RustPlusApi;

using static __Constants.ExamplesConst;

var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken);

rustPlus.Connected += async (_, _) =>
{
// This method is not fully integrated in Rust so it will not work until the Clan update is released.
var message = await rustPlus.GetClanChatLegacyAsync();

Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}");
};

rustPlus.MessageReceived += (_, message) =>
{
if (message.Broadcast is not { ClanChanged: not null }) return;

Console.WriteLine($"Message:\n{JsonConvert.SerializeObject(message, JsonSettings)}");
};

await rustPlus.ConnectAsync();
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\RustPlusApi\RustPlusApi.csproj" />
<ProjectReference Include="..\..\__Constants\__Constants.csproj" />
</ItemGroup>

</Project>
19 changes: 19 additions & 0 deletions RustPlusApi/Examples/Legacy/GetClanChatLegacy/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Newtonsoft.Json;

using RustPlusApi;

using static __Constants.ExamplesConst;

var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken);

rustPlus.Connected += async (_, _) =>
{
// This method is not fully integrated in Rust so it will not work until the Clan update is released.
var message = await rustPlus.GetClanChatLegacyAsync();

Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}");

rustPlus.Dispose();
};

await rustPlus.ConnectAsync();
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\RustPlusApi\RustPlusApi.csproj" />
Expand Down
5 changes: 2 additions & 3 deletions RustPlusApi/Examples/Legacy/GetEntityChangesLegacy/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using static __Constants.ExamplesConst;

var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken);
const uint entityId = 0;
const uint entityId = 3716008;

rustPlus.Connected += async (_, _) =>
{
Expand All @@ -18,8 +18,7 @@
{
if (message.Broadcast is not { EntityChanged: not null }) return;

var entityChanged = message.Broadcast.EntityChanged;
Console.WriteLine($"Message:\n{JsonConvert.SerializeObject(entityChanged, JsonSettings)}");
Console.WriteLine($"Message:\n{JsonConvert.SerializeObject(message, JsonSettings)}");
};

await rustPlus.ConnectAsync();
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\RustPlusApi\RustPlusApi.csproj" />
Expand Down
12 changes: 6 additions & 6 deletions RustPlusApi/Examples/Legacy/GetInfoLegacy/GetInfoLegacy.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\RustPlusApi\RustPlusApi.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion RustPlusApi/Examples/Legacy/GetInfoLegacy/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

rustPlus.Connected += async (_, _) =>
{
var message = await rustPlus.GetInfoLegacyAsync();
var message = await rustPlus.GetTeamChatLegacyAsync();

Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}");

Expand Down
12 changes: 6 additions & 6 deletions RustPlusApi/Examples/Legacy/GetMapLegacy/GetMapLegacy.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\RustPlusApi\RustPlusApi.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\RustPlusApi\RustPlusApi.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\RustPlusApi\RustPlusApi.csproj" />
<ProjectReference Include="..\..\__Constants\__Constants.csproj" />
</ItemGroup>

</Project>
23 changes: 23 additions & 0 deletions RustPlusApi/Examples/Legacy/GetTeamChatChangesLegacy/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Newtonsoft.Json;

using RustPlusApi;

using static __Constants.ExamplesConst;

var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken);

rustPlus.Connected += async (_, _) =>
{
var message = await rustPlus.GetTeamChatLegacyAsync();

Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}");
};

rustPlus.MessageReceived += (_, message) =>
{
if (message.Broadcast is not { TeamMessage: not null }) return;

Console.WriteLine($"Message:\n{JsonConvert.SerializeObject(message, JsonSettings)}");
};

await rustPlus.ConnectAsync();
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\RustPlusApi\RustPlusApi.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\RustPlusApi\RustPlusApi.csproj" />
Expand Down
Loading

0 comments on commit 1733417

Please sign in to comment.