Compare commits

...

45 Commits

Author SHA1 Message Date
bmgjet 3bb0fec676
Add Hook And Exposes
Add Hook:
OnRequestFlag

Expose Public:
nearestSource
lockRange
lockConeDot
timeToLock
timeToLoseLock
2024-03-26 19:40:24 +13:00
Mr. Blue 827465bcb6 Patch for March 21st Rust update (Protocol 2524.247.1) 2024-03-21 19:59:50 +01:00
Mr. Blue d50d93c184 Patch for March 9th Rust update (Protocol 2524.247.1) 2024-03-09 19:14:27 +01:00
Mr. Blue a83521a407 Patch for March 7th Rust update (Protocol 2524.247.1) 2024-03-07 19:04:08 +01:00
dassjosh 923bf6f32e Add OnQuarryToggle hook
- object OnQuarryToggle(MiningQuarry miningQuarry, BasePlayer player)
2024-03-05 07:57:25 +01:00
WhiteThunder 5abdd18889 Add OnNearbyTurretsScan hook
- object OnNearbyTurretsScan(AutoTurret turret, List<AutoTurret> nearbyTurrets, bool created)
2024-03-05 07:28:35 +01:00
dassjosh 691c7461a9 Add OnPoweredLightsPointAdd and OnSignContentCopied hooks
- object OnPoweredLightsPointAdd(PoweredLightsDeployer deployer, BasePlayer player, Vector3 newPoint, Vector3 newNormal)
- void OnSignContentCopied(SignContent content, ISignage sign, IUGCBrowserEntity browser)
2024-03-05 07:24:13 +01:00
WhiteThunder 013370cb6f Expose various fields/methods as public
AutoTurret::authDirty
AutoTurret::hasPotentialUnauthedTarget
AutoTurret::interferenceUpdateList
AutoTurret::nearbyTurrets
AutoTurret::OnEntityEnterTrigger
AutoTurret::PreventDuplicatesInQueue
AutoTurret::TryRegisterForInterferenceUpdate
AutoTurret::UpdateInterference
AutoTurret::UpdateInterferenceOnOthers
AutoTurret::UpdateNearbyTurrets
HuntingTrophy::CurrentTrophyData
ItemModBackpack::CanAcceptItem
PlayerInventory::AddBackpackContentsToList
PlayerInventory::CanEquipItem
PlayerInventory::CanEquipParachute
PlayerInventory::CanMoveItemsFrom
PlayerInventory::CanReplaceBackpack
PlayerInventory::CanStoreInInventory
PlayerInventory::CanWearItem
PlayerInventory::CanWearItem
PlayerInventory::GetIdealPickupContainer
PlayerInventory::OnClothingChanged
PlayerInventory::OnContentsDirty
PlayerInventory::OnItemRemoved
TerrainPath::DungeonBaseLinks
WantedPoster::imageCrc
WantedPoster::playerId
WantedPoster::playerName
2024-03-05 07:03:06 +01:00
Substrata1 2d8550b32e Expose LegacyShelter::lastInteractedWithDoor 2024-03-05 07:01:39 +01:00
Substrata1 dcfb09521a Add OnPlayerDig hook
- object OnPlayerDig(BasePlayer player, BaseDiggableEntity entity)
2024-03-05 07:00:29 +01:00
TurEduard b944a3f0cb Add OnBackpackDrop hook
- object OnBackpackDrop(Item backpack, PlayerInventory inventory)
2024-03-05 07:00:29 +01:00
Aspect 858efeba11 Add plugin memory usage to o.plugins command 2024-02-21 23:11:23 +01:00
Mr. Blue a170dd74d9 Add docs export to GitHub release action 2024-02-21 23:10:26 +01:00
Mr. Blue 8eeaa192c3 Patch for February 6th Rust update (Protocol 2519.246.1) 2024-02-06 16:27:14 +01:00
Mr. Blue c13a2feb4d Patch for February 1st Rust update (Protocol 2519.246.1) 2024-02-01 19:22:25 +01:00
Substrata1 d2224ad033 Add OnPatrolHelicopterKill hook
object OnPatrolHelicopterKill(PatrolHelicopter heli, HitInfo hitInfo)
2024-01-29 07:22:54 +01:00
Vlad-00003 ff9fab015f Add OnCoalingTowerGather and OnCoalingTowerStart hooks
- void OnCoalingTowerStart(CoalingTower tower, BasePlayer player)
- void OnCoalingTowerGather(CoalingTower tower, Item item)
2024-01-29 07:22:46 +01:00
Mr. Blue e1b72adca4 Patch for January 18th Rust update (Protocol 2516.245.1) 2024-01-18 16:56:14 +01:00
Mr. Blue f082f76d59 Patch for January 10th Rust update (Protocol 2516.245.1) 2024-01-10 14:44:31 +01:00
Mr. Blue feaa5b5415 Remove depreciated hook 2024-01-04 20:26:02 +01:00
Mr. Blue fcf74536ed Patch for January 4th Rust update (Protocol 2516.245.1) 2024-01-04 19:45:53 +01:00
Mr. Blue 9ddbd85d0c Patch for December 17th Rust update (Protocol 2515.244.1) 2023-12-17 13:38:49 +01:00
Mr. Blue a35199a2b3 Patch for December 16th Rust update (Protocol 2515.244.1) 2023-12-16 10:05:53 +01:00
Mr. Blue e86a2be083 Patch for December 8th Rust update (Protocol 2515.244.1) 2023-12-08 14:09:29 +01:00
Mr. Blue 88251c79e1 Expose UpdateMaxAuthCapacity and AtMaxAuthCapacity on SimplePrivilege 2023-12-07 20:53:19 +01:00
Mr. Blue 9b2487362c Patch for December 7th Rust update (Protocol 2515.244.1) 2023-12-07 19:44:27 +01:00
Mr. Blue a9e1e0dd4b Expose Signage::LogEdit 2023-12-06 05:24:32 +01:00
Mr. Blue acec4a7196 Add sourceConnection arg to OnSignalBroadcast hook 2023-12-06 04:46:35 +01:00
Mr. Blue 45c6031556 Fix covalence chat commands not working 2023-12-06 00:30:13 +01:00
Mr. Blue 90e1b26205 Expose puttingDistance and maxOrbitDuration on PatrolHelicopterAI 2023-12-05 11:17:42 +01:00
Nikolay 66fa35a665 Expose _processQueues and _processQueueProfilerString for IOEntity 2023-12-05 11:14:37 +01:00
WhiteThunder 98619a0eaf Add CanLockerAcceptItem hook
- Expose various Locker fields/methods
2023-12-05 11:14:31 +01:00
Mr. Blue ec024407a9 Implement chat command prefix config 2023-12-05 10:55:34 +01:00
Mr. Blue f5eaa19333 Patch for November 28th Rust update (Protocol 2511.243.1) 2023-11-28 11:10:20 +01:00
Mr. Blue f58c4c88fc Patch for November 2nd Rust update (Protocol 2511.243.1) 2023-11-02 19:25:18 +01:00
WhiteThunder 178327f49c Expose various fields/methods as public 2023-10-29 13:25:52 -07:00
Mr. Blue abad49671a Patch for October 23rd Rust update (Protocol 2509.242.1) 2023-10-23 22:31:28 +02:00
Substrata1 d7a9ef8284 Add OnPatrolHelicopterTakeDamage hook
object OnPatrolHelicopterTakeDamage(PatrolHelicopter heli, HitInfo hitinfo)
2023-10-23 04:39:48 +02:00
shooter46 3d6191e3e2 Add Halloween event hooks
OnEventCollectablePickup
OnHuntEventStart
OnHuntEventEnd
expose EggHuntEvent::_eggHunters
2023-10-23 04:39:48 +02:00
Mr. Blue 6517ff6ca2 Add InterferenceUpdate hooks
OnInterferenceUpdate(AutoTurret turret)
OnInterferenceOthersUpdate(AutoTurret turret)
2023-10-11 06:22:59 +02:00
Mr. Blue 0948b2ea08 Fix incorrect CanBeTargeted hook argument 2023-10-11 05:26:21 +02:00
Mr. Blue cfa50f5613 Update DepotDownloader url 2023-10-11 05:23:29 +02:00
Mr. Blue 7f18c8c01d Move build logic to actions repo 2023-10-09 17:03:46 +02:00
Mr. Blue c063b66150 Patch for October 5th Rust update (Protocol 2508.242.1) 2 2023-10-05 19:54:01 +02:00
Mr. Blue 1e908a3793 Patch for October 5th Rust update (Protocol 2508.242.1) 2023-10-05 19:22:10 +02:00
10 changed files with 3617 additions and 838 deletions

View File

@ -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

View File

@ -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

View File

@ -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

1
.gitignore vendored
View File

@ -21,6 +21,7 @@ TestResult.xml
*.nupkg
**/packages/*
**/tools/*
**/docs/*
!**/packages/build/
!**/packages/repositories.config

View File

@ -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>

View File

@ -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"

File diff suppressed because it is too large Load Diff

View File

@ -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) != ''">

View File

@ -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

View File

@ -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
}
}