-
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.
add some missing method and update proto file
- Loading branch information
Showing
14 changed files
with
553 additions
and
167 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/CheckSubscritionLegacy/CheckSubscritionLegacy.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> |
19 changes: 19 additions & 0 deletions
19
RustPlusApi/Examples/Legacy/CheckSubscritionLegacy/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,19 @@ | ||
using Newtonsoft.Json; | ||
|
||
using RustPlusApi; | ||
|
||
using static __Constants.ExamplesConst; | ||
|
||
var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); | ||
const uint entityId = 0; | ||
|
||
rustPlus.Connected += async (_, _) => | ||
{ | ||
var message = await rustPlus.CheckSubscritionLegacyAsync(entityId); | ||
|
||
Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); | ||
|
||
rustPlus.Dispose(); | ||
}; | ||
|
||
await rustPlus.ConnectAsync(); |
19 changes: 19 additions & 0 deletions
19
RustPlusApi/Examples/Legacy/SetSubscriptionLegacy/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,19 @@ | ||
using Newtonsoft.Json; | ||
|
||
using RustPlusApi; | ||
|
||
using static __Constants.ExamplesConst; | ||
|
||
var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); | ||
const uint entityId = 0; | ||
|
||
rustPlus.Connected += async (_, _) => | ||
{ | ||
var message = await rustPlus.SetSubscritionLegacyAsync(entityId); | ||
|
||
Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); | ||
|
||
rustPlus.Dispose(); | ||
}; | ||
|
||
await rustPlus.ConnectAsync(); |
15 changes: 15 additions & 0 deletions
15
RustPlusApi/Examples/Legacy/SetSubscriptionLegacy/SetSubscriptionLegacy.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
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,36 @@ | ||
using Newtonsoft.Json; | ||
|
||
using RustPlusApi; | ||
|
||
using RustPlusContracts; | ||
|
||
using static __Constants.ExamplesConst; | ||
|
||
var rustPlus = new RustPlusLegacy(Ip, Port, PlayerId, PlayerToken); | ||
|
||
rustPlus.Connecting += (_, _) => Console.WriteLine("Connecting..."); | ||
|
||
rustPlus.Connected += async (_, _) => | ||
{ | ||
Console.WriteLine("Connected..."); | ||
|
||
var request = new AppRequest | ||
{ | ||
GetInfo = new AppEmpty() | ||
}; | ||
var message = await rustPlus.SendRequestAsync(request); | ||
}; | ||
|
||
rustPlus.RequestSent += (_, message) => Console.WriteLine($"Request:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); | ||
|
||
rustPlus.MessageReceived += (_, message) => Console.WriteLine($"Message:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); | ||
|
||
rustPlus.Disconnected += (_, _) => Console.WriteLine("Disconnected..."); | ||
|
||
rustPlus.ErrorOccurred += (_, ex) => Console.WriteLine($"Error:\n{ex}"); | ||
|
||
await rustPlus.ConnectAsync(); | ||
|
||
await Task.Delay(5000); | ||
|
||
rustPlus.Dispose(); |
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,14 @@ | ||
<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
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.