mirror of https://github.com/bmgjet/Oxide.Rust.git
Compare commits
45 Commits
53ae95cac5
...
3bb0fec676
Author | SHA1 | Date |
---|---|---|
bmgjet | 3bb0fec676 | |
Mr. Blue | 827465bcb6 | |
Mr. Blue | d50d93c184 | |
Mr. Blue | a83521a407 | |
dassjosh | 923bf6f32e | |
WhiteThunder | 5abdd18889 | |
dassjosh | 691c7461a9 | |
WhiteThunder | 013370cb6f | |
Substrata1 | 2d8550b32e | |
Substrata1 | dcfb09521a | |
TurEduard | b944a3f0cb | |
Aspect | 858efeba11 | |
Mr. Blue | a170dd74d9 | |
Mr. Blue | 8eeaa192c3 | |
Mr. Blue | c13a2feb4d | |
Substrata1 | d2224ad033 | |
Vlad-00003 | ff9fab015f | |
Mr. Blue | e1b72adca4 | |
Mr. Blue | f082f76d59 | |
Mr. Blue | feaa5b5415 | |
Mr. Blue | fcf74536ed | |
Mr. Blue | 9ddbd85d0c | |
Mr. Blue | a35199a2b3 | |
Mr. Blue | e86a2be083 | |
Mr. Blue | 88251c79e1 | |
Mr. Blue | 9b2487362c | |
Mr. Blue | a9e1e0dd4b | |
Mr. Blue | acec4a7196 | |
Mr. Blue | 45c6031556 | |
Mr. Blue | 90e1b26205 | |
Nikolay | 66fa35a665 | |
WhiteThunder | 98619a0eaf | |
Mr. Blue | ec024407a9 | |
Mr. Blue | f5eaa19333 | |
Mr. Blue | f58c4c88fc | |
WhiteThunder | 178327f49c | |
Mr. Blue | abad49671a | |
Substrata1 | d7a9ef8284 | |
shooter46 | 3d6191e3e2 | |
Mr. Blue | 6517ff6ca2 | |
Mr. Blue | 0948b2ea08 | |
Mr. Blue | cfa50f5613 | |
Mr. Blue | 7f18c8c01d | |
Mr. Blue | c063b66150 | |
Mr. Blue | 1e908a3793 |
|
@ -1,41 +0,0 @@
|
|||
name: Build Solution
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
branch-postfix:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Oxide Solution
|
||||
runs-on: windows-2022
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Increment Version
|
||||
uses: action-pack/increment@v2
|
||||
with:
|
||||
name: "VERSION"
|
||||
token: ${{ secrets.REPO_ACCESS_TOKEN }}
|
||||
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v1
|
||||
|
||||
- name: Build Solution
|
||||
run: msbuild Oxide.Rust.sln -t:rebuild -restore -property:Configuration=Release -property:Version=2.0.${{ vars.VERSION }}${{ inputs.branch-postfix }}
|
||||
|
||||
- name: Compress Bundles
|
||||
run: |
|
||||
cd src\bin\Bundle
|
||||
7z a Oxide.Rust.zip .\Oxide.Rust\*
|
||||
7z a Oxide.Rust-linux.zip .\Oxide.Rust-linux\*
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ github.event.repository.name }}
|
||||
path: src\bin\Bundle\Oxide.*.zip
|
|
@ -8,14 +8,16 @@ on:
|
|||
jobs:
|
||||
build:
|
||||
name: Run Build
|
||||
uses: ./.github/workflows/build.yaml
|
||||
secrets: inherit
|
||||
uses: OxideMod/Actions/.github/workflows/game-build.yaml@main
|
||||
with:
|
||||
game: "Rust"
|
||||
branch-postfix: "-${{ github.ref_name }}"
|
||||
secrets:
|
||||
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
|
||||
|
||||
deploy:
|
||||
name: Deploy to S3
|
||||
uses: OxideMod/Actions/.github/workflows/r2-publish.yml@main
|
||||
uses: OxideMod/Actions/.github/workflows/r2-publish.yaml@main
|
||||
needs: build
|
||||
with:
|
||||
generate-filehash: true
|
||||
|
|
|
@ -8,8 +8,11 @@ on:
|
|||
jobs:
|
||||
build:
|
||||
name: Run Build
|
||||
uses: ./.github/workflows/build.yaml
|
||||
secrets: inherit
|
||||
uses: OxideMod/Actions/.github/workflows/game-build.yaml@main
|
||||
with:
|
||||
game: "Rust"
|
||||
secrets:
|
||||
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
|
||||
|
||||
release:
|
||||
name: Create Release
|
||||
|
@ -32,3 +35,26 @@ jobs:
|
|||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
body: |
|
||||
See https://umod.org/games/rust for changes
|
||||
|
||||
update-docs:
|
||||
name: Update Documentation
|
||||
runs-on: ubuntu-22.04
|
||||
needs: build
|
||||
steps:
|
||||
- name: Checkout Docs Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.event.repository.owner.name }}/Oxide.Docs
|
||||
token: ${{ secrets.REPO_ACCESS_TOKEN }}
|
||||
ref: main
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ github.event.repository.name }}-docs
|
||||
- name: Commit and Push Changes
|
||||
run: |
|
||||
git config --global user.email github-actions@github.com
|
||||
git config --global user.name github-actions
|
||||
git add docs.json
|
||||
git diff-index --quiet HEAD || git commit -m "Update hooks index to 2.0.${{ vars.VERSION }}"
|
||||
git push
|
||||
|
|
|
@ -21,6 +21,7 @@ TestResult.xml
|
|||
*.nupkg
|
||||
**/packages/*
|
||||
**/tools/*
|
||||
**/docs/*
|
||||
!**/packages/build/
|
||||
!**/packages/repositories.config
|
||||
|
||||
|
|
|
@ -14,9 +14,10 @@
|
|||
<BranchArg Condition="'$(SteamBranch)' != ''">-steam_branch $(SteamBranch)</BranchArg>
|
||||
<DepotArg Condition="'$(SteamDepot)' != ''">-steam_depot $(SteamDepot)</DepotArg>
|
||||
<LoginArg Condition="'$(SteamLogin)' != ''">-steam_access $(SteamLogin)</LoginArg>
|
||||
<ReferencesOverrideArg Condition="'$(ReferencesOverride)' != ''">-references_override $(ReferencesOverride)</ReferencesOverrideArg>
|
||||
</PropertyGroup>
|
||||
<Message Text="Setting up environment for $(TargetPlatform)..." Importance="High" />
|
||||
<Exec Command="$(SteamCommand) -game_name $(GameName) -dotnet $(TargetFramework) -target_dir $(TargetDir) -managed_dir $(ManagedDir) $(PlatformArg) $(DeobfArg) $(AppIdArg) $(BranchArg) $(DepotArg) $(LoginArg)" />
|
||||
<Exec Command="$(SteamCommand) -game_name $(GameName) -dotnet $(TargetFramework) -target_dir $(TargetDir) -managed_dir $(ManagedDir) $(PlatformArg) $(DeobfArg) $(AppIdArg) $(BranchArg) $(DepotArg) $(LoginArg) $(ReferencesOverrideArg)" />
|
||||
</Target>
|
||||
<Target Name="ChangeAliasesOfStrongNameAssemblies" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
|
||||
<ItemGroup>
|
||||
|
|
19
Steam.ps1
19
Steam.ps1
|
@ -8,7 +8,8 @@ param (
|
|||
[string]$steam_appid = "0",
|
||||
[string]$steam_branch = "public",
|
||||
[string]$steam_depot = "",
|
||||
[string]$steam_access = "anonymous"
|
||||
[string]$steam_access = "anonymous",
|
||||
[string]$references_override = ""
|
||||
)
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
|
@ -34,12 +35,13 @@ $resources_dir = Join-Path $root_dir "resources"
|
|||
$deps_dir = Join-Path $project_dir "Dependencies"
|
||||
$platform_dir = Join-Path $deps_dir $platform
|
||||
$managed_dir = Join-Path $platform_dir $managed_dir # TODO: Make sure passed path is Linux-compatible
|
||||
$docs_dir = Join-Path $root_dir "docs"
|
||||
$patcher_exe = Join-Path $tools_dir "OxidePatcher.exe"
|
||||
$references_file = Join-Path $tools_dir ".references"
|
||||
New-Item "$tools_dir", "$managed_dir" -ItemType Directory -Force | Out-Null
|
||||
New-Item "$tools_dir", "$managed_dir", "$docs_dir" -ItemType Directory -Force | Out-Null
|
||||
|
||||
# Set URLs of dependencies and tools to download
|
||||
$steam_depotdl_url = "https://img.mrblue.io/ed3a2b1054f5482e95832dba85953955.zip"
|
||||
$steam_depotdl_url = "https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_2.5.0/depotdownloader-2.5.0.zip"
|
||||
$de4dot_url = "https://github.com/0xd4d/de4dot/suites/507020524/artifacts/2658127"
|
||||
$patcher_url = "https://github.com/OxideMod/Oxide.Patcher/releases/download/latest/OxidePatcher.exe"
|
||||
|
||||
|
@ -78,8 +80,13 @@ function Find-Dependencies {
|
|||
Write-Host "Getting references for $steam_branch branch of $steam_appid"
|
||||
try {
|
||||
# TODO: Exclude dependencies included in repository
|
||||
($xml.selectNodes("//Reference") | Select-Object Include -ExpandProperty Include) -Replace "\S+$", "regex:$&.dll" | Out-File $references_file
|
||||
Write-Host "References:" ((Get-Content $references_file).Replace('regex:', '') -Join ', ')
|
||||
if ($references_override) {
|
||||
$references_override | Out-File $references_file
|
||||
Write-Host "References:" ((Get-Content $references_file) -Join ', ')
|
||||
} else {
|
||||
($xml.selectNodes("//Reference") | Select-Object Include -ExpandProperty Include) -Replace "\S+$", "regex:$&.dll" | Out-File $references_file
|
||||
Write-Host "References:" ((Get-Content $references_file).Replace('regex:', '') -Join ', ')
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Error: Could not get references or none found in $project.csproj"
|
||||
Write-Host $_.Exception | Format-List -Force
|
||||
|
@ -311,7 +318,7 @@ function Start-Patcher {
|
|||
if ($IsLinux) {
|
||||
Start-Process mono -WorkingDirectory $managed_dir -ArgumentList "$patcher_exe -c -p `"$managed_dir`" $patcher_file" -NoNewWindow -Wait
|
||||
} elseif ($IsWindows) {
|
||||
Start-Process $patcher_exe -WorkingDirectory $managed_dir -ArgumentList "-c -p `"$managed_dir`" $patcher_file" -NoNewWindow -Wait
|
||||
Start-Process $patcher_exe -WorkingDirectory $managed_dir -ArgumentList "-c -p `"$managed_dir`" -docs $docs_dir/docs.json $patcher_file" -NoNewWindow -Wait
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Error: Could not start or complete patching process"
|
||||
|
|
4312
resources/Rust.opj
4312
resources/Rust.opj
File diff suppressed because it is too large
Load Diff
|
@ -21,6 +21,7 @@
|
|||
<ManagedDir>RustDedicated_Data/Managed</ManagedDir>
|
||||
<NoWarn>NU1701</NoWarn>
|
||||
<GitBranch></GitBranch>
|
||||
<ReferencesOverride>regex:Managed/(.*).dll</ReferencesOverride>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Oxide.References" Version="2.0.*" />
|
||||
|
@ -61,7 +62,7 @@
|
|||
</ItemGroup>
|
||||
<Target Name="AddGitBranchMeta" BeforeTargets="CoreGenerateAssemblyInfo">
|
||||
<Exec Command="git name-rev --name-only HEAD" WorkingDirectory="$(MSBuildProjectDirectory)" ConsoleToMSBuild="True">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="GitBranch"/>
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="GitBranch" />
|
||||
</Exec>
|
||||
<ItemGroup>
|
||||
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="$(GitBranch) != ''">
|
||||
|
|
|
@ -319,7 +319,7 @@ namespace Oxide.Game.Rust
|
|||
int number = 1;
|
||||
foreach (Plugin plugin in loadedPlugins.Where(p => p.Filename != null))
|
||||
{
|
||||
output += $"\n {number++:00} \"{plugin.Title}\" ({plugin.Version}) by {plugin.Author} ({plugin.TotalHookTime:0.00}s) - {plugin.Filename.Basename()}";
|
||||
output += $"\n {number++:00} \"{plugin.Title}\" ({plugin.Version}) by {plugin.Author} ({plugin.TotalHookTime:0.00}s / {FormatBytes(plugin.TotalHookMemory)}) - {plugin.Filename.Basename()}";
|
||||
}
|
||||
|
||||
foreach (string pluginName in unloadedPluginErrors.Keys)
|
||||
|
@ -330,6 +330,14 @@ namespace Oxide.Game.Rust
|
|||
player.Reply(output);
|
||||
}
|
||||
|
||||
private static string FormatBytes(long bytes)
|
||||
{
|
||||
if (bytes < 1024) return $"{bytes:0} B";
|
||||
if (bytes < 1048576) return $"{bytes / 1024:0} KB";
|
||||
if (bytes < 1073741824) return $"{bytes / 1048576:0} MB";
|
||||
return $"{bytes / 1073741824:0} GB";
|
||||
}
|
||||
|
||||
#endregion Plugins Command
|
||||
|
||||
#region Reload Command
|
||||
|
|
|
@ -286,6 +286,16 @@ namespace Oxide.Game.Rust
|
|||
return true;
|
||||
}
|
||||
|
||||
// Check if chat command
|
||||
string chatCommandPrefix = CommandHandler.GetChatCommandPrefix(message);
|
||||
if ( chatCommandPrefix != null )
|
||||
{
|
||||
TryRunPlayerCommand( basePlayer, message, chatCommandPrefix );
|
||||
return false;
|
||||
}
|
||||
|
||||
message = message.EscapeRichText();
|
||||
|
||||
// Check if using Rust+ app
|
||||
if (basePlayer == null || !basePlayer.IsConnected)
|
||||
{
|
||||
|
@ -305,8 +315,7 @@ namespace Oxide.Game.Rust
|
|||
/// <param name="basePlayer"></param>
|
||||
/// <param name="message"></param>
|
||||
/// <returns></returns>
|
||||
[HookMethod("IOnPlayerCommand")]
|
||||
private void IOnPlayerCommand(BasePlayer basePlayer, string message)
|
||||
private void TryRunPlayerCommand(BasePlayer basePlayer, string message, string commandPrefix)
|
||||
{
|
||||
if (basePlayer == null)
|
||||
{
|
||||
|
@ -316,13 +325,13 @@ namespace Oxide.Game.Rust
|
|||
string str = message.Replace("\n", "").Replace("\r", "").Trim();
|
||||
|
||||
// Check if it is a chat command
|
||||
if (string.IsNullOrEmpty(str) || str[0] != '/' || str.Length <= 1)
|
||||
if (string.IsNullOrEmpty(str))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Parse the command
|
||||
ParseCommand(str.TrimStart('/'), out string cmd, out string[] args);
|
||||
ParseCommand(str.Substring(commandPrefix.Length), out string cmd, out string[] args);
|
||||
if (cmd == null)
|
||||
{
|
||||
return;
|
||||
|
@ -629,16 +638,5 @@ namespace Oxide.Game.Rust
|
|||
}
|
||||
|
||||
#endregion Server Hooks
|
||||
|
||||
#region Depricated Hooks
|
||||
|
||||
[HookMethod( "OnMapMarkerRemove" )]
|
||||
private object OnMapMarkerRemove(BasePlayer player, List<ProtoBuf.MapNote> mapMarker, int index)
|
||||
{
|
||||
return Interface.Oxide.CallDeprecatedHook("OnMapMarkerRemove", "OnMapMarkerRemove(BasePlayer player, List<MapNote> mapMarker, int index)",
|
||||
new DateTime(2023, 12, 31), player, mapMarker[index]);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue