-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
418 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
RustPlusApi/Examples/Legacy/GetClanChatChangesLegacy/GetClanChatChangesLegacy.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
24
RustPlusApi/Examples/Legacy/GetClanChatChangesLegacy/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
15 changes: 15 additions & 0 deletions
15
RustPlusApi/Examples/Legacy/GetClanChatLegacy/GetClanChatLegacy.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
12 changes: 6 additions & 6 deletions
12
RustPlusApi/Examples/Legacy/GetEntityChangesLegacy/GetEntityChangesLegacy.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
RustPlusApi/Examples/Legacy/GetEntityInfoLegacy/GetEntityInfoLegacy.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
RustPlusApi/Examples/Legacy/GetInfoLegacy/GetInfoLegacy.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
RustPlusApi/Examples/Legacy/GetMapLegacy/GetMapLegacy.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
RustPlusApi/Examples/Legacy/GetMapMarkersLegacy/GetMapMarkersLegacy.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
RustPlusApi/Examples/Legacy/GetTeamChatChangesLegacy/GetTeamChatChangesLegacy.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
23
RustPlusApi/Examples/Legacy/GetTeamChatChangesLegacy/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
12 changes: 6 additions & 6 deletions
12
RustPlusApi/Examples/Legacy/GetTeamChatLegacy/GetTeamChatLegacy.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
RustPlusApi/Examples/Legacy/GetTeamInfoLegacy/GetTeamInfoLegacy.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.