-
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.
* update workflows * move and improve examples * update project * remove useless nuget * update readme * v1.0.2
- Loading branch information
Showing
28 changed files
with
21,009 additions
and
20,957 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
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,29 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches: [ "main", "develop" ] | ||
pull_request: | ||
branches: [ "main", "develop"] | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --no-restore | ||
|
||
- name: Test | ||
run: dotnet test --no-build --verbosity normal |
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
File renamed without changes.
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,20 @@ | ||
using Newtonsoft.Json; | ||
|
||
using RustPlusApi; | ||
|
||
using static __Constants.RustPlusConst; | ||
|
||
const int entityId = 232773; | ||
var rustPlus = new RustPlus(Ip, Port, PlayerId, PlayerToken); | ||
|
||
rustPlus.Connected += async (_, _) => | ||
{ | ||
await rustPlus.GetEntityInfoAsync(entityId, message => | ||
{ | ||
Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); | ||
rustPlus.Dispose(); | ||
return true; | ||
}); | ||
}; | ||
|
||
await rustPlus.ConnectAsync(); |
File renamed without changes.
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.RustPlusConst; | ||
|
||
var rustPlus = new RustPlus(Ip, Port, PlayerId, PlayerToken); | ||
|
||
rustPlus.Connected += async (_, _) => | ||
{ | ||
await rustPlus.GetInfoAsync(message => | ||
{ | ||
Console.WriteLine($"Infos:\n{JsonConvert.SerializeObject(message, JsonSettings)}"); | ||
rustPlus.Dispose(); | ||
return true; | ||
}); | ||
}; | ||
|
||
await rustPlus.ConnectAsync(); |
File renamed without changes.
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 RustPlusApi; | ||
|
||
using static __Constants.RustPlusConst; | ||
|
||
var rustPlus = new RustPlus(Ip, Port, PlayerId, PlayerToken); | ||
|
||
rustPlus.Connected += async (_, _) => | ||
{ | ||
await rustPlus.GetMapAsync(message => | ||
{ | ||
var imageData = message.Response.Map.JpgImage.ToByteArray(); | ||
if (imageData == null) return false; | ||
File.WriteAllBytes("map.jpg", imageData); // Save under RustPlusApi\RustPlusApi\Examples\GetMap\bin\Debug\net8.0 | ||
rustPlus.Dispose(); | ||
return true; | ||
}); | ||
}; | ||
|
||
await rustPlus.ConnectAsync(); |
File renamed without changes.
8 changes: 5 additions & 3 deletions
8
RustPlusApi/Exemples/GetTeamInfo/Program.cs → RustPlusApi/Examples/GetTeamInfo/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
File renamed without changes.
8 changes: 5 additions & 3 deletions
8
RustPlusApi/Exemples/GetTime/Program.cs → RustPlusApi/Examples/GetTime/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
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,13 @@ | ||
using RustPlusApi; | ||
|
||
using static __Constants.RustPlusConst; | ||
|
||
var rustPlus = new RustPlus(Ip, Port, PlayerId, PlayerToken); | ||
|
||
rustPlus.Connected += async (_, _) => | ||
{ | ||
await rustPlus.SendTeamMessageAsync("Hello from RustPlusApi!"); | ||
rustPlus.Dispose(); | ||
}; | ||
|
||
await rustPlus.ConnectAsync(); |
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,18 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace __Constants | ||
{ | ||
public record RustPlusConst | ||
{ | ||
public const string Ip = "138.201.18.133"; | ||
public const int Port = 28082; | ||
public const ulong PlayerId = 76561198249527954; | ||
public const int PlayerToken = 263698233; | ||
|
||
public static JsonSerializerSettings JsonSettings = new() | ||
{ | ||
NullValueHandling = NullValueHandling.Ignore, | ||
Formatting = Formatting.Indented, | ||
}; | ||
} | ||
} |
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.