Rust update

This commit is contained in:
Flero 2025-06-10 23:39:00 +09:30
parent c75afff785
commit 6825e8ae64
Signed by: flerouwu
SSH key fingerprint: SHA256:FB8cuclKIbQLfo1o/JNTq7r9e3vocaOu/vkEg+gViVU
6444 changed files with 643621 additions and 126047 deletions

54
.gitignore vendored Normal file
View file

@ -0,0 +1,54 @@
## A streamlined .gitignore for modern .NET projects
## including temporary files, build results, and
## files generated by popular .NET tools. If you are
## developing with Visual Studio, the VS .gitignore
## https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
## has more thorough IDE-specific entries.
##
## Get latest from https://github.com/github/gitignore/blob/main/Dotnet.gitignore
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# Others
~$*
*~
CodeCoverage/
# MSBuild Binary and Structured Log
*.binlog
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml

View file

@ -22,7 +22,7 @@
</ItemGroup>
<ItemGroup>
<Reference Include="System.Core">
<HintPath>../../System.Core.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/System.Core.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View file

@ -1,61 +0,0 @@
{
"format": 1,
"restore": {
"/media/archive/rust-decomp/decompiled/0Harmony/0Harmony.csproj": {}
},
"projects": {
"/media/archive/rust-decomp/decompiled/0Harmony/0Harmony.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/media/archive/rust-decomp/decompiled/0Harmony/0Harmony.csproj",
"projectName": "0Harmony",
"projectPath": "/media/archive/rust-decomp/decompiled/0Harmony/0Harmony.csproj",
"packagesPath": "/home/flerouwu/.nuget/packages/",
"outputPath": "/media/archive/rust-decomp/decompiled/0Harmony/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/home/flerouwu/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net48"
],
"sources": {
"https://api.nuget.org/v3/index.json": {},
"https://nuget.bepinex.dev/v3/index.json": {},
"https://pkgs.dev.azure.com/tgbots/Telegram.Bot/_packaging/release/nuget/v3/index.json": {}
},
"frameworks": {
"net48": {
"targetAlias": "net48",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "9.0.100"
},
"frameworks": {
"net48": {
"targetAlias": "net48",
"dependencies": {
"Microsoft.NETFramework.ReferenceAssemblies": {
"suppressParent": "All",
"target": "Package",
"version": "[1.0.3, )",
"autoReferenced": true
}
},
"runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.105/RuntimeIdentifierGraph.json"
}
}
}
}
}

View file

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/home/flerouwu/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/home/flerouwu/.nuget/packages/</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.13.2</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="/home/flerouwu/.nuget/packages/" />
</ItemGroup>
</Project>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)microsoft.netframework.referenceassemblies.net48/1.0.3/build/Microsoft.NETFramework.ReferenceAssemblies.net48.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.netframework.referenceassemblies.net48/1.0.3/build/Microsoft.NETFramework.ReferenceAssemblies.net48.targets')" />
</ImportGroup>
</Project>

View file

@ -1,4 +0,0 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View file

@ -1,8 +0,0 @@
is_global = true
build_property.RootNamespace =
build_property.ProjectDir = /media/archive/rust-decomp/decompiled/0Harmony/
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false
build_property.EffectiveAnalysisLevelStyle =
build_property.EnableCodeStyleSeverity =

View file

@ -1,473 +0,0 @@
{
"version": 3,
"targets": {
".NETFramework,Version=v4.8": {
"Microsoft.NETFramework.ReferenceAssemblies/1.0.3": {
"type": "package",
"dependencies": {
"Microsoft.NETFramework.ReferenceAssemblies.net48": "1.0.3"
}
},
"Microsoft.NETFramework.ReferenceAssemblies.net48/1.0.3": {
"type": "package",
"build": {
"build/Microsoft.NETFramework.ReferenceAssemblies.net48.targets": {}
}
}
}
},
"libraries": {
"Microsoft.NETFramework.ReferenceAssemblies/1.0.3": {
"sha512": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==",
"type": "package",
"path": "microsoft.netframework.referenceassemblies/1.0.3",
"files": [
".nupkg.metadata",
".signature.p7s",
"microsoft.netframework.referenceassemblies.1.0.3.nupkg.sha512",
"microsoft.netframework.referenceassemblies.nuspec"
]
},
"Microsoft.NETFramework.ReferenceAssemblies.net48/1.0.3": {
"sha512": "zMk4D+9zyiEWByyQ7oPImPN/Jhpj166Ky0Nlla4eXlNL8hI/BtSJsgR8Inldd4NNpIAH3oh8yym0W2DrhXdSLQ==",
"type": "package",
"path": "microsoft.netframework.referenceassemblies.net48/1.0.3",
"files": [
".nupkg.metadata",
".signature.p7s",
"build/.NETFramework/v4.8/Accessibility.dll",
"build/.NETFramework/v4.8/Accessibility.xml",
"build/.NETFramework/v4.8/CustomMarshalers.dll",
"build/.NETFramework/v4.8/CustomMarshalers.xml",
"build/.NETFramework/v4.8/Facades/Microsoft.Win32.Primitives.dll",
"build/.NETFramework/v4.8/Facades/System.AppContext.dll",
"build/.NETFramework/v4.8/Facades/System.Collections.Concurrent.dll",
"build/.NETFramework/v4.8/Facades/System.Collections.NonGeneric.dll",
"build/.NETFramework/v4.8/Facades/System.Collections.Specialized.dll",
"build/.NETFramework/v4.8/Facades/System.Collections.dll",
"build/.NETFramework/v4.8/Facades/System.ComponentModel.Annotations.dll",
"build/.NETFramework/v4.8/Facades/System.ComponentModel.EventBasedAsync.dll",
"build/.NETFramework/v4.8/Facades/System.ComponentModel.Primitives.dll",
"build/.NETFramework/v4.8/Facades/System.ComponentModel.TypeConverter.dll",
"build/.NETFramework/v4.8/Facades/System.ComponentModel.dll",
"build/.NETFramework/v4.8/Facades/System.Console.dll",
"build/.NETFramework/v4.8/Facades/System.Data.Common.dll",
"build/.NETFramework/v4.8/Facades/System.Diagnostics.Contracts.dll",
"build/.NETFramework/v4.8/Facades/System.Diagnostics.Debug.dll",
"build/.NETFramework/v4.8/Facades/System.Diagnostics.FileVersionInfo.dll",
"build/.NETFramework/v4.8/Facades/System.Diagnostics.Process.dll",
"build/.NETFramework/v4.8/Facades/System.Diagnostics.StackTrace.dll",
"build/.NETFramework/v4.8/Facades/System.Diagnostics.TextWriterTraceListener.dll",
"build/.NETFramework/v4.8/Facades/System.Diagnostics.Tools.dll",
"build/.NETFramework/v4.8/Facades/System.Diagnostics.TraceSource.dll",
"build/.NETFramework/v4.8/Facades/System.Drawing.Primitives.dll",
"build/.NETFramework/v4.8/Facades/System.Dynamic.Runtime.dll",
"build/.NETFramework/v4.8/Facades/System.Globalization.Calendars.dll",
"build/.NETFramework/v4.8/Facades/System.Globalization.Extensions.dll",
"build/.NETFramework/v4.8/Facades/System.Globalization.dll",
"build/.NETFramework/v4.8/Facades/System.IO.Compression.ZipFile.dll",
"build/.NETFramework/v4.8/Facades/System.IO.FileSystem.DriveInfo.dll",
"build/.NETFramework/v4.8/Facades/System.IO.FileSystem.Primitives.dll",
"build/.NETFramework/v4.8/Facades/System.IO.FileSystem.Watcher.dll",
"build/.NETFramework/v4.8/Facades/System.IO.FileSystem.dll",
"build/.NETFramework/v4.8/Facades/System.IO.IsolatedStorage.dll",
"build/.NETFramework/v4.8/Facades/System.IO.MemoryMappedFiles.dll",
"build/.NETFramework/v4.8/Facades/System.IO.Pipes.dll",
"build/.NETFramework/v4.8/Facades/System.IO.UnmanagedMemoryStream.dll",
"build/.NETFramework/v4.8/Facades/System.IO.dll",
"build/.NETFramework/v4.8/Facades/System.Linq.Expressions.dll",
"build/.NETFramework/v4.8/Facades/System.Linq.Parallel.dll",
"build/.NETFramework/v4.8/Facades/System.Linq.Queryable.dll",
"build/.NETFramework/v4.8/Facades/System.Linq.dll",
"build/.NETFramework/v4.8/Facades/System.Net.Http.Rtc.dll",
"build/.NETFramework/v4.8/Facades/System.Net.NameResolution.dll",
"build/.NETFramework/v4.8/Facades/System.Net.NetworkInformation.dll",
"build/.NETFramework/v4.8/Facades/System.Net.Ping.dll",
"build/.NETFramework/v4.8/Facades/System.Net.Primitives.dll",
"build/.NETFramework/v4.8/Facades/System.Net.Requests.dll",
"build/.NETFramework/v4.8/Facades/System.Net.Security.dll",
"build/.NETFramework/v4.8/Facades/System.Net.Sockets.dll",
"build/.NETFramework/v4.8/Facades/System.Net.WebHeaderCollection.dll",
"build/.NETFramework/v4.8/Facades/System.Net.WebSockets.Client.dll",
"build/.NETFramework/v4.8/Facades/System.Net.WebSockets.dll",
"build/.NETFramework/v4.8/Facades/System.ObjectModel.dll",
"build/.NETFramework/v4.8/Facades/System.Reflection.Emit.ILGeneration.dll",
"build/.NETFramework/v4.8/Facades/System.Reflection.Emit.Lightweight.dll",
"build/.NETFramework/v4.8/Facades/System.Reflection.Emit.dll",
"build/.NETFramework/v4.8/Facades/System.Reflection.Extensions.dll",
"build/.NETFramework/v4.8/Facades/System.Reflection.Primitives.dll",
"build/.NETFramework/v4.8/Facades/System.Reflection.dll",
"build/.NETFramework/v4.8/Facades/System.Resources.Reader.dll",
"build/.NETFramework/v4.8/Facades/System.Resources.ResourceManager.dll",
"build/.NETFramework/v4.8/Facades/System.Resources.Writer.dll",
"build/.NETFramework/v4.8/Facades/System.Runtime.CompilerServices.VisualC.dll",
"build/.NETFramework/v4.8/Facades/System.Runtime.Extensions.dll",
"build/.NETFramework/v4.8/Facades/System.Runtime.Handles.dll",
"build/.NETFramework/v4.8/Facades/System.Runtime.InteropServices.RuntimeInformation.dll",
"build/.NETFramework/v4.8/Facades/System.Runtime.InteropServices.WindowsRuntime.dll",
"build/.NETFramework/v4.8/Facades/System.Runtime.InteropServices.dll",
"build/.NETFramework/v4.8/Facades/System.Runtime.Numerics.dll",
"build/.NETFramework/v4.8/Facades/System.Runtime.Serialization.Formatters.dll",
"build/.NETFramework/v4.8/Facades/System.Runtime.Serialization.Json.dll",
"build/.NETFramework/v4.8/Facades/System.Runtime.Serialization.Primitives.dll",
"build/.NETFramework/v4.8/Facades/System.Runtime.Serialization.Xml.dll",
"build/.NETFramework/v4.8/Facades/System.Runtime.dll",
"build/.NETFramework/v4.8/Facades/System.Security.Claims.dll",
"build/.NETFramework/v4.8/Facades/System.Security.Cryptography.Algorithms.dll",
"build/.NETFramework/v4.8/Facades/System.Security.Cryptography.Csp.dll",
"build/.NETFramework/v4.8/Facades/System.Security.Cryptography.Encoding.dll",
"build/.NETFramework/v4.8/Facades/System.Security.Cryptography.Primitives.dll",
"build/.NETFramework/v4.8/Facades/System.Security.Cryptography.X509Certificates.dll",
"build/.NETFramework/v4.8/Facades/System.Security.Principal.dll",
"build/.NETFramework/v4.8/Facades/System.Security.SecureString.dll",
"build/.NETFramework/v4.8/Facades/System.ServiceModel.Duplex.dll",
"build/.NETFramework/v4.8/Facades/System.ServiceModel.Http.dll",
"build/.NETFramework/v4.8/Facades/System.ServiceModel.NetTcp.dll",
"build/.NETFramework/v4.8/Facades/System.ServiceModel.Primitives.dll",
"build/.NETFramework/v4.8/Facades/System.ServiceModel.Security.dll",
"build/.NETFramework/v4.8/Facades/System.Text.Encoding.Extensions.dll",
"build/.NETFramework/v4.8/Facades/System.Text.Encoding.dll",
"build/.NETFramework/v4.8/Facades/System.Text.RegularExpressions.dll",
"build/.NETFramework/v4.8/Facades/System.Threading.Overlapped.dll",
"build/.NETFramework/v4.8/Facades/System.Threading.Tasks.Parallel.dll",
"build/.NETFramework/v4.8/Facades/System.Threading.Tasks.dll",
"build/.NETFramework/v4.8/Facades/System.Threading.Thread.dll",
"build/.NETFramework/v4.8/Facades/System.Threading.ThreadPool.dll",
"build/.NETFramework/v4.8/Facades/System.Threading.Timer.dll",
"build/.NETFramework/v4.8/Facades/System.Threading.dll",
"build/.NETFramework/v4.8/Facades/System.ValueTuple.dll",
"build/.NETFramework/v4.8/Facades/System.Xml.ReaderWriter.dll",
"build/.NETFramework/v4.8/Facades/System.Xml.XDocument.dll",
"build/.NETFramework/v4.8/Facades/System.Xml.XPath.XDocument.dll",
"build/.NETFramework/v4.8/Facades/System.Xml.XPath.dll",
"build/.NETFramework/v4.8/Facades/System.Xml.XmlDocument.dll",
"build/.NETFramework/v4.8/Facades/System.Xml.XmlSerializer.dll",
"build/.NETFramework/v4.8/Facades/netstandard.dll",
"build/.NETFramework/v4.8/ISymWrapper.dll",
"build/.NETFramework/v4.8/ISymWrapper.xml",
"build/.NETFramework/v4.8/Microsoft.Activities.Build.dll",
"build/.NETFramework/v4.8/Microsoft.Activities.Build.xml",
"build/.NETFramework/v4.8/Microsoft.Build.Conversion.v4.0.dll",
"build/.NETFramework/v4.8/Microsoft.Build.Conversion.v4.0.xml",
"build/.NETFramework/v4.8/Microsoft.Build.Engine.dll",
"build/.NETFramework/v4.8/Microsoft.Build.Engine.xml",
"build/.NETFramework/v4.8/Microsoft.Build.Framework.dll",
"build/.NETFramework/v4.8/Microsoft.Build.Framework.xml",
"build/.NETFramework/v4.8/Microsoft.Build.Tasks.v4.0.dll",
"build/.NETFramework/v4.8/Microsoft.Build.Tasks.v4.0.xml",
"build/.NETFramework/v4.8/Microsoft.Build.Utilities.v4.0.dll",
"build/.NETFramework/v4.8/Microsoft.Build.Utilities.v4.0.xml",
"build/.NETFramework/v4.8/Microsoft.Build.dll",
"build/.NETFramework/v4.8/Microsoft.Build.xml",
"build/.NETFramework/v4.8/Microsoft.CSharp.dll",
"build/.NETFramework/v4.8/Microsoft.CSharp.xml",
"build/.NETFramework/v4.8/Microsoft.JScript.dll",
"build/.NETFramework/v4.8/Microsoft.JScript.xml",
"build/.NETFramework/v4.8/Microsoft.VisualBasic.Compatibility.Data.dll",
"build/.NETFramework/v4.8/Microsoft.VisualBasic.Compatibility.Data.xml",
"build/.NETFramework/v4.8/Microsoft.VisualBasic.Compatibility.dll",
"build/.NETFramework/v4.8/Microsoft.VisualBasic.Compatibility.xml",
"build/.NETFramework/v4.8/Microsoft.VisualBasic.dll",
"build/.NETFramework/v4.8/Microsoft.VisualBasic.xml",
"build/.NETFramework/v4.8/Microsoft.VisualC.STLCLR.dll",
"build/.NETFramework/v4.8/Microsoft.VisualC.STLCLR.xml",
"build/.NETFramework/v4.8/Microsoft.VisualC.dll",
"build/.NETFramework/v4.8/Microsoft.VisualC.xml",
"build/.NETFramework/v4.8/PermissionSets/FullTrust.xml",
"build/.NETFramework/v4.8/PermissionSets/Internet.xml",
"build/.NETFramework/v4.8/PermissionSets/LocalIntranet.xml",
"build/.NETFramework/v4.8/PresentationBuildTasks.dll",
"build/.NETFramework/v4.8/PresentationBuildTasks.xml",
"build/.NETFramework/v4.8/PresentationCore.dll",
"build/.NETFramework/v4.8/PresentationCore.xml",
"build/.NETFramework/v4.8/PresentationFramework.Aero.dll",
"build/.NETFramework/v4.8/PresentationFramework.Aero.xml",
"build/.NETFramework/v4.8/PresentationFramework.Aero2.dll",
"build/.NETFramework/v4.8/PresentationFramework.Aero2.xml",
"build/.NETFramework/v4.8/PresentationFramework.AeroLite.dll",
"build/.NETFramework/v4.8/PresentationFramework.AeroLite.xml",
"build/.NETFramework/v4.8/PresentationFramework.Classic.dll",
"build/.NETFramework/v4.8/PresentationFramework.Classic.xml",
"build/.NETFramework/v4.8/PresentationFramework.Luna.dll",
"build/.NETFramework/v4.8/PresentationFramework.Luna.xml",
"build/.NETFramework/v4.8/PresentationFramework.Royale.dll",
"build/.NETFramework/v4.8/PresentationFramework.Royale.xml",
"build/.NETFramework/v4.8/PresentationFramework.dll",
"build/.NETFramework/v4.8/PresentationFramework.xml",
"build/.NETFramework/v4.8/ReachFramework.dll",
"build/.NETFramework/v4.8/ReachFramework.xml",
"build/.NETFramework/v4.8/RedistList/FrameworkList.xml",
"build/.NETFramework/v4.8/System.Activities.Core.Presentation.dll",
"build/.NETFramework/v4.8/System.Activities.Core.Presentation.xml",
"build/.NETFramework/v4.8/System.Activities.DurableInstancing.dll",
"build/.NETFramework/v4.8/System.Activities.DurableInstancing.xml",
"build/.NETFramework/v4.8/System.Activities.Presentation.dll",
"build/.NETFramework/v4.8/System.Activities.Presentation.xml",
"build/.NETFramework/v4.8/System.Activities.dll",
"build/.NETFramework/v4.8/System.Activities.xml",
"build/.NETFramework/v4.8/System.AddIn.Contract.dll",
"build/.NETFramework/v4.8/System.AddIn.Contract.xml",
"build/.NETFramework/v4.8/System.AddIn.dll",
"build/.NETFramework/v4.8/System.AddIn.xml",
"build/.NETFramework/v4.8/System.ComponentModel.Composition.Registration.dll",
"build/.NETFramework/v4.8/System.ComponentModel.Composition.Registration.xml",
"build/.NETFramework/v4.8/System.ComponentModel.Composition.dll",
"build/.NETFramework/v4.8/System.ComponentModel.Composition.xml",
"build/.NETFramework/v4.8/System.ComponentModel.DataAnnotations.dll",
"build/.NETFramework/v4.8/System.ComponentModel.DataAnnotations.xml",
"build/.NETFramework/v4.8/System.Configuration.Install.dll",
"build/.NETFramework/v4.8/System.Configuration.Install.xml",
"build/.NETFramework/v4.8/System.Configuration.dll",
"build/.NETFramework/v4.8/System.Configuration.xml",
"build/.NETFramework/v4.8/System.Core.dll",
"build/.NETFramework/v4.8/System.Core.xml",
"build/.NETFramework/v4.8/System.Data.DataSetExtensions.dll",
"build/.NETFramework/v4.8/System.Data.DataSetExtensions.xml",
"build/.NETFramework/v4.8/System.Data.Entity.Design.dll",
"build/.NETFramework/v4.8/System.Data.Entity.Design.xml",
"build/.NETFramework/v4.8/System.Data.Entity.dll",
"build/.NETFramework/v4.8/System.Data.Entity.xml",
"build/.NETFramework/v4.8/System.Data.Linq.dll",
"build/.NETFramework/v4.8/System.Data.Linq.xml",
"build/.NETFramework/v4.8/System.Data.OracleClient.dll",
"build/.NETFramework/v4.8/System.Data.OracleClient.xml",
"build/.NETFramework/v4.8/System.Data.Services.Client.dll",
"build/.NETFramework/v4.8/System.Data.Services.Client.xml",
"build/.NETFramework/v4.8/System.Data.Services.Design.dll",
"build/.NETFramework/v4.8/System.Data.Services.Design.xml",
"build/.NETFramework/v4.8/System.Data.Services.dll",
"build/.NETFramework/v4.8/System.Data.Services.xml",
"build/.NETFramework/v4.8/System.Data.SqlXml.dll",
"build/.NETFramework/v4.8/System.Data.SqlXml.xml",
"build/.NETFramework/v4.8/System.Data.dll",
"build/.NETFramework/v4.8/System.Data.xml",
"build/.NETFramework/v4.8/System.Deployment.dll",
"build/.NETFramework/v4.8/System.Deployment.xml",
"build/.NETFramework/v4.8/System.Design.dll",
"build/.NETFramework/v4.8/System.Design.xml",
"build/.NETFramework/v4.8/System.Device.dll",
"build/.NETFramework/v4.8/System.Device.xml",
"build/.NETFramework/v4.8/System.Diagnostics.Tracing.dll",
"build/.NETFramework/v4.8/System.Diagnostics.Tracing.xml",
"build/.NETFramework/v4.8/System.DirectoryServices.AccountManagement.dll",
"build/.NETFramework/v4.8/System.DirectoryServices.AccountManagement.xml",
"build/.NETFramework/v4.8/System.DirectoryServices.Protocols.dll",
"build/.NETFramework/v4.8/System.DirectoryServices.Protocols.xml",
"build/.NETFramework/v4.8/System.DirectoryServices.dll",
"build/.NETFramework/v4.8/System.DirectoryServices.xml",
"build/.NETFramework/v4.8/System.Drawing.Design.dll",
"build/.NETFramework/v4.8/System.Drawing.Design.xml",
"build/.NETFramework/v4.8/System.Drawing.dll",
"build/.NETFramework/v4.8/System.Drawing.xml",
"build/.NETFramework/v4.8/System.Dynamic.dll",
"build/.NETFramework/v4.8/System.EnterpriseServices.Thunk.dll",
"build/.NETFramework/v4.8/System.EnterpriseServices.Wrapper.dll",
"build/.NETFramework/v4.8/System.EnterpriseServices.dll",
"build/.NETFramework/v4.8/System.EnterpriseServices.xml",
"build/.NETFramework/v4.8/System.IO.Compression.FileSystem.dll",
"build/.NETFramework/v4.8/System.IO.Compression.FileSystem.xml",
"build/.NETFramework/v4.8/System.IO.Compression.dll",
"build/.NETFramework/v4.8/System.IO.Compression.xml",
"build/.NETFramework/v4.8/System.IO.Log.dll",
"build/.NETFramework/v4.8/System.IO.Log.xml",
"build/.NETFramework/v4.8/System.IdentityModel.Selectors.dll",
"build/.NETFramework/v4.8/System.IdentityModel.Selectors.xml",
"build/.NETFramework/v4.8/System.IdentityModel.Services.dll",
"build/.NETFramework/v4.8/System.IdentityModel.Services.xml",
"build/.NETFramework/v4.8/System.IdentityModel.dll",
"build/.NETFramework/v4.8/System.IdentityModel.xml",
"build/.NETFramework/v4.8/System.Linq.xml",
"build/.NETFramework/v4.8/System.Management.Instrumentation.dll",
"build/.NETFramework/v4.8/System.Management.Instrumentation.xml",
"build/.NETFramework/v4.8/System.Management.dll",
"build/.NETFramework/v4.8/System.Management.xml",
"build/.NETFramework/v4.8/System.Messaging.dll",
"build/.NETFramework/v4.8/System.Messaging.xml",
"build/.NETFramework/v4.8/System.Net.Http.WebRequest.dll",
"build/.NETFramework/v4.8/System.Net.Http.WebRequest.xml",
"build/.NETFramework/v4.8/System.Net.Http.dll",
"build/.NETFramework/v4.8/System.Net.Http.xml",
"build/.NETFramework/v4.8/System.Net.dll",
"build/.NETFramework/v4.8/System.Net.xml",
"build/.NETFramework/v4.8/System.Numerics.dll",
"build/.NETFramework/v4.8/System.Numerics.xml",
"build/.NETFramework/v4.8/System.Printing.dll",
"build/.NETFramework/v4.8/System.Printing.xml",
"build/.NETFramework/v4.8/System.Reflection.Context.dll",
"build/.NETFramework/v4.8/System.Reflection.Context.xml",
"build/.NETFramework/v4.8/System.Runtime.Caching.dll",
"build/.NETFramework/v4.8/System.Runtime.Caching.xml",
"build/.NETFramework/v4.8/System.Runtime.DurableInstancing.dll",
"build/.NETFramework/v4.8/System.Runtime.DurableInstancing.xml",
"build/.NETFramework/v4.8/System.Runtime.Remoting.dll",
"build/.NETFramework/v4.8/System.Runtime.Remoting.xml",
"build/.NETFramework/v4.8/System.Runtime.Serialization.Formatters.Soap.dll",
"build/.NETFramework/v4.8/System.Runtime.Serialization.Formatters.Soap.xml",
"build/.NETFramework/v4.8/System.Runtime.Serialization.dll",
"build/.NETFramework/v4.8/System.Runtime.Serialization.xml",
"build/.NETFramework/v4.8/System.Security.dll",
"build/.NETFramework/v4.8/System.Security.xml",
"build/.NETFramework/v4.8/System.ServiceModel.Activation.dll",
"build/.NETFramework/v4.8/System.ServiceModel.Activation.xml",
"build/.NETFramework/v4.8/System.ServiceModel.Activities.dll",
"build/.NETFramework/v4.8/System.ServiceModel.Activities.xml",
"build/.NETFramework/v4.8/System.ServiceModel.Channels.dll",
"build/.NETFramework/v4.8/System.ServiceModel.Channels.xml",
"build/.NETFramework/v4.8/System.ServiceModel.Discovery.dll",
"build/.NETFramework/v4.8/System.ServiceModel.Discovery.xml",
"build/.NETFramework/v4.8/System.ServiceModel.Routing.dll",
"build/.NETFramework/v4.8/System.ServiceModel.Routing.xml",
"build/.NETFramework/v4.8/System.ServiceModel.Web.dll",
"build/.NETFramework/v4.8/System.ServiceModel.Web.xml",
"build/.NETFramework/v4.8/System.ServiceModel.dll",
"build/.NETFramework/v4.8/System.ServiceModel.xml",
"build/.NETFramework/v4.8/System.ServiceProcess.dll",
"build/.NETFramework/v4.8/System.ServiceProcess.xml",
"build/.NETFramework/v4.8/System.Speech.dll",
"build/.NETFramework/v4.8/System.Speech.xml",
"build/.NETFramework/v4.8/System.Threading.Tasks.Dataflow.xml",
"build/.NETFramework/v4.8/System.Transactions.dll",
"build/.NETFramework/v4.8/System.Transactions.xml",
"build/.NETFramework/v4.8/System.Web.Abstractions.dll",
"build/.NETFramework/v4.8/System.Web.ApplicationServices.dll",
"build/.NETFramework/v4.8/System.Web.ApplicationServices.xml",
"build/.NETFramework/v4.8/System.Web.DataVisualization.Design.dll",
"build/.NETFramework/v4.8/System.Web.DataVisualization.dll",
"build/.NETFramework/v4.8/System.Web.DataVisualization.xml",
"build/.NETFramework/v4.8/System.Web.DynamicData.Design.dll",
"build/.NETFramework/v4.8/System.Web.DynamicData.Design.xml",
"build/.NETFramework/v4.8/System.Web.DynamicData.dll",
"build/.NETFramework/v4.8/System.Web.DynamicData.xml",
"build/.NETFramework/v4.8/System.Web.Entity.Design.dll",
"build/.NETFramework/v4.8/System.Web.Entity.Design.xml",
"build/.NETFramework/v4.8/System.Web.Entity.dll",
"build/.NETFramework/v4.8/System.Web.Entity.xml",
"build/.NETFramework/v4.8/System.Web.Extensions.Design.dll",
"build/.NETFramework/v4.8/System.Web.Extensions.Design.xml",
"build/.NETFramework/v4.8/System.Web.Extensions.dll",
"build/.NETFramework/v4.8/System.Web.Extensions.xml",
"build/.NETFramework/v4.8/System.Web.Mobile.dll",
"build/.NETFramework/v4.8/System.Web.Mobile.xml",
"build/.NETFramework/v4.8/System.Web.RegularExpressions.dll",
"build/.NETFramework/v4.8/System.Web.RegularExpressions.xml",
"build/.NETFramework/v4.8/System.Web.Routing.dll",
"build/.NETFramework/v4.8/System.Web.Services.dll",
"build/.NETFramework/v4.8/System.Web.Services.xml",
"build/.NETFramework/v4.8/System.Web.dll",
"build/.NETFramework/v4.8/System.Web.xml",
"build/.NETFramework/v4.8/System.Windows.Controls.Ribbon.dll",
"build/.NETFramework/v4.8/System.Windows.Controls.Ribbon.xml",
"build/.NETFramework/v4.8/System.Windows.Forms.DataVisualization.Design.dll",
"build/.NETFramework/v4.8/System.Windows.Forms.DataVisualization.dll",
"build/.NETFramework/v4.8/System.Windows.Forms.DataVisualization.xml",
"build/.NETFramework/v4.8/System.Windows.Forms.dll",
"build/.NETFramework/v4.8/System.Windows.Forms.xml",
"build/.NETFramework/v4.8/System.Windows.Input.Manipulations.dll",
"build/.NETFramework/v4.8/System.Windows.Input.Manipulations.xml",
"build/.NETFramework/v4.8/System.Windows.Presentation.dll",
"build/.NETFramework/v4.8/System.Windows.Presentation.xml",
"build/.NETFramework/v4.8/System.Windows.dll",
"build/.NETFramework/v4.8/System.Workflow.Activities.dll",
"build/.NETFramework/v4.8/System.Workflow.Activities.xml",
"build/.NETFramework/v4.8/System.Workflow.ComponentModel.dll",
"build/.NETFramework/v4.8/System.Workflow.ComponentModel.xml",
"build/.NETFramework/v4.8/System.Workflow.Runtime.dll",
"build/.NETFramework/v4.8/System.Workflow.Runtime.xml",
"build/.NETFramework/v4.8/System.WorkflowServices.dll",
"build/.NETFramework/v4.8/System.WorkflowServices.xml",
"build/.NETFramework/v4.8/System.Xaml.dll",
"build/.NETFramework/v4.8/System.Xaml.xml",
"build/.NETFramework/v4.8/System.Xml.Linq.dll",
"build/.NETFramework/v4.8/System.Xml.Linq.xml",
"build/.NETFramework/v4.8/System.Xml.Serialization.dll",
"build/.NETFramework/v4.8/System.Xml.dll",
"build/.NETFramework/v4.8/System.Xml.xml",
"build/.NETFramework/v4.8/System.dll",
"build/.NETFramework/v4.8/System.xml",
"build/.NETFramework/v4.8/UIAutomationClient.dll",
"build/.NETFramework/v4.8/UIAutomationClient.xml",
"build/.NETFramework/v4.8/UIAutomationClientsideProviders.dll",
"build/.NETFramework/v4.8/UIAutomationClientsideProviders.xml",
"build/.NETFramework/v4.8/UIAutomationProvider.dll",
"build/.NETFramework/v4.8/UIAutomationProvider.xml",
"build/.NETFramework/v4.8/UIAutomationTypes.dll",
"build/.NETFramework/v4.8/UIAutomationTypes.xml",
"build/.NETFramework/v4.8/WindowsBase.dll",
"build/.NETFramework/v4.8/WindowsBase.xml",
"build/.NETFramework/v4.8/WindowsFormsIntegration.dll",
"build/.NETFramework/v4.8/WindowsFormsIntegration.xml",
"build/.NETFramework/v4.8/XamlBuildTask.dll",
"build/.NETFramework/v4.8/XamlBuildTask.xml",
"build/.NETFramework/v4.8/mscorlib.dll",
"build/.NETFramework/v4.8/mscorlib.xml",
"build/.NETFramework/v4.8/namespaces.xml",
"build/.NETFramework/v4.8/sysglobl.dll",
"build/.NETFramework/v4.8/sysglobl.xml",
"build/Microsoft.NETFramework.ReferenceAssemblies.net48.targets",
"microsoft.netframework.referenceassemblies.net48.1.0.3.nupkg.sha512",
"microsoft.netframework.referenceassemblies.net48.nuspec"
]
}
},
"projectFileDependencyGroups": {
".NETFramework,Version=v4.8": [
"Microsoft.NETFramework.ReferenceAssemblies >= 1.0.3"
]
},
"packageFolders": {
"/home/flerouwu/.nuget/packages/": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/media/archive/rust-decomp/decompiled/0Harmony/0Harmony.csproj",
"projectName": "0Harmony",
"projectPath": "/media/archive/rust-decomp/decompiled/0Harmony/0Harmony.csproj",
"packagesPath": "/home/flerouwu/.nuget/packages/",
"outputPath": "/media/archive/rust-decomp/decompiled/0Harmony/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/home/flerouwu/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net48"
],
"sources": {
"https://api.nuget.org/v3/index.json": {},
"https://nuget.bepinex.dev/v3/index.json": {},
"https://pkgs.dev.azure.com/tgbots/Telegram.Bot/_packaging/release/nuget/v3/index.json": {}
},
"frameworks": {
"net48": {
"targetAlias": "net48",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "9.0.100"
},
"frameworks": {
"net48": {
"targetAlias": "net48",
"dependencies": {
"Microsoft.NETFramework.ReferenceAssemblies": {
"suppressParent": "All",
"target": "Package",
"version": "[1.0.3, )",
"autoReferenced": true
}
},
"runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.105/RuntimeIdentifierGraph.json"
}
}
}
}

View file

@ -1,11 +0,0 @@
{
"version": 2,
"dgSpecHash": "1BZAi1vHgeQ=",
"success": true,
"projectFilePath": "/media/archive/rust-decomp/decompiled/0Harmony/0Harmony.csproj",
"expectedPackageFiles": [
"/home/flerouwu/.nuget/packages/microsoft.netframework.referenceassemblies/1.0.3/microsoft.netframework.referenceassemblies.1.0.3.nupkg.sha512",
"/home/flerouwu/.nuget/packages/microsoft.netframework.referenceassemblies.net48/1.0.3/microsoft.netframework.referenceassemblies.net48.1.0.3.nupkg.sha512"
],
"logs": []
}

View file

@ -1 +0,0 @@
"restore":{"projectUniqueName":"/media/archive/rust-decomp/decompiled/0Harmony/0Harmony.csproj","projectName":"0Harmony","projectPath":"/media/archive/rust-decomp/decompiled/0Harmony/0Harmony.csproj","outputPath":"/media/archive/rust-decomp/decompiled/0Harmony/obj/","projectStyle":"PackageReference","originalTargetFrameworks":["net48"],"sources":{"https://api.nuget.org/v3/index.json":{},"https://nuget.bepinex.dev/v3/index.json":{},"https://pkgs.dev.azure.com/tgbots/Telegram.Bot/_packaging/release/nuget/v3/index.json":{}},"frameworks":{"net48":{"targetAlias":"net48","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.100"}"frameworks":{"net48":{"targetAlias":"net48","dependencies":{"Microsoft.NETFramework.ReferenceAssemblies":{"suppressParent":"All","target":"Package","version":"[1.0.3, )","autoReferenced":true}},"runtimeIdentifierGraphPath":"/usr/share/dotnet/sdk/9.0.105/RuntimeIdentifierGraph.json"}}

View file

@ -1 +0,0 @@
17469724714848314

View file

@ -1 +0,0 @@
17469724714848314

View file

@ -13,49 +13,49 @@
<ItemGroup />
<ItemGroup>
<Reference Include="Facepunch.UnityEngine">
<HintPath>../../Facepunch.UnityEngine.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>../../UnityEngine.UI.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Rust.UI">
<HintPath>../../Rust.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>../../UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>../../UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="Facepunch.System">
<HintPath>../../Facepunch.System.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.UI.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>../../Unity.TextMeshPro.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="Facepunch.System">
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.System.dll</HintPath>
</Reference>
<Reference Include="System.Xml">
<HintPath>../../System.Xml.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/System.Xml.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>../../UnityEngine.AudioModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ParticleSystemModule">
<HintPath>../../UnityEngine.ParticleSystemModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.ParticleSystemModule.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Network">
<HintPath>../../Facepunch.Network.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Network.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Unity">
<HintPath>../../Facepunch.Unity.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Unity.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Input">
<HintPath>../../Facepunch.Input.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Input.dll</HintPath>
</Reference>
<Reference Include="System.Core">
<HintPath>../../System.Core.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/System.Core.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.JSONSerializeModule">
<HintPath>../../UnityEngine.JSONSerializeModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.JSONSerializeModule.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View file

@ -83,4 +83,20 @@ public static class KeyCombos
}
return false;
}
public static string FormatHeldKeys(IReadOnlyList<string> heldKeys)
{
if (heldKeys == null || heldKeys.Count == 0)
{
return null;
}
if (heldKeys.Count > 1)
{
IEnumerable<string> values = from k in heldKeys
select k.ToLowerInvariant() into k
select (!k.StartsWith("alpha")) ? k : k.Replace("alpha", "");
return "[" + string.Join("+", values) + "]";
}
return heldKeys[0];
}
}

View file

@ -1,4 +1,5 @@
using Rust.UI;
using TMPro;
using UnityEngine.UI;
public class HudMenuInput : ListComponent<HudMenuInput>
@ -7,6 +8,8 @@ public class HudMenuInput : ListComponent<HudMenuInput>
private RustInput rustInput;
private TMP_InputField tmpInputField;
public static bool AnyActive()
{
for (int i = 0; i < ListComponent<HudMenuInput>.InstanceList.Count; i++)
@ -23,6 +26,7 @@ public class HudMenuInput : ListComponent<HudMenuInput>
{
inputField = GetComponent<InputField>();
rustInput = GetComponent<RustInput>();
tmpInputField = GetComponent<TMP_InputField>();
}
private bool IsCurrentlyActive()
@ -31,6 +35,10 @@ public class HudMenuInput : ListComponent<HudMenuInput>
{
return false;
}
if (tmpInputField != null)
{
return tmpInputField.isFocused;
}
if (rustInput != null)
{
return rustInput.IsFocused;

View file

@ -1,61 +0,0 @@
{
"format": 1,
"restore": {
"/media/archive/rust-decomp/decompiled/Assembly-CSharp-firstpass/Assembly-CSharp-firstpass.csproj": {}
},
"projects": {
"/media/archive/rust-decomp/decompiled/Assembly-CSharp-firstpass/Assembly-CSharp-firstpass.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/media/archive/rust-decomp/decompiled/Assembly-CSharp-firstpass/Assembly-CSharp-firstpass.csproj",
"projectName": "Assembly-CSharp-firstpass",
"projectPath": "/media/archive/rust-decomp/decompiled/Assembly-CSharp-firstpass/Assembly-CSharp-firstpass.csproj",
"packagesPath": "/home/flerouwu/.nuget/packages/",
"outputPath": "/media/archive/rust-decomp/decompiled/Assembly-CSharp-firstpass/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/home/flerouwu/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net40"
],
"sources": {
"https://api.nuget.org/v3/index.json": {},
"https://nuget.bepinex.dev/v3/index.json": {},
"https://pkgs.dev.azure.com/tgbots/Telegram.Bot/_packaging/release/nuget/v3/index.json": {}
},
"frameworks": {
"net40": {
"targetAlias": "net40",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "9.0.100"
},
"frameworks": {
"net40": {
"targetAlias": "net40",
"dependencies": {
"Microsoft.NETFramework.ReferenceAssemblies": {
"suppressParent": "All",
"target": "Package",
"version": "[1.0.3, )",
"autoReferenced": true
}
},
"runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.105/RuntimeIdentifierGraph.json"
}
}
}
}
}

View file

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/home/flerouwu/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/home/flerouwu/.nuget/packages/</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.13.2</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="/home/flerouwu/.nuget/packages/" />
</ItemGroup>
</Project>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)microsoft.netframework.referenceassemblies.net40/1.0.3/build/Microsoft.NETFramework.ReferenceAssemblies.net40.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.netframework.referenceassemblies.net40/1.0.3/build/Microsoft.NETFramework.ReferenceAssemblies.net40.targets')" />
</ImportGroup>
</Project>

View file

@ -1,4 +0,0 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]

View file

@ -1,8 +0,0 @@
is_global = true
build_property.RootNamespace = Assembly-CSharp-firstpass
build_property.ProjectDir = /media/archive/rust-decomp/decompiled/Assembly-CSharp-firstpass/
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false
build_property.EffectiveAnalysisLevelStyle =
build_property.EnableCodeStyleSeverity =

View file

@ -1,503 +0,0 @@
{
"version": 3,
"targets": {
".NETFramework,Version=v4.0": {
"Microsoft.NETFramework.ReferenceAssemblies/1.0.3": {
"type": "package",
"dependencies": {
"Microsoft.NETFramework.ReferenceAssemblies.net40": "1.0.3"
}
},
"Microsoft.NETFramework.ReferenceAssemblies.net40/1.0.3": {
"type": "package",
"build": {
"build/Microsoft.NETFramework.ReferenceAssemblies.net40.targets": {}
}
}
}
},
"libraries": {
"Microsoft.NETFramework.ReferenceAssemblies/1.0.3": {
"sha512": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==",
"type": "package",
"path": "microsoft.netframework.referenceassemblies/1.0.3",
"files": [
".nupkg.metadata",
".signature.p7s",
"microsoft.netframework.referenceassemblies.1.0.3.nupkg.sha512",
"microsoft.netframework.referenceassemblies.nuspec"
]
},
"Microsoft.NETFramework.ReferenceAssemblies.net40/1.0.3": {
"sha512": "3ctXnCpHdoYJNH9ATfXKwckkkdHvHc1Xls12QB9kf1tjh3b+VzxtiwpkZN4GxOawakfH6CJAkqhlDKSiz6Ujbg==",
"type": "package",
"path": "microsoft.netframework.referenceassemblies.net40/1.0.3",
"files": [
".nupkg.metadata",
".signature.p7s",
"build/.NETFramework/v4.0/Accessibility.dll",
"build/.NETFramework/v4.0/Accessibility.xml",
"build/.NETFramework/v4.0/CustomMarshalers.dll",
"build/.NETFramework/v4.0/CustomMarshalers.xml",
"build/.NETFramework/v4.0/ISymWrapper.dll",
"build/.NETFramework/v4.0/ISymWrapper.xml",
"build/.NETFramework/v4.0/Microsoft.Build.Conversion.v4.0.dll",
"build/.NETFramework/v4.0/Microsoft.Build.Conversion.v4.0.xml",
"build/.NETFramework/v4.0/Microsoft.Build.Engine.dll",
"build/.NETFramework/v4.0/Microsoft.Build.Engine.xml",
"build/.NETFramework/v4.0/Microsoft.Build.Framework.dll",
"build/.NETFramework/v4.0/Microsoft.Build.Framework.xml",
"build/.NETFramework/v4.0/Microsoft.Build.Tasks.v4.0.dll",
"build/.NETFramework/v4.0/Microsoft.Build.Tasks.v4.0.xml",
"build/.NETFramework/v4.0/Microsoft.Build.Utilities.v4.0.dll",
"build/.NETFramework/v4.0/Microsoft.Build.Utilities.v4.0.xml",
"build/.NETFramework/v4.0/Microsoft.Build.dll",
"build/.NETFramework/v4.0/Microsoft.Build.xml",
"build/.NETFramework/v4.0/Microsoft.CSharp.dll",
"build/.NETFramework/v4.0/Microsoft.CSharp.xml",
"build/.NETFramework/v4.0/Microsoft.JScript.dll",
"build/.NETFramework/v4.0/Microsoft.JScript.xml",
"build/.NETFramework/v4.0/Microsoft.VisualBasic.Compatibility.Data.dll",
"build/.NETFramework/v4.0/Microsoft.VisualBasic.Compatibility.Data.xml",
"build/.NETFramework/v4.0/Microsoft.VisualBasic.Compatibility.dll",
"build/.NETFramework/v4.0/Microsoft.VisualBasic.Compatibility.xml",
"build/.NETFramework/v4.0/Microsoft.VisualBasic.dll",
"build/.NETFramework/v4.0/Microsoft.VisualBasic.xml",
"build/.NETFramework/v4.0/Microsoft.VisualC.STLCLR.dll",
"build/.NETFramework/v4.0/Microsoft.VisualC.STLCLR.xml",
"build/.NETFramework/v4.0/Microsoft.VisualC.dll",
"build/.NETFramework/v4.0/Microsoft.VisualC.xml",
"build/.NETFramework/v4.0/PermissionSets/FullTrust.xml",
"build/.NETFramework/v4.0/PermissionSets/Internet.xml",
"build/.NETFramework/v4.0/PermissionSets/LocalIntranet.xml",
"build/.NETFramework/v4.0/PresentationBuildTasks.dll",
"build/.NETFramework/v4.0/PresentationBuildTasks.xml",
"build/.NETFramework/v4.0/PresentationCore.dll",
"build/.NETFramework/v4.0/PresentationCore.xml",
"build/.NETFramework/v4.0/PresentationFramework.Aero.dll",
"build/.NETFramework/v4.0/PresentationFramework.Aero.xml",
"build/.NETFramework/v4.0/PresentationFramework.Classic.dll",
"build/.NETFramework/v4.0/PresentationFramework.Classic.xml",
"build/.NETFramework/v4.0/PresentationFramework.Luna.dll",
"build/.NETFramework/v4.0/PresentationFramework.Luna.xml",
"build/.NETFramework/v4.0/PresentationFramework.Royale.dll",
"build/.NETFramework/v4.0/PresentationFramework.Royale.xml",
"build/.NETFramework/v4.0/PresentationFramework.dll",
"build/.NETFramework/v4.0/PresentationFramework.xml",
"build/.NETFramework/v4.0/Profile/Client/Accessibility.dll",
"build/.NETFramework/v4.0/Profile/Client/Accessibility.xml",
"build/.NETFramework/v4.0/Profile/Client/CustomMarshalers.dll",
"build/.NETFramework/v4.0/Profile/Client/CustomMarshalers.xml",
"build/.NETFramework/v4.0/Profile/Client/Microsoft.CSharp.dll",
"build/.NETFramework/v4.0/Profile/Client/Microsoft.CSharp.xml",
"build/.NETFramework/v4.0/Profile/Client/Microsoft.JScript.dll",
"build/.NETFramework/v4.0/Profile/Client/Microsoft.JScript.xml",
"build/.NETFramework/v4.0/Profile/Client/Microsoft.VisualBasic.Compatibility.Data.dll",
"build/.NETFramework/v4.0/Profile/Client/Microsoft.VisualBasic.Compatibility.Data.xml",
"build/.NETFramework/v4.0/Profile/Client/Microsoft.VisualBasic.Compatibility.dll",
"build/.NETFramework/v4.0/Profile/Client/Microsoft.VisualBasic.Compatibility.xml",
"build/.NETFramework/v4.0/Profile/Client/Microsoft.VisualBasic.dll",
"build/.NETFramework/v4.0/Profile/Client/Microsoft.VisualBasic.xml",
"build/.NETFramework/v4.0/Profile/Client/Microsoft.VisualC.dll",
"build/.NETFramework/v4.0/Profile/Client/Microsoft.VisualC.xml",
"build/.NETFramework/v4.0/Profile/Client/PermissionSets/FullTrust.xml",
"build/.NETFramework/v4.0/Profile/Client/PermissionSets/Internet.xml",
"build/.NETFramework/v4.0/Profile/Client/PermissionSets/LocalIntranet.xml",
"build/.NETFramework/v4.0/Profile/Client/PresentationCore.dll",
"build/.NETFramework/v4.0/Profile/Client/PresentationCore.xml",
"build/.NETFramework/v4.0/Profile/Client/PresentationFramework.Aero.dll",
"build/.NETFramework/v4.0/Profile/Client/PresentationFramework.Aero.xml",
"build/.NETFramework/v4.0/Profile/Client/PresentationFramework.Classic.dll",
"build/.NETFramework/v4.0/Profile/Client/PresentationFramework.Classic.xml",
"build/.NETFramework/v4.0/Profile/Client/PresentationFramework.Luna.dll",
"build/.NETFramework/v4.0/Profile/Client/PresentationFramework.Luna.xml",
"build/.NETFramework/v4.0/Profile/Client/PresentationFramework.Royale.dll",
"build/.NETFramework/v4.0/Profile/Client/PresentationFramework.Royale.xml",
"build/.NETFramework/v4.0/Profile/Client/PresentationFramework.dll",
"build/.NETFramework/v4.0/Profile/Client/PresentationFramework.xml",
"build/.NETFramework/v4.0/Profile/Client/ReachFramework.dll",
"build/.NETFramework/v4.0/Profile/Client/ReachFramework.xml",
"build/.NETFramework/v4.0/Profile/Client/RedistList/FrameworkList.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Activities.Core.Presentation.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Activities.Core.Presentation.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Activities.DurableInstancing.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Activities.DurableInstancing.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Activities.Presentation.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Activities.Presentation.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Activities.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Activities.xml",
"build/.NETFramework/v4.0/Profile/Client/System.AddIn.Contract.xml",
"build/.NETFramework/v4.0/Profile/Client/System.AddIn.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Addin.Contract.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Addin.dll",
"build/.NETFramework/v4.0/Profile/Client/System.ComponentModel.Composition.dll",
"build/.NETFramework/v4.0/Profile/Client/System.ComponentModel.Composition.xml",
"build/.NETFramework/v4.0/Profile/Client/System.ComponentModel.DataAnnotations.dll",
"build/.NETFramework/v4.0/Profile/Client/System.ComponentModel.DataAnnotations.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Configuration.Install.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Configuration.Install.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Configuration.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Configuration.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Core.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Core.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Data.DataSetExtensions.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Data.DataSetExtensions.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Data.Entity.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Data.Entity.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Data.Linq.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Data.Linq.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Data.Services.Client.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Data.Services.Client.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Data.SqlXml.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Data.SqlXml.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Data.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Data.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Deployment.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Deployment.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Device.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Device.xml",
"build/.NETFramework/v4.0/Profile/Client/System.DirectoryServices.AccountManagement.dll",
"build/.NETFramework/v4.0/Profile/Client/System.DirectoryServices.AccountManagement.xml",
"build/.NETFramework/v4.0/Profile/Client/System.DirectoryServices.Protocols.dll",
"build/.NETFramework/v4.0/Profile/Client/System.DirectoryServices.Protocols.xml",
"build/.NETFramework/v4.0/Profile/Client/System.DirectoryServices.dll",
"build/.NETFramework/v4.0/Profile/Client/System.DirectoryServices.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Drawing.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Drawing.xml",
"build/.NETFramework/v4.0/Profile/Client/System.EnterpriseServices.Thunk.dll",
"build/.NETFramework/v4.0/Profile/Client/System.EnterpriseServices.Wrapper.dll",
"build/.NETFramework/v4.0/Profile/Client/System.EnterpriseServices.dll",
"build/.NETFramework/v4.0/Profile/Client/System.EnterpriseServices.xml",
"build/.NETFramework/v4.0/Profile/Client/System.IO.Log.dll",
"build/.NETFramework/v4.0/Profile/Client/System.IO.Log.xml",
"build/.NETFramework/v4.0/Profile/Client/System.IdentityModel.Selectors.dll",
"build/.NETFramework/v4.0/Profile/Client/System.IdentityModel.Selectors.xml",
"build/.NETFramework/v4.0/Profile/Client/System.IdentityModel.dll",
"build/.NETFramework/v4.0/Profile/Client/System.IdentityModel.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Management.Instrumentation.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Management.Instrumentation.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Management.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Management.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Messaging.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Messaging.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Net.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Net.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Numerics.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Numerics.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Printing.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Printing.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Runtime.DurableInstancing.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Runtime.DurableInstancing.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Runtime.Remoting.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Runtime.Remoting.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Runtime.Serialization.Formatters.Soap.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Runtime.Serialization.Formatters.Soap.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Runtime.Serialization.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Runtime.Serialization.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Security.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Security.xml",
"build/.NETFramework/v4.0/Profile/Client/System.ServiceModel.Activities.dll",
"build/.NETFramework/v4.0/Profile/Client/System.ServiceModel.Activities.xml",
"build/.NETFramework/v4.0/Profile/Client/System.ServiceModel.Channels.dll",
"build/.NETFramework/v4.0/Profile/Client/System.ServiceModel.Channels.xml",
"build/.NETFramework/v4.0/Profile/Client/System.ServiceModel.Discovery.dll",
"build/.NETFramework/v4.0/Profile/Client/System.ServiceModel.Discovery.xml",
"build/.NETFramework/v4.0/Profile/Client/System.ServiceModel.Routing.dll",
"build/.NETFramework/v4.0/Profile/Client/System.ServiceModel.Routing.xml",
"build/.NETFramework/v4.0/Profile/Client/System.ServiceModel.dll",
"build/.NETFramework/v4.0/Profile/Client/System.ServiceModel.xml",
"build/.NETFramework/v4.0/Profile/Client/System.ServiceProcess.dll",
"build/.NETFramework/v4.0/Profile/Client/System.ServiceProcess.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Speech.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Speech.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Transactions.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Transactions.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Web.ApplicationServices.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Web.ApplicationServices.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Web.Services.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Web.Services.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Windows.Forms.DataVisualization.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Windows.Forms.DataVisualization.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Windows.Forms.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Windows.Forms.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Windows.Input.Manipulations.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Windows.Input.Manipulations.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Windows.Presentation.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Windows.Presentation.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Xaml.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Xaml.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Xml.Linq.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Xml.Linq.xml",
"build/.NETFramework/v4.0/Profile/Client/System.Xml.dll",
"build/.NETFramework/v4.0/Profile/Client/System.Xml.xml",
"build/.NETFramework/v4.0/Profile/Client/System.dll",
"build/.NETFramework/v4.0/Profile/Client/System.xml",
"build/.NETFramework/v4.0/Profile/Client/UIAutomationClient.dll",
"build/.NETFramework/v4.0/Profile/Client/UIAutomationClient.xml",
"build/.NETFramework/v4.0/Profile/Client/UIAutomationClientsideProviders.dll",
"build/.NETFramework/v4.0/Profile/Client/UIAutomationClientsideProviders.xml",
"build/.NETFramework/v4.0/Profile/Client/UIAutomationProvider.dll",
"build/.NETFramework/v4.0/Profile/Client/UIAutomationProvider.xml",
"build/.NETFramework/v4.0/Profile/Client/UIAutomationTypes.dll",
"build/.NETFramework/v4.0/Profile/Client/UIAutomationTypes.xml",
"build/.NETFramework/v4.0/Profile/Client/WindowsBase.dll",
"build/.NETFramework/v4.0/Profile/Client/WindowsBase.xml",
"build/.NETFramework/v4.0/Profile/Client/WindowsFormsIntegration.dll",
"build/.NETFramework/v4.0/Profile/Client/WindowsFormsIntegration.xml",
"build/.NETFramework/v4.0/Profile/Client/mscorlib.dll",
"build/.NETFramework/v4.0/Profile/Client/mscorlib.xml",
"build/.NETFramework/v4.0/Profile/Client/sysglobl.dll",
"build/.NETFramework/v4.0/Profile/Client/sysglobl.xml",
"build/.NETFramework/v4.0/ReachFramework.dll",
"build/.NETFramework/v4.0/ReachFramework.xml",
"build/.NETFramework/v4.0/RedistList/FrameworkList.xml",
"build/.NETFramework/v4.0/System.Activities.Core.Presentation.dll",
"build/.NETFramework/v4.0/System.Activities.Core.Presentation.xml",
"build/.NETFramework/v4.0/System.Activities.DurableInstancing.dll",
"build/.NETFramework/v4.0/System.Activities.DurableInstancing.xml",
"build/.NETFramework/v4.0/System.Activities.Presentation.dll",
"build/.NETFramework/v4.0/System.Activities.Presentation.xml",
"build/.NETFramework/v4.0/System.Activities.dll",
"build/.NETFramework/v4.0/System.Activities.xml",
"build/.NETFramework/v4.0/System.AddIn.Contract.dll",
"build/.NETFramework/v4.0/System.AddIn.Contract.xml",
"build/.NETFramework/v4.0/System.AddIn.dll",
"build/.NETFramework/v4.0/System.AddIn.xml",
"build/.NETFramework/v4.0/System.ComponentModel.Composition.dll",
"build/.NETFramework/v4.0/System.ComponentModel.Composition.xml",
"build/.NETFramework/v4.0/System.ComponentModel.DataAnnotations.dll",
"build/.NETFramework/v4.0/System.ComponentModel.DataAnnotations.xml",
"build/.NETFramework/v4.0/System.Configuration.Install.dll",
"build/.NETFramework/v4.0/System.Configuration.Install.xml",
"build/.NETFramework/v4.0/System.Configuration.dll",
"build/.NETFramework/v4.0/System.Configuration.xml",
"build/.NETFramework/v4.0/System.Core.dll",
"build/.NETFramework/v4.0/System.Core.xml",
"build/.NETFramework/v4.0/System.Data.DataSetExtensions.dll",
"build/.NETFramework/v4.0/System.Data.DataSetExtensions.xml",
"build/.NETFramework/v4.0/System.Data.Entity.Design.dll",
"build/.NETFramework/v4.0/System.Data.Entity.Design.xml",
"build/.NETFramework/v4.0/System.Data.Entity.dll",
"build/.NETFramework/v4.0/System.Data.Entity.xml",
"build/.NETFramework/v4.0/System.Data.Linq.dll",
"build/.NETFramework/v4.0/System.Data.Linq.xml",
"build/.NETFramework/v4.0/System.Data.OracleClient.dll",
"build/.NETFramework/v4.0/System.Data.OracleClient.xml",
"build/.NETFramework/v4.0/System.Data.Services.Client.dll",
"build/.NETFramework/v4.0/System.Data.Services.Client.xml",
"build/.NETFramework/v4.0/System.Data.Services.Design.dll",
"build/.NETFramework/v4.0/System.Data.Services.Design.xml",
"build/.NETFramework/v4.0/System.Data.Services.dll",
"build/.NETFramework/v4.0/System.Data.Services.xml",
"build/.NETFramework/v4.0/System.Data.SqlXml.dll",
"build/.NETFramework/v4.0/System.Data.SqlXml.xml",
"build/.NETFramework/v4.0/System.Data.dll",
"build/.NETFramework/v4.0/System.Data.xml",
"build/.NETFramework/v4.0/System.Deployment.dll",
"build/.NETFramework/v4.0/System.Deployment.xml",
"build/.NETFramework/v4.0/System.Design.dll",
"build/.NETFramework/v4.0/System.Design.xml",
"build/.NETFramework/v4.0/System.Device.dll",
"build/.NETFramework/v4.0/System.Device.xml",
"build/.NETFramework/v4.0/System.DirectoryServices.AccountManagement.dll",
"build/.NETFramework/v4.0/System.DirectoryServices.AccountManagement.xml",
"build/.NETFramework/v4.0/System.DirectoryServices.Protocols.dll",
"build/.NETFramework/v4.0/System.DirectoryServices.Protocols.xml",
"build/.NETFramework/v4.0/System.DirectoryServices.dll",
"build/.NETFramework/v4.0/System.DirectoryServices.xml",
"build/.NETFramework/v4.0/System.Drawing.Design.dll",
"build/.NETFramework/v4.0/System.Drawing.Design.xml",
"build/.NETFramework/v4.0/System.Drawing.dll",
"build/.NETFramework/v4.0/System.Drawing.xml",
"build/.NETFramework/v4.0/System.EnterpriseServices.Thunk.dll",
"build/.NETFramework/v4.0/System.EnterpriseServices.Wrapper.dll",
"build/.NETFramework/v4.0/System.EnterpriseServices.dll",
"build/.NETFramework/v4.0/System.EnterpriseServices.xml",
"build/.NETFramework/v4.0/System.IO.Log.dll",
"build/.NETFramework/v4.0/System.IO.Log.xml",
"build/.NETFramework/v4.0/System.IdentityModel.Selectors.dll",
"build/.NETFramework/v4.0/System.IdentityModel.Selectors.xml",
"build/.NETFramework/v4.0/System.IdentityModel.dll",
"build/.NETFramework/v4.0/System.IdentityModel.xml",
"build/.NETFramework/v4.0/System.Management.Instrumentation.dll",
"build/.NETFramework/v4.0/System.Management.Instrumentation.xml",
"build/.NETFramework/v4.0/System.Management.dll",
"build/.NETFramework/v4.0/System.Management.xml",
"build/.NETFramework/v4.0/System.Messaging.dll",
"build/.NETFramework/v4.0/System.Messaging.xml",
"build/.NETFramework/v4.0/System.Net.dll",
"build/.NETFramework/v4.0/System.Net.xml",
"build/.NETFramework/v4.0/System.Numerics.dll",
"build/.NETFramework/v4.0/System.Numerics.xml",
"build/.NETFramework/v4.0/System.Printing.dll",
"build/.NETFramework/v4.0/System.Printing.xml",
"build/.NETFramework/v4.0/System.Runtime.Caching.dll",
"build/.NETFramework/v4.0/System.Runtime.Caching.xml",
"build/.NETFramework/v4.0/System.Runtime.DurableInstancing.dll",
"build/.NETFramework/v4.0/System.Runtime.DurableInstancing.xml",
"build/.NETFramework/v4.0/System.Runtime.Remoting.dll",
"build/.NETFramework/v4.0/System.Runtime.Remoting.xml",
"build/.NETFramework/v4.0/System.Runtime.Serialization.Formatters.Soap.dll",
"build/.NETFramework/v4.0/System.Runtime.Serialization.Formatters.Soap.xml",
"build/.NETFramework/v4.0/System.Runtime.Serialization.dll",
"build/.NETFramework/v4.0/System.Runtime.Serialization.xml",
"build/.NETFramework/v4.0/System.Security.dll",
"build/.NETFramework/v4.0/System.Security.xml",
"build/.NETFramework/v4.0/System.ServiceModel.Activation.dll",
"build/.NETFramework/v4.0/System.ServiceModel.Activation.xml",
"build/.NETFramework/v4.0/System.ServiceModel.Activities.dll",
"build/.NETFramework/v4.0/System.ServiceModel.Activities.xml",
"build/.NETFramework/v4.0/System.ServiceModel.Channels.dll",
"build/.NETFramework/v4.0/System.ServiceModel.Channels.xml",
"build/.NETFramework/v4.0/System.ServiceModel.Discovery.dll",
"build/.NETFramework/v4.0/System.ServiceModel.Discovery.xml",
"build/.NETFramework/v4.0/System.ServiceModel.Routing.dll",
"build/.NETFramework/v4.0/System.ServiceModel.Routing.xml",
"build/.NETFramework/v4.0/System.ServiceModel.Web.dll",
"build/.NETFramework/v4.0/System.ServiceModel.Web.xml",
"build/.NETFramework/v4.0/System.ServiceModel.dll",
"build/.NETFramework/v4.0/System.ServiceModel.xml",
"build/.NETFramework/v4.0/System.ServiceProcess.dll",
"build/.NETFramework/v4.0/System.ServiceProcess.xml",
"build/.NETFramework/v4.0/System.Speech.dll",
"build/.NETFramework/v4.0/System.Speech.xml",
"build/.NETFramework/v4.0/System.Transactions.dll",
"build/.NETFramework/v4.0/System.Transactions.xml",
"build/.NETFramework/v4.0/System.Web.Abstractions.dll",
"build/.NETFramework/v4.0/System.Web.ApplicationServices.dll",
"build/.NETFramework/v4.0/System.Web.ApplicationServices.xml",
"build/.NETFramework/v4.0/System.Web.DataVisualization.Design.dll",
"build/.NETFramework/v4.0/System.Web.DataVisualization.dll",
"build/.NETFramework/v4.0/System.Web.DataVisualization.xml",
"build/.NETFramework/v4.0/System.Web.DynamicData.Design.dll",
"build/.NETFramework/v4.0/System.Web.DynamicData.Design.xml",
"build/.NETFramework/v4.0/System.Web.DynamicData.dll",
"build/.NETFramework/v4.0/System.Web.DynamicData.xml",
"build/.NETFramework/v4.0/System.Web.Entity.Design.dll",
"build/.NETFramework/v4.0/System.Web.Entity.Design.xml",
"build/.NETFramework/v4.0/System.Web.Entity.dll",
"build/.NETFramework/v4.0/System.Web.Entity.xml",
"build/.NETFramework/v4.0/System.Web.Extensions.Design.dll",
"build/.NETFramework/v4.0/System.Web.Extensions.Design.xml",
"build/.NETFramework/v4.0/System.Web.Extensions.dll",
"build/.NETFramework/v4.0/System.Web.Extensions.xml",
"build/.NETFramework/v4.0/System.Web.Mobile.dll",
"build/.NETFramework/v4.0/System.Web.Mobile.xml",
"build/.NETFramework/v4.0/System.Web.RegularExpressions.dll",
"build/.NETFramework/v4.0/System.Web.RegularExpressions.xml",
"build/.NETFramework/v4.0/System.Web.Routing.dll",
"build/.NETFramework/v4.0/System.Web.Services.dll",
"build/.NETFramework/v4.0/System.Web.Services.xml",
"build/.NETFramework/v4.0/System.Web.dll",
"build/.NETFramework/v4.0/System.Web.xml",
"build/.NETFramework/v4.0/System.Windows.Forms.DataVisualization.Design.dll",
"build/.NETFramework/v4.0/System.Windows.Forms.DataVisualization.dll",
"build/.NETFramework/v4.0/System.Windows.Forms.DataVisualization.xml",
"build/.NETFramework/v4.0/System.Windows.Forms.dll",
"build/.NETFramework/v4.0/System.Windows.Forms.xml",
"build/.NETFramework/v4.0/System.Windows.Input.Manipulations.dll",
"build/.NETFramework/v4.0/System.Windows.Input.Manipulations.xml",
"build/.NETFramework/v4.0/System.Windows.Presentation.dll",
"build/.NETFramework/v4.0/System.Windows.Presentation.xml",
"build/.NETFramework/v4.0/System.Workflow.Activities.dll",
"build/.NETFramework/v4.0/System.Workflow.Activities.xml",
"build/.NETFramework/v4.0/System.Workflow.ComponentModel.dll",
"build/.NETFramework/v4.0/System.Workflow.ComponentModel.xml",
"build/.NETFramework/v4.0/System.Workflow.Runtime.dll",
"build/.NETFramework/v4.0/System.Workflow.Runtime.xml",
"build/.NETFramework/v4.0/System.WorkflowServices.dll",
"build/.NETFramework/v4.0/System.WorkflowServices.xml",
"build/.NETFramework/v4.0/System.Xaml.dll",
"build/.NETFramework/v4.0/System.Xaml.xml",
"build/.NETFramework/v4.0/System.Xml.Linq.dll",
"build/.NETFramework/v4.0/System.Xml.Linq.xml",
"build/.NETFramework/v4.0/System.Xml.dll",
"build/.NETFramework/v4.0/System.Xml.xml",
"build/.NETFramework/v4.0/System.dll",
"build/.NETFramework/v4.0/System.xml",
"build/.NETFramework/v4.0/UIAutomationClient.dll",
"build/.NETFramework/v4.0/UIAutomationClient.xml",
"build/.NETFramework/v4.0/UIAutomationClientsideProviders.dll",
"build/.NETFramework/v4.0/UIAutomationClientsideProviders.xml",
"build/.NETFramework/v4.0/UIAutomationProvider.dll",
"build/.NETFramework/v4.0/UIAutomationProvider.xml",
"build/.NETFramework/v4.0/UIAutomationTypes.dll",
"build/.NETFramework/v4.0/UIAutomationTypes.xml",
"build/.NETFramework/v4.0/WindowsBase.dll",
"build/.NETFramework/v4.0/WindowsBase.xml",
"build/.NETFramework/v4.0/WindowsFormsIntegration.dll",
"build/.NETFramework/v4.0/WindowsFormsIntegration.xml",
"build/.NETFramework/v4.0/XamlBuildTask.dll",
"build/.NETFramework/v4.0/XamlBuildTask.xml",
"build/.NETFramework/v4.0/mscorlib.dll",
"build/.NETFramework/v4.0/mscorlib.xml",
"build/.NETFramework/v4.0/sysglobl.dll",
"build/.NETFramework/v4.0/sysglobl.xml",
"build/Microsoft.NETFramework.ReferenceAssemblies.net40.targets",
"microsoft.netframework.referenceassemblies.net40.1.0.3.nupkg.sha512",
"microsoft.netframework.referenceassemblies.net40.nuspec"
]
}
},
"projectFileDependencyGroups": {
".NETFramework,Version=v4.0": [
"Microsoft.NETFramework.ReferenceAssemblies >= 1.0.3"
]
},
"packageFolders": {
"/home/flerouwu/.nuget/packages/": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/media/archive/rust-decomp/decompiled/Assembly-CSharp-firstpass/Assembly-CSharp-firstpass.csproj",
"projectName": "Assembly-CSharp-firstpass",
"projectPath": "/media/archive/rust-decomp/decompiled/Assembly-CSharp-firstpass/Assembly-CSharp-firstpass.csproj",
"packagesPath": "/home/flerouwu/.nuget/packages/",
"outputPath": "/media/archive/rust-decomp/decompiled/Assembly-CSharp-firstpass/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/home/flerouwu/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net40"
],
"sources": {
"https://api.nuget.org/v3/index.json": {},
"https://nuget.bepinex.dev/v3/index.json": {},
"https://pkgs.dev.azure.com/tgbots/Telegram.Bot/_packaging/release/nuget/v3/index.json": {}
},
"frameworks": {
"net40": {
"targetAlias": "net40",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
},
"SdkAnalysisLevel": "9.0.100"
},
"frameworks": {
"net40": {
"targetAlias": "net40",
"dependencies": {
"Microsoft.NETFramework.ReferenceAssemblies": {
"suppressParent": "All",
"target": "Package",
"version": "[1.0.3, )",
"autoReferenced": true
}
},
"runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.105/RuntimeIdentifierGraph.json"
}
}
}
}

View file

@ -1,11 +0,0 @@
{
"version": 2,
"dgSpecHash": "SnjWwmV49z8=",
"success": true,
"projectFilePath": "/media/archive/rust-decomp/decompiled/Assembly-CSharp-firstpass/Assembly-CSharp-firstpass.csproj",
"expectedPackageFiles": [
"/home/flerouwu/.nuget/packages/microsoft.netframework.referenceassemblies/1.0.3/microsoft.netframework.referenceassemblies.1.0.3.nupkg.sha512",
"/home/flerouwu/.nuget/packages/microsoft.netframework.referenceassemblies.net40/1.0.3/microsoft.netframework.referenceassemblies.net40.1.0.3.nupkg.sha512"
],
"logs": []
}

View file

@ -1 +0,0 @@
"restore":{"projectUniqueName":"/media/archive/rust-decomp/decompiled/Assembly-CSharp-firstpass/Assembly-CSharp-firstpass.csproj","projectName":"Assembly-CSharp-firstpass","projectPath":"/media/archive/rust-decomp/decompiled/Assembly-CSharp-firstpass/Assembly-CSharp-firstpass.csproj","outputPath":"/media/archive/rust-decomp/decompiled/Assembly-CSharp-firstpass/obj/","projectStyle":"PackageReference","originalTargetFrameworks":["net40"],"sources":{"https://api.nuget.org/v3/index.json":{},"https://nuget.bepinex.dev/v3/index.json":{},"https://pkgs.dev.azure.com/tgbots/Telegram.Bot/_packaging/release/nuget/v3/index.json":{}},"frameworks":{"net40":{"targetAlias":"net40","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.100"}"frameworks":{"net40":{"targetAlias":"net40","dependencies":{"Microsoft.NETFramework.ReferenceAssemblies":{"suppressParent":"All","target":"Package","version":"[1.0.3, )","autoReferenced":true}},"runtimeIdentifierGraphPath":"/usr/share/dotnet/sdk/9.0.105/RuntimeIdentifierGraph.json"}}

View file

@ -1 +0,0 @@
17469724654497705

View file

@ -1 +0,0 @@
17469724654497705

View file

@ -561,6 +561,10 @@ public static class AntiHack
{
return true;
}
if (ply.isInvisible)
{
return true;
}
return false;
}
}
@ -582,7 +586,7 @@ public static class AntiHack
return false;
}
Analytics.Azure.OnNoclipViolation(ply, ticks.CurrentPoint, ticks.EndPoint, ticks.Count, collider);
AddViolation(ply, AntiHackType.NoClip, ConVar.AntiHack.noclip_penalty * ticks.Length, collider.ToBaseEntity());
AddViolation(ply, AntiHackType.NoClip, ConVar.AntiHack.noclip_penalty * ticks.Length, collider.gameObject);
if (ConVar.AntiHack.noclip_reject)
{
return false;
@ -759,7 +763,7 @@ public static class AntiHack
Vector3 endPoint = TickInterpolatorCache.GetEndPoint(tickCache, invalidIndex);
TickInterpolatorCache.PlayerInfo playerInfo = tickCache.Infos[invalidIndex];
Analytics.Azure.OnNoclipViolation(obj, startPoint, endPoint, playerInfo.Count, Colliders[invalidIndex]);
AddViolation(obj, AntiHackType.NoClip, ConVar.AntiHack.noclip_penalty * playerInfo.Length, Colliders[invalidIndex].ToBaseEntity());
AddViolation(obj, AntiHackType.NoClip, ConVar.AntiHack.noclip_penalty * playerInfo.Length, Colliders[invalidIndex].gameObject);
if (ConVar.AntiHack.noclip_reject)
{
results[invalidIndex] = BasePlayer.PositionChange.Invalid;
@ -1561,7 +1565,7 @@ public static class AntiHack
}
}
public static void AddViolation(BasePlayer ply, AntiHackType type, float amount, BaseEntity entity = null)
public static void AddViolation(BasePlayer ply, AntiHackType type, float amount, GameObject gameObject = null)
{
using (TimeWarning.New("AntiHack.AddViolation"))
{
@ -1575,9 +1579,14 @@ public static class AntiHack
if ((ConVar.AntiHack.debuglevel >= 2 && amount > 0f) || (ConVar.AntiHack.debuglevel >= 3 && type != AntiHackType.NoClip) || ConVar.AntiHack.debuglevel >= 4)
{
string text = "Added violation of " + amount + " in frame " + UnityEngine.Time.frameCount + " (now has " + ply.violationLevel + ")";
if (!entity.IsRealNull())
if (gameObject != null)
{
text = text + " entity: " + entity.PrefabName;
text = text + " " + gameObject.name;
BaseEntity baseEntity = gameObject.ToBaseEntity();
if (baseEntity != null)
{
text = text + " (entity: " + baseEntity.ShortPrefabName + ")";
}
}
LogToConsole(ply, type, text);
}

View file

@ -13,235 +13,238 @@
<ItemGroup />
<ItemGroup>
<Reference Include="UnityEngine.CoreModule">
<HintPath>../../UnityEngine.CoreModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TerrainModule">
<HintPath>../../UnityEngine.TerrainModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.TerrainModule.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Network">
<HintPath>../../Facepunch.Network.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Network.dll</HintPath>
</Reference>
<Reference Include="Facepunch.UnityEngine">
<HintPath>../../Facepunch.UnityEngine.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>../../UnityEngine.PhysicsModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="Rust.Localization">
<HintPath>../../Rust.Localization.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.Localization.dll</HintPath>
</Reference>
<Reference Include="Rust.UI">
<HintPath>../../Rust.UI.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.UI.dll</HintPath>
</Reference>
<Reference Include="Rust.Data">
<HintPath>../../Rust.Data.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.Data.dll</HintPath>
</Reference>
<Reference Include="System.Core">
<HintPath>../../System.Core.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/System.Core.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Nexus">
<HintPath>../../Facepunch.Nexus.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Nexus.dll</HintPath>
</Reference>
<Reference Include="Facepunch.System">
<HintPath>../../Facepunch.System.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.System.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Unity">
<HintPath>../../Facepunch.Unity.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Unity.dll</HintPath>
</Reference>
<Reference Include="Rust.Global">
<HintPath>../../Rust.Global.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.Global.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>../../UnityEngine.AnimationModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.AnimationModule.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Console">
<HintPath>../../Facepunch.Console.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Console.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ParticleSystemModule">
<HintPath>../../UnityEngine.ParticleSystemModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.ParticleSystemModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.VehiclesModule">
<HintPath>../../UnityEngine.VehiclesModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.VehiclesModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>../../UnityEngine.UI.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>../../Assembly-CSharp-firstpass.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AIModule">
<HintPath>../../UnityEngine.AIModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.AIModule.dll</HintPath>
</Reference>
<Reference Include="Rust.World">
<HintPath>../../Rust.World.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.World.dll</HintPath>
</Reference>
<Reference Include="Rust.Clans">
<HintPath>../../Rust.Clans.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.Clans.dll</HintPath>
</Reference>
<Reference Include="Unity.Collections">
<HintPath>../../Unity.Collections.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Unity.Collections.dll</HintPath>
</Reference>
<Reference Include="Unity.Mathematics">
<HintPath>../../Unity.Mathematics.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Unity.Mathematics.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>../../UnityEngine.AudioModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>../../Unity.TextMeshPro.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>../../UnityEngine.UIModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.UIModule.dll</HintPath>
</Reference>
<Reference Include="Unity.AI.Navigation">
<HintPath>../../Unity.AI.Navigation.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Unity.AI.Navigation.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>../../Newtonsoft.Json.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>../../UnityEngine.InputLegacyModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="Rust.Platform.Common">
<HintPath>../../Rust.Platform.Common.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.Platform.Common.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Skeleton">
<HintPath>../../Facepunch.Skeleton.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Skeleton.dll</HintPath>
</Reference>
<Reference Include="Facepunch.BurstCloth">
<HintPath>../../Facepunch.BurstCloth.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.BurstCloth.dll</HintPath>
</Reference>
<Reference Include="EZhex1991.EZSoftBone">
<HintPath>../../EZhex1991.EZSoftBone.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/EZhex1991.EZSoftBone.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Flexbox">
<HintPath>../../Facepunch.Flexbox.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Flexbox.dll</HintPath>
</Reference>
<Reference Include="CurvedTextMeshPro">
<HintPath>../../CurvedTextMeshPro.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/CurvedTextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.VideoModule">
<HintPath>../../UnityEngine.VideoModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.VideoModule.dll</HintPath>
</Reference>
<Reference Include="Rust.Workshop">
<HintPath>../../Rust.Workshop.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.Workshop.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Raknet">
<HintPath>../../Facepunch.Raknet.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Raknet.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Input">
<HintPath>../../Facepunch.Input.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Input.dll</HintPath>
</Reference>
<Reference Include="Facepunch.UnwrapBaker.Settings">
<HintPath>../../Facepunch.UnwrapBaker.Settings.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.UnwrapBaker.Settings.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>../../UnityEngine.IMGUIModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.IMGUIModule.dll</HintPath>
</Reference>
<Reference Include="Rust.FileSystem">
<HintPath>../../Rust.FileSystem.dll</HintPath>
</Reference>
<Reference Include="Cronos">
<HintPath>../../Cronos.dll</HintPath>
</Reference>
<Reference Include="Unity.Burst">
<HintPath>../../Unity.Burst.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ClothModule">
<HintPath>../../UnityEngine.ClothModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TerrainPhysicsModule">
<HintPath>../../UnityEngine.TerrainPhysicsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestModule">
<HintPath>../../UnityEngine.UnityWebRequestModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.WindModule">
<HintPath>../../UnityEngine.WindModule.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http">
<HintPath>../../System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Sqlite">
<HintPath>../../Facepunch.Sqlite.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.FileSystem.dll</HintPath>
</Reference>
<Reference Include="Ionic.Zip.Reduced">
<HintPath>../../Ionic.Zip.Reduced.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Ionic.Zip.Reduced.dll</HintPath>
</Reference>
<Reference Include="Cronos">
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Cronos.dll</HintPath>
</Reference>
<Reference Include="Unity.Burst">
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Unity.Burst.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ClothModule">
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.ClothModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TerrainPhysicsModule">
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.TerrainPhysicsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestModule">
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.UnityWebRequestModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.WindModule">
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.WindModule.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http">
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Sqlite">
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Sqlite.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.DirectorModule">
<HintPath>../../UnityEngine.DirectorModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.DirectorModule.dll</HintPath>
</Reference>
<Reference Include="Unity.Timeline">
<HintPath>../../Unity.Timeline.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Unity.Timeline.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestWWWModule">
<HintPath>../../UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule">
<HintPath>../../UnityEngine.TextRenderingModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.TextRenderingModule.dll</HintPath>
</Reference>
<Reference Include="RTLTMPro">
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/RTLTMPro.dll</HintPath>
</Reference>
<Reference Include="EasyRoads3Dv3">
<HintPath>../../EasyRoads3Dv3.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/EasyRoads3Dv3.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Physics2DModule">
<HintPath>../../UnityEngine.Physics2DModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.Physics2DModule.dll</HintPath>
</Reference>
<Reference Include="Fleck">
<HintPath>../../Fleck.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Fleck.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Rcon">
<HintPath>../../Facepunch.Rcon.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Rcon.dll</HintPath>
</Reference>
<Reference Include="ZString">
<HintPath>../../ZString.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/ZString.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Steamworks.Posix">
<HintPath>../../Facepunch.Steamworks.Posix.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Steamworks.Posix.dll</HintPath>
</Reference>
<Reference Include="Azure.Identity">
<HintPath>../../Azure.Identity.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Azure.Identity.dll</HintPath>
</Reference>
<Reference Include="Azure.Storage.Blobs">
<HintPath>../../Azure.Storage.Blobs.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Azure.Storage.Blobs.dll</HintPath>
</Reference>
<Reference Include="Azure.Core">
<HintPath>../../Azure.Core.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Azure.Core.dll</HintPath>
</Reference>
<Reference Include="Facepunch.Ping">
<HintPath>../../Facepunch.Ping.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.Ping.dll</HintPath>
</Reference>
<Reference Include="Rust.Harmony">
<HintPath>../../Rust.Harmony.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.Harmony.dll</HintPath>
</Reference>
<Reference Include="LZ4">
<HintPath>../../LZ4.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/LZ4.dll</HintPath>
</Reference>
<Reference Include="Rust.Clans.Local">
<HintPath>../../Rust.Clans.Local.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.Clans.Local.dll</HintPath>
</Reference>
<Reference Include="Rust.Platform">
<HintPath>../../Rust.Platform.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.Platform.dll</HintPath>
</Reference>
<Reference Include="Rust.Demo">
<HintPath>../../Rust.Demo.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Rust.Demo.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ImageConversionModule">
<HintPath>../../UnityEngine.ImageConversionModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.ImageConversionModule.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe">
<HintPath>../../System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="TimeZoneConverter">
<HintPath>../../TimeZoneConverter.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/TimeZoneConverter.dll</HintPath>
</Reference>
<Reference Include="Facepunch.SteamNetworking">
<HintPath>../../Facepunch.SteamNetworking.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/Facepunch.SteamNetworking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.JSONSerializeModule">
<HintPath>../../UnityEngine.JSONSerializeModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.JSONSerializeModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TilemapModule">
<HintPath>../../UnityEngine.TilemapModule.dll</HintPath>
<HintPath>../../../../../work/rust-server/RustDedicated_Data/Managed/UnityEngine.TilemapModule.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View file

@ -1,5 +1,6 @@
#define UNITY_ASSERTIONS
using System;
using System.Collections.Generic;
using ConVar;
using Facepunch;
using Network;
@ -9,6 +10,12 @@ using UnityEngine.Assertions;
public class AttackHelicopter : PlayerHelicopter
{
public enum PreferredRocketType
{
HV,
Incendiary
}
public class GunnerInputState
{
public bool fire1;
@ -296,6 +303,80 @@ public class AttackHelicopter : PlayerHelicopter
}
return true;
}
if (rpc == 46796481 && player != null)
{
Assert.IsTrue(player.isServer, "SV_RPC Message is using a clientside player!");
if (Global.developer > 2)
{
Debug.Log("SV_RPCMessage: " + player?.ToString() + " - RPC_SetRocketAmmoType ");
}
using (TimeWarning.New("RPC_SetRocketAmmoType"))
{
using (TimeWarning.New("Conditions"))
{
if (!RPC_Server.IsVisible.Test(46796481u, "RPC_SetRocketAmmoType", this, player, 3f))
{
return true;
}
}
try
{
using (TimeWarning.New("Call"))
{
RPCMessage msg6 = new RPCMessage
{
connection = msg.connection,
player = player,
read = msg.read
};
RPC_SetRocketAmmoType(msg6);
}
}
catch (Exception exception5)
{
Debug.LogException(exception5);
player.Kick("RPC Error in RPC_SetRocketAmmoType");
}
}
return true;
}
if (rpc == 3589595843u && player != null)
{
Assert.IsTrue(player.isServer, "SV_RPC Message is using a clientside player!");
if (Global.developer > 2)
{
Debug.Log("SV_RPCMessage: " + player?.ToString() + " - RPC_TriggerRocketReload ");
}
using (TimeWarning.New("RPC_TriggerRocketReload"))
{
using (TimeWarning.New("Conditions"))
{
if (!RPC_Server.IsVisible.Test(3589595843u, "RPC_TriggerRocketReload", this, player, 3f))
{
return true;
}
}
try
{
using (TimeWarning.New("Call"))
{
RPCMessage msg7 = new RPCMessage
{
connection = msg.connection,
player = player,
read = msg.read
};
RPC_TriggerRocketReload(msg7);
}
}
catch (Exception exception6)
{
Debug.LogException(exception6);
player.Kick("RPC Error in RPC_TriggerRocketReload");
}
}
return true;
}
}
return base.OnRpcMessage(player, rpc, msg);
}
@ -649,4 +730,40 @@ public class AttackHelicopter : PlayerHelicopter
SetFlag(Flags.Reserved9, b: false);
}
}
[RPC_Server]
[RPC_Server.IsVisible(3f)]
public void RPC_SetRocketAmmoType(RPCMessage msg)
{
if (!(GetDriver() != msg.player))
{
PreferredRocketType ammoType = (PreferredRocketType)msg.read.Int32();
GetRockets().SetAmmoType(ammoType);
}
}
[RPC_Server]
[RPC_Server.IsVisible(3f)]
public void RPC_TriggerRocketReload(RPCMessage msg)
{
if (!(GetDriver() != msg.player))
{
GetRockets().StartReload();
}
}
public override void FilterServerProjectileAmmo(List<Item> ammoList)
{
base.FilterServerProjectileAmmo(ammoList);
AttackHelicopterRockets rockets = GetRockets();
for (int i = 0; i < ammoList.Count; i++)
{
Item item = ammoList[i];
if ((item.info == rockets.hvRocketDef && rockets.preferredRocketType != PreferredRocketType.HV) || (item.info == rockets.incendiaryRocketDef && rockets.preferredRocketType != PreferredRocketType.Incendiary))
{
ammoList.RemoveAt(i);
i--;
}
}
}
}

View file

@ -27,10 +27,10 @@ public class AttackHelicopterRockets : StorageContainer
private int rocketsPerReload = 6;
[SerializeField]
private ItemDefinition incendiaryRocketDef;
public ItemDefinition incendiaryRocketDef;
[SerializeField]
private ItemDefinition hvRocketDef;
public ItemDefinition hvRocketDef;
[SerializeField]
private ItemDefinition flareItemDef;
@ -44,6 +44,9 @@ public class AttackHelicopterRockets : StorageContainer
private TimeSince timeSinceFlareFired;
[NonSerialized]
public AttackHelicopter.PreferredRocketType preferredRocketType;
private const float ROCKET_LAUNCH_OFFSET = 1f;
private int rocketsSinceReload;
@ -106,6 +109,14 @@ public class AttackHelicopterRockets : StorageContainer
{
if (base.isServer)
{
if (preferredRocketType == AttackHelicopter.PreferredRocketType.HV)
{
return base.inventory.GetAmmoAmount(hvRocketDef);
}
if (preferredRocketType == AttackHelicopter.PreferredRocketType.Incendiary)
{
return base.inventory.GetAmmoAmount(incendiaryRocketDef);
}
return base.inventory.GetAmmoAmount(AmmoTypes.ROCKET);
}
return 0;
@ -195,6 +206,7 @@ public class AttackHelicopterRockets : StorageContainer
info.msg.attackHeliRockets.totalAmmo = GetRocketAmount();
info.msg.attackHeliRockets.hasFlares = HasFlareAmmo();
info.msg.attackHeliRockets.rocketsSinceReload = rocketsSinceReload;
info.msg.attackHeliRockets.preferredAmmoType = (int)preferredRocketType;
if (TryGetAmmoDef(out var ammoDef))
{
info.msg.attackHeliRockets.ammoItemID = ammoDef.itemid;
@ -351,4 +363,22 @@ public class AttackHelicopterRockets : StorageContainer
ClientRPC(RpcTarget.NetworkGroup("RPCFlareFired"), HasFlareAmmo());
return true;
}
public void SetAmmoType(AttackHelicopter.PreferredRocketType type)
{
preferredRocketType = type;
SendNetworkUpdate();
}
public void StartReload()
{
if (rocketsSinceReload != 0 && rocketsSinceReload != rocketsPerReload && GetRocketAmount() != 0 && !IsReloading)
{
rocketsSinceReload = rocketsPerReload;
ItemDefinition ammoDef;
int arg = (TryGetAmmoDef(out ammoDef) ? ammoDef.itemid : 0);
ClientRPC(RpcTarget.NetworkGroup("RPCRocketFired"), (short)GetRocketAmount(), arg, rocketsSinceReload);
SendNetworkUpdate();
}
}
}

View file

@ -24,6 +24,7 @@ public class AudioSettings : MonoBehaviour
}
float num = 1f - ((SingletonComponent<MixerSnapshotManager>.Instance == null) ? 0f : SingletonComponent<MixerSnapshotManager>.Instance.deafness);
mixer.SetFloat("WorldVol", LinearToDecibel(Audio.game * num));
mixer.SetFloat("UIVol", LinearToDecibel(Audio.game * num));
mixer.SetFloat("WorldVolFlashbang", LinearToDecibel(Audio.game));
mixer.SetFloat("VoiceVol", LinearToDecibel(Audio.voices * num));
mixer.SetFloat("InstrumentVol", LinearToDecibel(Audio.instruments * num));

View file

@ -96,6 +96,8 @@ public class AutoTurret : ContainerIOEntity, IRemoteControllable
public const Flags Flag_MaxAuths = Flags.Reserved4;
public const Flags Flag_ShowAlphaCover = Flags.Reserved5;
[NonSerialized]
public HashSet<PlayerNameID> authorizedPlayers = new HashSet<PlayerNameID>();
@ -656,7 +658,7 @@ public class AutoTurret : ContainerIOEntity, IRemoteControllable
public Vector3 AimOffset(BaseCombatEntity aimat)
{
BasePlayer basePlayer = aimat as BasePlayer;
if (basePlayer != null)
if (!basePlayer.IsUnityNull())
{
if (basePlayer.IsSleeping())
{
@ -670,9 +672,17 @@ public class AutoTurret : ContainerIOEntity, IRemoteControllable
{
return foundShield.transform.position;
}
return basePlayer.eyes.position;
if (!basePlayer.eyes.IsUnityNull())
{
return basePlayer.eyes.position;
}
return basePlayer.GetCenter();
}
return aimat.CenterPoint();
if (!aimat.IsUnityNull())
{
return aimat.CenterPoint();
}
return Vector3.zero;
}
public float GetAimSpeed()
@ -1740,7 +1750,7 @@ public class AutoTurret : ContainerIOEntity, IRemoteControllable
BaseProjectile component = heldEntity.GetComponent<BaseProjectile>();
b = component != null && component.largeTurretWeapon;
}
SetFlag(Flags.Reserved2, b);
SetFlag(Flags.Reserved5, b);
}
public static HeldEntity TryAddWeaponToTurret(Item weaponItem, Transform parent, BaseEntity entityParent, float zOffsetScale)
@ -1856,6 +1866,15 @@ public class AutoTurret : ContainerIOEntity, IRemoteControllable
}
if (attachedWeapon.primaryMagazine.contents > 0)
{
if (target.GetParentEntity() is TrainCar trainCar)
{
float magnitude = trainCar.GetWorldVelocity().magnitude;
float num = Mathf.Pow(1f - TrainCar.TrainTurretInaccuratePerVelocity, magnitude);
if (UnityEngine.Random.Range(0f, 1f) > num)
{
damageModifier = 0f;
}
}
FireAttachedGun(AimOffset(target), aimCone, null, PeacekeeperMode() ? target : null, damageModifier, speedModifier);
float delay = (attachedWeapon.isSemiAuto ? (attachedWeapon.repeatDelay * 1.5f) : attachedWeapon.repeatDelay);
delay = attachedWeapon.ScaleRepeatDelay(delay);

View file

@ -691,6 +691,14 @@ public class BallistaGun : BaseVehicleSeat
}
}
public override void AttemptMount(BasePlayer player, bool doMountChecks = true)
{
if (HasGround(rightGroundCheckTransform) && HasGround(leftGroundCheckTransform))
{
base.AttemptMount(player, doMountChecks);
}
}
private void LoadAmmo(BasePlayer player)
{
if (!(player != GetMounted()) && !IsLoaded())

View file

@ -560,15 +560,16 @@ public class BaseCombatEntity : BaseEntity
public virtual bool CanPickup(BasePlayer player)
{
if (pickup.enabled && (!pickup.requireBuildingPrivilege || player.CanBuild()) && (!pickup.requireHammer || player.IsHoldingEntity<Hammer>()))
bool flag = pickup.enabled && (!pickup.requireBuildingPrivilege || player.CanBuild()) && (!pickup.requireHammer || player.IsHoldingEntity<Hammer>()) && player != null && !player.IsInTutorial;
if (flag)
{
if (player != null)
PickupVolume[] volumes = PrefabAttribute.server.FindAll<PickupVolume>(prefabID);
if (PickupVolume.Check(base.transform.position, base.transform.rotation, volumes, this))
{
return !player.IsInTutorial;
flag = false;
}
return false;
}
return false;
return flag;
}
public virtual void OnPickedUp(Item createdItem, BasePlayer player)

View file

@ -901,6 +901,10 @@ public class BaseEntity : BaseNetworkable, IOnParentSpawning, IPrefabPreProcess
private Spawnable _spawnable;
protected static ExactArrayPool<byte> _autosaveBufferPool = new ExactArrayPool<byte>();
protected byte[] _autosaveBuffer;
public static HashSet<BaseEntity> saveList = new HashSet<BaseEntity>();
[NonSerialized]
@ -914,6 +918,14 @@ public class BaseEntity : BaseNetworkable, IOnParentSpawning, IPrefabPreProcess
private EntityRef[] entitySlots = new EntityRef[8];
private const float SYNC_VAR_QUEUE_UPDATE_INTERVAL = 0.0333f;
private const int SYNC_VAR_QUEUE_MAX_SIZE = 32;
private uint _serverSyncVarQueue;
private Action _sendPackedSyncVarQueueAction;
protected List<TriggerBase> triggers;
protected bool isVisible = true;
@ -1176,6 +1188,11 @@ public class BaseEntity : BaseNetworkable, IOnParentSpawning, IPrefabPreProcess
{
base.DestroyShared();
FreeEntityLinks();
StopSyncVars();
if (_autosaveBuffer != null)
{
_autosaveBufferPool.Return(_autosaveBuffer);
}
if (Components == null)
{
return;
@ -1196,6 +1213,7 @@ public class BaseEntity : BaseNetworkable, IOnParentSpawning, IPrefabPreProcess
OwnerID = 0uL;
flags = (Flags)0;
parentEntity = default(EntityRef);
ResetSyncVars();
if (base.isServer)
{
_spawnable = null;
@ -3084,6 +3102,10 @@ public class BaseEntity : BaseNetworkable, IOnParentSpawning, IPrefabPreProcess
{
_spawnable.Save(info);
}
if (info.msg.baseEntity != null)
{
AutoSaveSyncVars(info);
}
if (OwnerID != 0L && (info.forDisk || ShouldNetworkOwnerInfo()))
{
info.msg.ownerInfo = Facepunch.Pool.Get<OwnerInfo>();
@ -3114,6 +3136,15 @@ public class BaseEntity : BaseNetworkable, IOnParentSpawning, IPrefabPreProcess
}
}
public override bool CanUseNetworkCache(Connection connection)
{
if (ShouldNetworkOwnerInfo())
{
return false;
}
return base.CanUseNetworkCache(connection);
}
public virtual bool ShouldNetworkOwnerInfo()
{
return false;
@ -3194,6 +3225,10 @@ public class BaseEntity : BaseNetworkable, IOnParentSpawning, IPrefabPreProcess
_transferProtectionRemaining = num;
Invoke(DisableTransferProtectionAction, num);
}
if (info.msg.baseEntity != null)
{
AutoLoadSyncVars(info);
}
if (Components == null)
{
return;
@ -3818,6 +3853,121 @@ public class BaseEntity : BaseNetworkable, IOnParentSpawning, IPrefabPreProcess
return false;
}
protected void QueueSyncVar(byte nameID)
{
if (base.isServer)
{
if (nameID >= 32)
{
Debug.LogError($"nameID {nameID} is out of bitmask range (must be 0-{31})");
return;
}
WarmupSyncVars();
_serverSyncVarQueue |= (uint)(1 << (int)nameID);
}
}
private void SendPackedSyncVarQueue()
{
SV_PackedSyncVarSendQueue();
}
private void SyncVarNetSend(NetWrite write, SendInfo sendInfo)
{
write.Send(sendInfo);
}
public void WarmupSyncVars()
{
if (_sendPackedSyncVarQueueAction == null)
{
_sendPackedSyncVarQueueAction = SendPackedSyncVarQueue;
}
if (!IsInvoking(_sendPackedSyncVarQueueAction))
{
Invoke(_sendPackedSyncVarQueueAction, 0.0333f);
}
}
public void StopSyncVars()
{
if (IsInvoking(_sendPackedSyncVarQueueAction))
{
CancelInvoke(_sendPackedSyncVarQueueAction);
}
}
protected NetWrite SV_PackedSyncVarNetStart()
{
using (TimeWarning.New("PackedSyncVar"))
{
NetWrite netWrite = Network.Net.sv.StartWrite();
using (TimeWarning.New("Headers"))
{
netWrite.PacketID(Message.Type.PackedSyncVar);
netWrite.EntityID(net.ID);
netWrite.UInt32(_serverSyncVarQueue);
return netWrite;
}
}
}
protected void SV_PackedSyncVarSendQueue()
{
if (_serverSyncVarQueue == 0 || Network.Net.sv == null || !Network.Net.sv.IsConnected() || net == null)
{
return;
}
using (TimeWarning.New("PackedSyncVarQueue"))
{
SendDemoTransientEntity();
NetWrite netWrite = SV_PackedSyncVarNetStart();
for (byte b = 0; b < 32; b++)
{
if ((_serverSyncVarQueue & (uint)(1 << (int)b)) != 0)
{
WriteSyncVar(b, netWrite);
}
}
_serverSyncVarQueue = 0u;
SyncVarNetSend(netWrite, new SendInfo(net.group.subscribers));
}
}
private NetWrite SV_SyncVarNetStart(byte nameID)
{
using (TimeWarning.New("SyncVar"))
{
SendDemoTransientEntity();
NetWrite netWrite = Network.Net.sv.StartWrite();
using (TimeWarning.New("Headers"))
{
netWrite.PacketID(Message.Type.SyncVar);
netWrite.EntityID(net.ID);
netWrite.UInt8(nameID);
return netWrite;
}
}
}
protected void SV_SyncVarSend(byte nameID)
{
if (Network.Net.sv != null && Network.Net.sv.IsConnected() && net != null)
{
NetWrite netWrite = SV_SyncVarNetStart(nameID);
WriteSyncVar(nameID, netWrite);
SyncVarNetSend(netWrite, new SendInfo(net.group.subscribers));
}
}
protected void SyncVarNetWrite<T>(NetWrite write, T arg)
{
using (TimeWarning.New("Objects"))
{
write.WriteObject(arg);
}
}
public bool HasTrait(TraitFlag f)
{
return (Traits & f) == f;

View file

@ -201,7 +201,7 @@ public class BaseLiquidVessel : AttackEntity
float num = UnityEngine.Time.realtimeSinceStartup - lastFillTime;
StopFilling();
InvokeRepeating(FillCheck, 0f, 0.3f);
if (num > 1f)
if (num > 0.2f)
{
LiquidContainer facingLiquidContainer = GetFacingLiquidContainer();
if (facingLiquidContainer != null && facingLiquidContainer.GetLiquidItem() != null)
@ -280,11 +280,11 @@ public class BaseLiquidVessel : AttackEntity
{
if (!base.UsingInfiniteAmmoCheat)
{
Item slot = GetItem().contents.GetSlot(0);
if (slot != null)
Item contents = GetContents();
if (contents != null)
{
slot.UseItem(amount);
slot.MarkDirty();
contents.UseItem(amount);
contents.MarkDirty();
SendNetworkUpdateImmediate();
}
}

View file

@ -227,6 +227,18 @@ public abstract class BaseModifiers<T> : EntityComponent<T> where T : BaseCombat
}
}
public void RemoveAllExceptFromSource(Modifier.ModifierSource source)
{
for (int num = All.Count - 1; num >= 0; num--)
{
Modifier modifier = All[num];
if (modifier != null && modifier.Source != source)
{
Remove(modifier);
}
}
}
public float GetValue(Modifier.ModifierType type, float defaultValue = 0f)
{
float num = 1f;

View file

@ -43,6 +43,7 @@ public class BaseMountable : BaseCombatEntity
public static Translate.Phrase dismountPhrase = new Translate.Phrase("dismount", "Dismount");
[Header("Base Mountable")]
[Header("View")]
public Transform eyePositionOverride;
@ -58,9 +59,14 @@ public class BaseMountable : BaseCombatEntity
public bool relativeViewAngles = true;
public bool disableLegsWhenMounted;
[Header("Mounting")]
public bool AllowForceMountWhenRestrained;
[Tooltip("Allow players to mount other mountables/ladders from this vehicle")]
public bool mountChaining = true;
public Transform mountAnchor;
public float mountLOSVertOffset = 0.5f;
@ -832,6 +838,10 @@ public class BaseMountable : BaseCombatEntity
return TryFireProjectile(inventory, ammoType, firingPos, firingDir, shooter, launchOffset, minSpeed, out projectile);
}
public virtual void FilterServerProjectileAmmo(List<Item> ammoList)
{
}
public bool TryFireProjectile(ItemContainer ammoContainer, AmmoTypes ammoType, Vector3 firingPos, Vector3 firingDir, BasePlayer shooter, float launchOffset, float minSpeed, out ServerProjectile projectile)
{
projectile = null;
@ -842,6 +852,7 @@ public class BaseMountable : BaseCombatEntity
bool result = false;
List<Item> obj = Facepunch.Pool.Get<List<Item>>();
ammoContainer.FindAmmo(obj, ammoType);
FilterServerProjectileAmmo(obj);
for (int num = obj.Count - 1; num >= 0; num--)
{
if (obj[num].amount <= 0)

View file

@ -457,7 +457,7 @@ public abstract class BaseNetworkable : BaseMonoBehaviour, IEntity, NetworkHandl
public void OnNetworkSubscribersLeave(List<Connection> connections)
{
if (Network.Net.sv.IsConnected())
if (Network.Net.sv.IsConnected() && (!(this is BasePlayer basePlayer) || !basePlayer.IsSpectating()))
{
LogEntry(RustLog.EntryType.Network, 2, "LeaveVisibility");
NetWrite netWrite = Network.Net.sv.StartWrite();
@ -572,6 +572,35 @@ public abstract class BaseNetworkable : BaseMonoBehaviour, IEntity, NetworkHandl
return false;
}
protected virtual bool OnSyncVar(byte syncVar, NetRead reader, bool fromAutoSave = false)
{
return false;
}
protected virtual bool WriteSyncVar(byte id, NetWrite writer)
{
return false;
}
protected virtual bool AutoSaveSyncVars(SaveInfo save)
{
return false;
}
protected virtual bool AutoLoadSyncVars(LoadInfo load)
{
return false;
}
protected virtual void ResetSyncVars()
{
}
protected virtual bool IsSyncVarEqual<T>(T oldValue, T newValue)
{
return EqualityComparer<T>.Default.Equals(oldValue, newValue);
}
public static List<Connection> GetConnectionsWithin(Vector3 position, float distance, bool addSecondaryConnections = false, bool useRcEntityPosition = true)
{
connectionsInSphereList.Clear();

View file

@ -439,6 +439,14 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
Level8_Kayak = 80
}
public enum InjureState
{
Normal,
Crawling,
Incapacitated,
Dead
}
[Serializable]
public struct CapsuleColliderInfo
{
@ -766,6 +774,10 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
private float lastPlayerTick;
private static string DebugStage = "Entry";
private static bool IsUpdateActive = false;
private float sleepStartTime = -1f;
private float fallTickRate = 0.1f;
@ -933,6 +945,8 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
private uint lastValidUnderwearSkin;
private InjureState playerInjureState;
private float woundedDuration;
private float lastWoundedStartTime = float.NegativeInfinity;
@ -1252,7 +1266,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
{
if (isMounted)
{
return GetMounted().CanHoldItems();
return !GetMounted().CanHoldItems();
}
return false;
}
@ -1563,6 +1577,22 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
public TutorialItemAllowance CurrentTutorialAllowance { get; private set; }
public InjureState PlayerInjureState
{
get
{
return playerInjureState;
}
set
{
if (playerInjureState != value)
{
Analytics.Azure.OnPlayerChangeInjureState(this, PlayerInjureState, value);
playerInjureState = value;
}
}
}
public float TimeSinceWoundedStarted => UnityEngine.Time.realtimeSinceStartup - lastWoundedStartTime;
public Network.Connection Connection
@ -4814,7 +4844,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
Missions missions = Facepunch.Pool.Get<Missions>();
missions.missions = Facepunch.Pool.Get<List<MissionInstance>>();
missions.activeMission = GetActiveMission();
missions.protocol = 267;
missions.protocol = 268;
missions.seed = World.Seed;
missions.saveCreatedTime = Epoch.FromDateTime(SaveRestore.SaveCreatedTime);
foreach (BaseMission.MissionInstance mission in this.missions)
@ -4918,7 +4948,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
uint seed = loadedMissions.seed;
int saveCreatedTime = loadedMissions.saveCreatedTime;
int num2 = Epoch.FromDateTime(SaveRestore.SaveCreatedTime);
if (267 != protocol || World.Seed != seed || num2 != saveCreatedTime)
if (268 != protocol || World.Seed != seed || num2 != saveCreatedTime)
{
Debug.Log("Missions were from old protocol or different seed, or not from a loaded save. Clearing");
loadedMissions.activeMission = -1;
@ -5312,7 +5342,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
public void ClearClientPetLink()
{
ClientRPC(RpcTarget.Player("CLIENT_SetPetPrefabID", this), 0, 0);
ClientRPC(RpcTarget.Player("CLIENT_SetPetPrefabID", this), 0u, 0uL);
}
public void SendClientPetLink()
@ -5379,7 +5409,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
{
return false;
}
if ((disregardHeldEntity || GetHeldEntity() is Binocular || (isMounted && GetMounted() is ComputerStation computerStation && computerStation.AllowPings())) && IsAlive() && !IsWounded())
if ((disregardHeldEntity || GetHeldEntity() is Binocular || (isMounted && GetMounted() is ComputerStation computerStation && computerStation.AllowPings()) || (GetHeldEntity() is BaseProjectile baseProjectile && baseProjectile.AllowsPingUsage())) && IsAlive() && !IsWounded())
{
return !IsSpectating();
}
@ -6568,7 +6598,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
{
string text19 = value.projectilePrefab.name;
string text20 = (flag6 ? hitEntity.ShortPrefabName : "world");
AntiHack.Log(this, AntiHackType.ProjectileHack, "Update position trajectory (" + text19 + " on " + text20 + " with " + hitInfo.ProjectileTrajectoryMismatch + "m > " + ConVar.AntiHack.projectile_trajectory + "m)");
AntiHack.Log(this, AntiHackType.ProjectileHack, "Update position trajectory (" + text19 + " on " + text20 + " with " + hitInfo.ProjectileTrajectoryMismatch + "m > " + ConVar.AntiHack.projectile_trajectory_update + "m)");
Analytics.Azure.OnProjectileHackViolation(value);
stats.combat.LogInvalid(hitInfo, "trajectory_update_total");
flag9 = false;
@ -7803,6 +7833,10 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
{
Facepunch.Pool.Free(ref cachedPersistantPlayer);
}
if (ConVar.Server.UsePlayerUpdateJobs && IsUpdateActive)
{
Debug.LogError("UsePlayerUpdateJobs: Destroying player mid update, this will mess up transform cache!");
}
}
protected void ServerUpdate(float deltaTime)
@ -7889,12 +7923,12 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
internal static bool ServerUpdateParallel(float deltaTime, PlayerCache playerCache)
{
if (!ValidatePlayerCache(playerCache))
if (ConVar.Server.EmergencyDisablePlayerJobs && !ValidatePlayerCache(playerCache))
{
return false;
}
UpdatePlayerTransformCache(playerCache);
if (!ValidateTransformCache(playerCache))
if (ConVar.Server.EmergencyDisablePlayerJobs && !ValidateTransformCache(playerCache))
{
return false;
}
@ -7908,7 +7942,16 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
}
using (TimeWarning.New("FinalizeTick"))
{
FinalizeTickParallel(deltaTime, playerCache);
try
{
DebugStage = "Entry";
FinalizeTickParallel(deltaTime, playerCache);
}
catch (Exception arg)
{
Debug.LogError($"UsePlayerUpdateJobs: Stage {DebugStage}, exception - {arg}!");
return false;
}
}
foreach (BasePlayer validPlayer2 in playerCache.ValidPlayers)
{
@ -8593,6 +8636,10 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
if (ConVar.Server.UsePlayerUpdateJobs && StableIndex != -1)
{
playerCache.Remove(this);
if (IsUpdateActive)
{
Debug.LogError("UsePlayerUpdateJobs: Removing player mid update, this will mess up transform cache!");
}
}
SetPlayerFlag(PlayerFlags.Connected, b: false);
StopDemoRecording();
@ -9030,6 +9077,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
SendDeathInformation();
stats.Save();
}
PlayerInjureState = GetInjureState();
Facepunch.Pool.FreeUnmanaged(ref obj);
}
@ -9071,9 +9119,16 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
StartSleeping();
LifeStoryStart();
metabolism.Reset();
if (modifiers != null && !Player.keepteaondeath)
if (modifiers != null)
{
modifiers.RemoveAll();
if (Player.keepteaondeath)
{
modifiers.RemoveAllExceptFromSource(Modifier.ModifierSource.Tea);
}
else
{
modifiers.RemoveAll();
}
}
InitializeHealth(StartHealth(), StartMaxHealth());
bool flag = false;
@ -9102,6 +9157,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
EACServer.OnStartLoading(net.connection);
}
ProcessMissionEvent(BaseMission.MissionEventType.RESPAWN, 0, 0f);
PlayerInjureState = GetInjureState();
}
public void Respawn()
@ -9252,6 +9308,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
}
}
EACServer.LogPlayerTakeDamage(this, info, wasWounded);
PlayerInjureState = GetInjureState();
metabolism.SendChangesToClient();
if (info.PointStart != Vector3.zero && (info.damageTypes.Total() >= 0f || IsGod()))
{
@ -9841,17 +9898,18 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
public void OnPlayerReported(RPCMessage msg)
{
string text = msg.read.String();
string message = msg.read.StringMultiLine();
string text2 = msg.read.StringMultiLine();
string message = ((text2 != null && text2.Length > 1400) ? text2.Substring(0, 1400) : text2);
string type = msg.read.String();
string text2 = msg.read.String();
string text3 = msg.read.String();
DebugEx.Log($"[PlayerReport] {this} reported {text3}[{text2}] - \"{text}\"");
string text4 = msg.read.String();
DebugEx.Log($"[PlayerReport] {this} reported {text4}[{text3}] - \"{text}\"");
RCon.Broadcast(RCon.LogType.Report, new
{
PlayerId = UserIDString,
PlayerName = displayName,
TargetId = text2,
TargetName = text3,
TargetId = text3,
TargetName = text4,
Subject = text,
Message = message,
Type = type
@ -9867,16 +9925,17 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
{
string text = msg.read.String();
string text2 = msg.read.StringMultiLine();
string text3 = ((text2 != null && text2.Length > 1400) ? text2.Substring(0, 1400) : text2);
ReportType reportType = (ReportType)Mathf.Clamp(msg.read.Int32(), 0, 5);
if (ConVar.Server.printReportsToConsole)
{
DebugEx.Log($"[FeedbackReport] {this} reported {reportType} - \"{text}\" \"{text2}\"");
DebugEx.Log($"[FeedbackReport] {this} reported {reportType} - \"{text}\" \"{text3}\"");
RCon.Broadcast(RCon.LogType.Report, new
{
PlayerId = UserIDString,
PlayerName = displayName,
Subject = text,
Message = text2,
Message = text3,
Type = reportType
});
}
@ -9886,7 +9945,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
Facepunch.Models.Feedback feedback = new Facepunch.Models.Feedback
{
Type = reportType,
Message = text2,
Message = text3,
Subject = text
};
feedback.AppInfo.Image = image;
@ -10943,6 +11002,19 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
}
public int DoSplash(ItemDefinition splashType, int amount)
{
CheckWaterRadiation(splashType, amount);
CheckWater(splashType, amount);
return amount;
}
public int DoSplashFunWater(ItemDefinition splashType, int amount)
{
CheckWaterRadiation(splashType, amount);
return amount;
}
private void CheckWaterRadiation(ItemDefinition splashType, int amount)
{
if (splashType == WaterTypes.RadioactiveWaterItemDef)
{
@ -10950,17 +11022,20 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
a = Mathf.Max(a, 0.5f);
ApplyRadiation(a);
}
}
private void CheckWater(ItemDefinition splashType, int amount)
{
if (splashType == WaterTypes.WaterItemDef || splashType == WaterTypes.SaltWaterItemDef)
{
float a2 = (float)amount * 0.01f;
a2 = Mathf.Max(a2, 5f);
float a = (float)amount * 0.01f;
a = Mathf.Max(a, 5f);
timeSinceLastWaterSplash = 0f;
if (!(baseProtection.amounts[4] > 0f))
{
metabolism.wetness.Add(a2);
metabolism.wetness.Add(a);
}
}
return amount;
}
public void AddNeabyStash(StashContainer newStash)
@ -11652,6 +11727,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
private static void FinalizeTickParallel(float deltaTime, PlayerCache playerCache)
{
DebugStage = "ProcessPlayers";
using (TimeWarning.New("ProcessPlayers"))
{
NativeListEx.Expand(ref PlayersToFinalize, playerCache.PlayerCount, copyContents: false);
@ -11668,23 +11744,28 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
}
}
}
DebugStage = "PlayersToFinalize Check";
if (PlayersToFinalize.IsEmpty)
{
return;
}
DebugStage = "Water NativeArrays Expansion";
ReadOnlySpan<BasePlayer> players = playerCache.Players;
NativeArrayEx.Expand(ref WaterInfos, players.Length, NativeArrayOptions.UninitializedMemory);
NativeArrayEx.Expand(ref WaterFactors, players.Length, NativeArrayOptions.UninitializedMemory);
NativeArrayEx.Expand(ref CachedStates, players.Length, NativeArrayOptions.UninitializedMemory);
NativeArrayEx.Expand(ref PlayerLocalPos, players.Length, NativeArrayOptions.UninitializedMemory);
NativeArrayEx.Expand(ref PlayerLocalRots, players.Length, NativeArrayOptions.UninitializedMemory);
DebugStage = "RecacheTransforms";
RecacheTransforms jobData = new RecacheTransforms
{
LocalPos = PlayerLocalPos,
LocalRots = PlayerLocalRots
};
IJobParallelForTransformExtensions.RunReadOnlyByRef(ref jobData, PlayerTransformsAccess);
DebugStage = "GetWaterFactors";
GetWaterFactors(playerCache, PlayerLocalPos.AsReadOnly(), PlayerLocalRots.AsReadOnly(), PlayersToFinalize.AsReadOnly(), WaterInfos, WaterFactors);
DebugStage = "UpdateWaterCache";
UpdateWaterCache jobData2 = new UpdateWaterCache
{
States = CachedStates,
@ -11693,7 +11774,9 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
Indices = PlayersToFinalize.AsReadOnly()
};
IJobExtensions.RunByRef(ref jobData2);
DebugStage = "TickCacheView";
TickInterpolatorCache.ReadOnlyState readOnly = TickCache.ReadOnly;
DebugStage = "GatherPosToValidateJob";
NativeArrayEx.Expand(ref PositionChanges, players.Length, NativeArrayOptions.UninitializedMemory);
NativeListEx.Expand(ref PlayersToValidate, PlayersToFinalize.Length, copyContents: false);
GatherPosToValidateJob jobData3 = new GatherPosToValidateJob
@ -11704,8 +11787,10 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
Indices = PlayersToFinalize.AsReadOnly()
};
IJobExtensions.RunByRef(ref jobData3);
DebugStage = "ValidateMoves";
NativeListEx.Expand(ref PlayersToRecache, PlayersToValidate.Length, copyContents: false);
AntiHack.ValidateMoves(playerCache, readOnly, CachedStates, PlayersToValidate.AsReadOnly(), PositionChanges);
DebugStage = "GatherPositionChanged";
using (TimeWarning.New("GatherPositionChanged"))
{
foreach (int item in PlayersToValidate)
@ -11723,6 +11808,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
}
if (!PlayersToRecache.IsEmpty)
{
DebugStage = "RecachingPlayerState";
using (TimeWarning.New("RecachingPlayerState"))
{
IJobParallelForTransformExtensions.RunReadOnlyByRef(ref jobData, PlayerTransformsAccess);
@ -11739,6 +11825,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
}
using (TimeWarning.New("FinalizePlayers"))
{
DebugStage = "FinalizePlayers";
foreach (int item2 in PlayersToFinalize)
{
BasePlayer basePlayer2 = players[item2];
@ -11785,6 +11872,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
}
basePlayer2.tickDeltaTime = 0f;
}
DebugStage = "Exit";
}
}
@ -11823,12 +11911,48 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
private static bool ValidatePlayerCache(PlayerCache playerCache)
{
return true;
using (TimeWarning.New("ValidatePlayerCache"))
{
int num = 0;
for (int i = 0; i < playerCache.Players.Length; i++)
{
BasePlayer basePlayer = playerCache.Players[i];
if (!basePlayer.IsRealNull())
{
if (basePlayer == null)
{
Debug.LogError("UsePlayerUpdateJobs: PlayerCache has a null player that hasn't been removed!");
return false;
}
if (basePlayer.StableIndex == -1)
{
Debug.LogError("UsePlayerUpdateJobs: Player missing stable index!");
return false;
}
num++;
}
}
if (num != playerCache.PlayerCount)
{
Debug.LogError($"UsePlayerUpdateJobs: Player count desync, tracking {playerCache.PlayerCount} but found {num}!");
return false;
}
return true;
}
}
private static bool ValidateTransformCache(PlayerCache playerCache)
{
return true;
using (TimeWarning.New("ValidateTransformCache"))
{
int length = PlayerTransformsAccess.length;
if (length != playerCache.Players.Length)
{
Debug.LogError($"UsePlayerUpdateJobs: Mismatching length of transform cache ({length}) and player cache({playerCache.Players.Length})!");
return false;
}
return true;
}
}
public bool IsCraftingTutorialBlocked(ItemDefinition def, out bool forceUnlock)
@ -12120,6 +12244,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
RecoverFromWounded();
CancelInvoke(WoundingTick);
EACServer.LogPlayerRevive(source, this);
PlayerInjureState = GetInjureState();
}
}
@ -12206,6 +12331,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
StartWoundedTick(40, 50);
SendWoundedInformation(woundedDuration);
SendNetworkUpdateImmediate();
PlayerInjureState = GetInjureState();
}
public void GoToIncapacitated(HitInfo info)
@ -12222,6 +12348,7 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
StartWoundedTick(10, 25);
SendWoundedInformation(woundedDuration);
SendNetworkUpdateImmediate();
PlayerInjureState = GetInjureState();
}
private void WoundedStartSharedCode(HitInfo info)
@ -12279,6 +12406,23 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
return true;
}
public InjureState GetInjureState()
{
if (IsDead())
{
return InjureState.Dead;
}
if (IsIncapacitated())
{
return InjureState.Incapacitated;
}
if (IsCrawling())
{
return InjureState.Crawling;
}
return InjureState.Normal;
}
public override BasePlayer ToPlayer()
{
return this;
@ -12523,11 +12667,29 @@ public class BasePlayer : BaseCombatEntity, LootPanel.IHasLootPanel, IIdealSlotE
{
using (TimeWarning.New("ServerUpdateParallel"))
{
if (!ServerUpdateParallel(deltaTime, playerCache))
if (ConVar.Server.EmergencyDisablePlayerJobs && activePlayerList.Count != playerCache.PlayerCount)
{
Debug.LogError("UsePlayerUpdateJobs: desync in player counts between activePlayerList and PlayerCache");
flag = false;
ConVar.Server.UsePlayerUpdateJobs = false;
}
IsUpdateActive = true;
try
{
if (!ServerUpdateParallel(deltaTime, playerCache))
{
flag = false;
ConVar.Server.UsePlayerUpdateJobs = false;
}
}
catch (Exception)
{
throw;
}
finally
{
IsUpdateActive = false;
}
}
}
if (!flag && playerCache.PlayerCount > 0)

View file

@ -578,12 +578,7 @@ public class BaseProjectile : AttackEntity
public void SetAmmoCount(int newCount)
{
primaryMagazine.contents = newCount;
Item item = GetItem();
if (item != null)
{
item.ammoCount = newCount;
item.MarkDirty();
}
GetItem()?.MarkDirty();
}
public void ModifyAmmoCount(int amount)
@ -801,7 +796,7 @@ public class BaseProjectile : AttackEntity
Ray ray = new Ray(vector, vector2);
GamePhysics.TraceAll(ray, radius, obj, 300f, 1220225793, QueryTriggerInteraction.Ignore, ownerPlayer);
float distanceOverride = 0f;
for (int j = 0; j < obj.Count; j++)
for (int j = 0; j < obj.Count && damageModifier != 0f; j++)
{
RaycastHit hit = obj[j];
BaseEntity entity = hit.GetEntity();
@ -1618,7 +1613,13 @@ public class BaseProjectile : AttackEntity
Item item = ownerItem.contents.itemList[num2];
if (item != null && !usingInfiniteAmmoCheat)
{
item.LoseCondition(num + barrelConditionLoss);
float num3 = 1f;
ProjectileWeaponMod projectileWeaponMod = item.GetHeldEntity() as ProjectileWeaponMod;
if (projectileWeaponMod != null)
{
num3 = projectileWeaponMod.ConditionLossMultiplier;
}
item.LoseCondition((num + barrelConditionLoss) * num3);
}
}
}
@ -1639,6 +1640,25 @@ public class BaseProjectile : AttackEntity
return false;
}
public bool AllowsPingUsage()
{
using (TimeWarning.New("AllowsPingUsage"))
{
if (children != null)
{
foreach (BaseEntity child in children)
{
ProjectileWeaponMod projectileWeaponMod = child as ProjectileWeaponMod;
if (projectileWeaponMod != null && projectileWeaponMod.allowPings && !projectileWeaponMod.IsBroken())
{
return true;
}
}
}
}
return false;
}
public string GetAttackEffectAdditive()
{
string result = "";
@ -1683,6 +1703,11 @@ public class BaseProjectile : AttackEntity
if (silencedAttack.isValid)
{
resourcePath = silencedAttack.resourcePath;
GameObject gameObject = silencedAttack.Get();
if (gameObject != null && gameObject.TryGetComponent<EffectSilencerSelect>(out var component2) && component2.GetEffectForSilencerType(projectileWeaponMod.silencerType, out var result))
{
resourcePath = result.resourcePath;
}
}
break;
}

View file

@ -193,9 +193,6 @@ public class BaseVehicle : BaseMountable, VehicleSpawner.IVehicleSpawnUser
}
[Header("Base Vehicle")]
[Tooltip("Allow players to mount other mountables/ladders from this vehicle")]
public bool mountChaining = true;
[Tooltip("Check for vehicles clipping into our mount point as well as static stuff")]
public bool checkVehicleClipping;
@ -1132,44 +1129,56 @@ public class BaseVehicle : BaseMountable, VehicleSpawner.IVehicleSpawnUser
return !player.IsRestrained || forcingRestrainedPlayer;
}
public void SwapSeats(BasePlayer player, int targetSeat = 0, bool forcingRestrainedPlayer = false)
public void SwapSeats(BasePlayer player, int targetSeat = -1, bool forcingRestrainedPlayer = false)
{
if (!HasMountPoints() || !CanSwapSeats)
{
return;
}
int playerSeat = GetPlayerSeat(player);
if (playerSeat == -1)
int currentSeatIndex = GetPlayerSeat(player);
if (currentSeatIndex == -1)
{
return;
}
BaseMountable mountable = GetMountPoint(playerSeat).mountable;
int num = playerSeat;
BaseMountable mountable = GetMountPoint(currentSeatIndex).mountable;
BaseMountable baseMountable = null;
if (baseMountable == null)
if (targetSeat == -1)
{
int num2 = NumSwappableSeats();
for (int i = 0; i < num2; i++)
int num = NumSwappableSeats();
for (int i = 1; i <= num; i++)
{
num++;
if (num >= num2)
{
num = 0;
}
MountPointInfo mountPoint = GetMountPoint(num);
if (mountPoint?.mountable != null && !mountPoint.mountable.AnyMounted() && mountPoint.mountable.CanSwapToThis(player) && !(mountPoint.isDriver && forcingRestrainedPlayer) && !IsSeatClipping(mountPoint.mountable) && IsSeatVisible(mountPoint.mountable, player.eyes.position) && IsPlayerSeatSwapValid(player, playerSeat, num, forcingRestrainedPlayer))
int num2 = (currentSeatIndex + i) % num;
MountPointInfo mountPoint = GetMountPoint(num2);
if (IsValidSwap(mountPoint, num2))
{
baseMountable = mountPoint.mountable;
break;
}
}
}
else
{
targetSeat = Mathf.Clamp(targetSeat, 0, NumSwappableSeats());
MountPointInfo mountPoint2 = GetMountPoint(targetSeat);
if (IsValidSwap(mountPoint2, targetSeat))
{
baseMountable = mountPoint2.mountable;
}
}
if (baseMountable != null && baseMountable != mountable)
{
mountable.DismountPlayer(player, lite: true);
baseMountable.MountPlayer(player);
player.MarkSwapSeat();
}
bool IsValidSwap(MountPointInfo point, int toIndex)
{
if (point?.mountable != null && !point.mountable.AnyMounted() && point.mountable.CanSwapToThis(player) && !(point.isDriver && forcingRestrainedPlayer) && !IsSeatClipping(point.mountable) && IsSeatVisible(point.mountable, player.eyes.position))
{
return IsPlayerSeatSwapValid(player, currentSeatIndex, toIndex, forcingRestrainedPlayer);
}
return false;
}
}
public virtual int NumSwappableSeats()

View file

@ -4,27 +4,59 @@ public class BeeGrenade : TimedExplosive
{
public GameObjectRef beeSwarmPrefab;
[Header("Spawning Settings")]
public int beeSwarmAmount = 1;
public float spawnRadius = 2f;
private const int mask = -928830719;
public override void Explode()
{
if (beeSwarmPrefab.isValid && !WaterLevel.Test(base.transform.position, waves: true, volumes: true, this))
{
Vector3 position = base.transform.position;
if (creatorPlayer != null)
for (int i = 0; i < Mathf.Max(1, beeSwarmAmount); i++)
{
Vector3 normalized = (creatorPlayer.transform.position - base.transform.position).normalized;
position += normalized * 1f;
Vector3 vector = base.transform.position;
if (beeSwarmAmount > 1)
{
Vector2 vector2 = Random.insideUnitCircle * spawnRadius;
Vector3 vector3 = base.transform.position + new Vector3(vector2.x, 0f, vector2.y);
if (Physics.Linecast(base.transform.position, vector3, out var hitInfo, -928830719))
{
Vector3 point = hitInfo.point;
Vector3 normalized = (base.transform.position - point).normalized;
vector = point + normalized * 1.5f;
}
else
{
Vector3 normalized2 = (base.transform.position - base.transform.position).normalized;
vector = vector3;
vector += normalized2 * 0.5f;
}
}
if (Physics.Raycast(new Ray(vector + Vector3.up * 0.5f, Vector3.down), out var hitInfo2, 2f, -928830719))
{
vector.y = hitInfo2.point.y;
}
vector += Vector3.up * 1.5f;
if (Physics.Linecast(base.transform.position, vector, out var hitInfo3, -928830719))
{
vector = hitInfo3.point;
}
if (creatorPlayer != null)
{
Vector3 normalized3 = (creatorPlayer.transform.position - base.transform.position).normalized;
vector += normalized3;
}
BaseEntity baseEntity = GameManager.server.CreateEntity(beeSwarmPrefab.resourcePath, vector, Quaternion.identity);
if (creatorPlayer != null)
{
baseEntity.OwnerID = creatorPlayer.userID;
baseEntity.creatorEntity = creatorPlayer;
}
baseEntity.Spawn();
}
if (!GamePhysics.Trace(new Ray(CenterPoint(), Vector3.up), 0f, out var _, 2f, -928830719, QueryTriggerInteraction.Ignore, this))
{
position += Vector3.up * 1.5f;
}
BaseEntity baseEntity = GameManager.server.CreateEntity(beeSwarmPrefab.resourcePath, position, Quaternion.identity);
if (creatorPlayer != null)
{
baseEntity.OwnerID = creatorPlayer.userID;
baseEntity.creatorEntity = creatorPlayer;
}
baseEntity.Spawn();
}
base.Explode();
}

View file

@ -34,7 +34,7 @@ public class BeeSwarmAI : BaseCombatEntity, ISplashable
public const Flags HasTarget = Flags.Reserved14;
[ServerVar(Help = "How long a swarm will stick around without a target")]
public static float killWithoutTargetTime = 180f;
public static float killWithoutTargetTime = 150f;
[ServerVar(Help = "How far away fire has to be to set the swarm on fire")]
public static float flameSettingDistance = 5.5f;

View file

@ -19,7 +19,7 @@ public class BeeSwarmMaster : BaseCombatEntity, ISplashable
public const Flags IsDying = Flags.Reserved13;
[ServerVar(Help = "How long a master swarm will stick around without a target")]
public static float killWithoutATargetTime = 300f;
public static float killWithoutATargetTime = 150f;
[ServerVar(Help = "How many child swarms a master swarm will create")]
public static int amountToSpawn = 3;

View file

@ -7,6 +7,8 @@ public class Beehive : StorageContainer, IHeatSourceListener, ISplashable
[Header("Beehive Settings")]
public ItemDefinition HoneyCombDefinition;
public ItemDefinition BeeNucleusDefinition;
public float growthRate = 0.05f;
public float beeStingTime = 2f;
@ -14,6 +16,8 @@ public class Beehive : StorageContainer, IHeatSourceListener, ISplashable
[Header("References")]
public TriggerHurtEx hurtTrigger;
public GameObjectRef masterSwarm;
public const Flags HasNucleus = Flags.Reserved12;
public const Flags HasBees = Flags.Reserved13;
@ -29,6 +33,15 @@ public class Beehive : StorageContainer, IHeatSourceListener, ISplashable
[ServerVar(Help = "How much the Nucleus's XP should be increased per honeycomb generated")]
public static int xpIncreasePerHoneycomb = 2;
private static Vector3[] outsideLookupDirs = new Vector3[5]
{
new Vector3(0f, 1f, 0f).normalized,
new Vector3(1f, 0f, 0f).normalized,
new Vector3(0f, 0f, 1f).normalized,
new Vector3(-1f, 0f, 0f).normalized,
new Vector3(0f, 0f, -1f).normalized
};
private bool hasNucleus;
private float createNewCombAccumulator;
@ -69,7 +82,7 @@ public class Beehive : StorageContainer, IHeatSourceListener, ISplashable
public bool IsOutsideAccurate()
{
return SocketMod_Inside.IsOutside(base.transform.position, base.transform);
return SocketMod_Inside.IsOutside(base.transform.position + Vector3.up * 0.2f, Quaternion.identity, outsideLookupDirs);
}
public override void Load(LoadInfo info)
@ -326,7 +339,20 @@ public class Beehive : StorageContainer, IHeatSourceListener, ISplashable
{
float temperature = Climate.GetTemperature(base.transform.position);
float num = GrowableEntity.CalculateArtificialTemperature(base.transform);
num *= 2f;
bool flag = num >= 10f;
bool flag2 = temperature < 10f;
bool flag3 = temperature < 16f && !flag2;
if (flag)
{
if (flag3)
{
return 20f;
}
if (flag2)
{
return 16f;
}
}
return temperature + num;
}
@ -373,7 +399,7 @@ public class Beehive : StorageContainer, IHeatSourceListener, ISplashable
{
CalculateQualifiers();
float num = serverTemperature;
float num2 = ((num < 25f) ? ((num < 10f) ? 0.010000001f : ((!(num < 16f)) ? 0.1f : 0.05f)) : ((!(num < 40f)) ? 0.010000001f : 0.05f));
float num2 = ((num < 28f) ? ((num < 10f) ? 0.010000001f : ((!(num < 16f)) ? 0.1f : 0.05f)) : ((!(num < 40f)) ? 0.010000001f : 0.05f));
growthRate = num2;
Item slot = base.inventory.GetSlot(0);
if (slot != null)
@ -399,4 +425,29 @@ public class Beehive : StorageContainer, IHeatSourceListener, ISplashable
SendNetworkUpdate();
}
}
public override void DropItems(BaseEntity initiator = null)
{
bool flag = false;
int index = -1;
for (int i = 0; i < base.inventory.itemList.Count; i++)
{
if (base.inventory.itemList[i].info == BeeNucleusDefinition)
{
flag = true;
index = i;
}
}
if (flag && base.inventory.Remove(base.inventory.itemList[index]))
{
BaseEntity baseEntity = GameManager.server.CreateEntity(masterSwarm.resourcePath, base.transform.position + Vector3.up * 1.5f, Quaternion.identity);
if (creatorEntity is BasePlayer basePlayer)
{
baseEntity.creatorEntity = basePlayer;
baseEntity.OwnerID = basePlayer.userID;
}
baseEntity.Spawn();
}
base.DropItems(initiator);
}
}

View file

@ -4,4 +4,8 @@ using UnityEngine.Rendering.PostProcessing;
public class BlurManager : MonoBehaviour
{
public PostProcessVolume postProcessVolume;
public PostProcessProfile standardBlurProfile;
public PostProcessProfile heavyBlurProfile;
}

View file

@ -7,8 +7,6 @@ public class Boomerang : BaseMelee
private static readonly int CaughtHash = Animator.StringToHash("caught");
private static readonly int WaitingToCatchHash = Animator.StringToHash("waitingToCatch");
private bool hasThrown;
public bool HasThrown => hasThrown;

View file

@ -1,6 +1,7 @@
#define UNITY_ASSERTIONS
using System;
using System.Collections.Generic;
using System.Linq;
using ConVar;
using Facepunch;
using Facepunch.Rust;
@ -49,7 +50,7 @@ public class BuildingBlock : StabilityEntity
private ulong lastSkinID;
private int lastModelState;
private ulong lastModelState;
private uint lastCustomColour;
@ -81,15 +82,25 @@ public class BuildingBlock : StabilityEntity
public OBBComponent AlternativePipeBounds;
public const int WALLPAPER_MAXHEALTH = 100;
[HideInInspector]
public float wallpaperHealth = -1f;
[HideInInspector]
public float wallpaperRotation;
[HideInInspector]
public float wallpaperHealth2 = -1f;
[HideInInspector]
public float wallpaperRotation2;
public ProtectionProperties wallpaperProtection;
public override bool CanBeDemolished => true;
public override bool IsDemolishSupported => true;
public int modelState { get; private set; }
public ulong modelState { get; private set; }
public uint customColour { get; private set; }
@ -240,12 +251,14 @@ public class BuildingBlock : StabilityEntity
base.ResetState();
blockDefinition = null;
forceSkinRefresh = false;
modelState = 0;
lastModelState = 0;
modelState = 0uL;
lastModelState = 0uL;
wallpaperID = 0uL;
wallpaperID2 = 0uL;
wallpaperHealth = -1f;
wallpaperHealth2 = -1f;
wallpaperRotation = 0f;
wallpaperRotation2 = 0f;
grade = BuildingGrade.Enum.Twigs;
lastGrade = BuildingGrade.Enum.None;
DestroySkin();
@ -311,7 +324,7 @@ public class BuildingBlock : StabilityEntity
return true;
}
public void SetConditionalModel(int state)
public void SetConditionalModel(ulong state)
{
if (state != modelState)
{
@ -325,7 +338,7 @@ public class BuildingBlock : StabilityEntity
public bool GetConditionalModel(int index)
{
return (modelState & (1 << index)) != 0;
return (modelState & (ulong)(1L << index)) != 0;
}
private bool CanChangeToGrade(BuildingGrade.Enum iGrade, ulong iSkin, BasePlayer player)
@ -890,6 +903,8 @@ public class BuildingBlock : StabilityEntity
info.msg.buildingBlock.wallpaperID2 = wallpaperID2;
info.msg.buildingBlock.wallpaperHealth = wallpaperHealth;
info.msg.buildingBlock.wallpaperHealth2 = wallpaperHealth2;
info.msg.buildingBlock.wallpaperRotation = wallpaperRotation;
info.msg.buildingBlock.wallpaperRotation2 = wallpaperRotation2;
if (customColour != 0)
{
info.msg.simpleUint = Facepunch.Pool.Get<SimpleUInt>();
@ -911,6 +926,8 @@ public class BuildingBlock : StabilityEntity
wallpaperID2 = info.msg.buildingBlock.wallpaperID2;
wallpaperHealth = info.msg.buildingBlock.wallpaperHealth;
wallpaperHealth2 = info.msg.buildingBlock.wallpaperHealth2;
wallpaperRotation = info.msg.buildingBlock.wallpaperRotation;
wallpaperRotation2 = info.msg.buildingBlock.wallpaperRotation2;
SetConditionalModel(info.msg.buildingBlock.model);
SetGrade((BuildingGrade.Enum)info.msg.buildingBlock.grade);
}
@ -1026,35 +1043,45 @@ public class BuildingBlock : StabilityEntity
return wallpaperHealth > 0f;
}
public override bool IsOccupied(Socket_Base socket)
public ulong GetWallpaperSkin(int side)
{
if (socket is Socket_Specific_Female socket_Specific_Female && socket_Specific_Female.socketName.Contains("wallpaper"))
if (side != 0)
{
int side = ((!socket.socketName.EndsWith("1")) ? 1 : 0);
return HasWallpaper(side);
return wallpaperID2;
}
return base.IsOccupied(socket);
return wallpaperID;
}
public void SetWallpaper(ulong id, int side = 0)
public float GetWallpaperRotation(int side)
{
if (side != 0)
{
return wallpaperRotation2;
}
return wallpaperRotation;
}
public void SetWallpaper(ulong id, int side = 0, float rotation = 0f)
{
if (side == 0)
{
if (HasWallpaper(side) && wallpaperID == id)
if (HasWallpaper(side) && wallpaperID == id && wallpaperRotation == rotation)
{
return;
}
wallpaperID = id;
wallpaperHealth = 100f;
wallpaperRotation = rotation;
}
else
{
if (HasWallpaper(side) && wallpaperID2 == id)
if (HasWallpaper(side) && wallpaperID2 == id && wallpaperRotation2 == rotation)
{
return;
}
wallpaperID2 = id;
wallpaperHealth2 = 100f;
wallpaperRotation2 = rotation;
}
if (base.isServer)
{
@ -1071,10 +1098,12 @@ public class BuildingBlock : StabilityEntity
case 0:
wallpaperHealth = -1f;
wallpaperID = 0uL;
wallpaperRotation = 0f;
break;
case 1:
wallpaperHealth2 = -1f;
wallpaperID2 = 0uL;
wallpaperRotation2 = 0f;
break;
}
if (base.isServer)
@ -1094,7 +1123,7 @@ public class BuildingBlock : StabilityEntity
bool flag = msg.read.Bool();
if (HasWallpaper((!flag) ? 1 : 0))
{
Item item = ItemManager.Create(WallpaperPlanner.WallpaperItemDef, 1, flag ? wallpaperID : wallpaperID2);
Item item = ItemManager.Create(WallpaperPlanner.Settings.PlacementPrice.itemDef, (int)WallpaperPlanner.Settings.PlacementPrice.amount, 0uL);
msg.player.GiveItem(item, GiveItemReason.PickedUp);
RemoveWallpaper((!flag) ? 1 : 0);
}
@ -1125,7 +1154,7 @@ public class BuildingBlock : StabilityEntity
public override void StabilityCheck()
{
base.StabilityCheck();
if (HasWallpaper(1))
if (HasWallpaper())
{
Invoke(CheckWallpaper, 0.5f);
}
@ -1134,7 +1163,7 @@ public class BuildingBlock : StabilityEntity
public override void OnDecay(Decay decay, float decayDeltaTime)
{
base.OnDecay(decay, decayDeltaTime);
if (HasWallpaper(1))
if (HasWallpaper())
{
CheckWallpaper();
}
@ -1142,40 +1171,93 @@ public class BuildingBlock : StabilityEntity
public void CheckWallpaper()
{
Construction construction = WallpaperPlanner.Settings?.GetConstruction(this);
if (!(construction == null) && SocketMod_Inside.IsOutside(base.transform.position + construction.deployOffset.localPosition + base.transform.right * 0.2f, base.transform))
if (Creative.allUsers && Creative.freePlacement)
{
RemoveWallpaper(1);
return;
}
int side = WallpaperPlanner.Settings.GetSideThatMustBeInside(this);
if (side == -1 || !HasWallpaper(side))
{
return;
}
Construction construction = WallpaperPlanner.Settings?.GetConstruction(this, 0);
if (construction == null)
{
construction = WallpaperPlanner.Settings?.GetConstruction(this, 1);
if (construction == null)
{
return;
}
}
Socket_Base socket_Base = PrefabAttribute.server.FindAll<Socket_Base>(prefabID).FirstOrDefault((Socket_Base s) => s.socketName.Contains("wallpaper") && s.socketName.EndsWith((side == 0) ? "1" : "2"));
if (socket_Base == null)
{
return;
}
SocketMod[] array = PrefabAttribute.server.FindAll<SocketMod>(construction.prefabID);
for (int num = 0; num < array.Length; num++)
{
if (array[num] is SocketMod_Inside socketMod_Inside)
{
Construction.Placement place = new Construction.Placement(default(Construction.Target));
place.position = base.transform.position + base.transform.rotation * socket_Base.localPosition;
place.rotation = base.transform.rotation * socket_Base.localRotation;
if (!socketMod_Inside.DoCheck(place))
{
RemoveWallpaper(side);
break;
}
}
}
}
public bool CanSeeWallpaperSocket(BasePlayer player, int side = 0)
{
Construction construction = WallpaperPlanner.Settings?.GetConstruction(this);
if (player == null)
{
return false;
}
Construction construction = WallpaperPlanner.Settings?.GetConstruction(this, side);
if (construction == null)
{
return false;
}
Vector3 position = base.transform.position;
Vector3 vector = construction.deployOffset?.localPosition ?? Vector3.zero;
if (side == 1)
Vector3 center = player.eyes.center;
Vector3 position = player.eyes.position;
if (!GamePhysics.LineOfSightRadius(center, position, 2162688, 0f))
{
vector.x = 0f - vector.x;
return false;
}
Vector3 vector2 = position + base.transform.rotation * vector - player.eyes.HeadRay().origin;
List<RaycastHit> obj = Facepunch.Pool.Get<List<RaycastHit>>();
GamePhysics.TraceAll(new Ray(player.eyes.HeadRay().origin, vector2.normalized), 0f, obj, vector2.magnitude, 2097152, QueryTriggerInteraction.Ignore);
bool result = true;
foreach (RaycastHit item in obj)
Socket_Base socket_Base = PrefabAttribute.server.FindAll<Socket_Base>(prefabID).FirstOrDefault((Socket_Base s) => s.socketName.Contains("wallpaper") && s.socketName.EndsWith((side == 0) ? "1" : "2"));
if (socket_Base == null)
{
BaseEntity baseEntity = item.transform.ToBaseEntity();
if (!(baseEntity == null) && baseEntity == this)
return false;
}
Vector3 vector = construction.deployOffset?.localPosition ?? Vector3.zero;
Vector3 vector2 = socket_Base.rotation * vector;
Vector3 vector3 = base.transform.position + base.transform.rotation * vector2;
bool flag = false;
Vector3 vector4 = vector3 - player.eyes.HeadRay().origin;
if (!UnityEngine.Physics.Raycast(new Ray(player.eyes.HeadRay().origin, vector4.normalized), vector4.magnitude, 2097152))
{
flag = true;
}
if (!flag && construction.HasAlternativeLOSChecks())
{
Vector3[] alternativeLOSPositions = construction.alternativeLOSPositions;
foreach (Vector3 vector5 in alternativeLOSPositions)
{
result = false;
Vector3 vector6 = base.transform.position + base.transform.rotation * socket_Base.localPosition;
Quaternion quaternion = base.transform.rotation * socket_Base.localRotation;
Vector3 direction = vector6 + quaternion * vector5 - center;
if (!UnityEngine.Physics.Raycast(center, direction, direction.magnitude, 2097152))
{
flag = true;
break;
}
}
}
Facepunch.Pool.FreeUnmanaged(ref obj);
return result;
return flag;
}
public override bool CanPickup(BasePlayer player)

View file

@ -13,4 +13,6 @@ public class BuildingBlockedGuide : MonoBehaviour
public MeshFilter Filter;
public Collider LargestVolume;
public float OverrideEnableDistance;
}

View file

@ -487,7 +487,7 @@ public class BuildingPrivlidge : StorageContainer
public void RPC_Rotate(RPCMessage msg)
{
BasePlayer player = msg.player;
if (player.CanBuild() && (bool)player.GetHeldEntity() && player.GetHeldEntity().GetComponent<Hammer>() != null && (GetSlot(Slot.Lock) == null || !GetSlot(Slot.Lock).IsLocked()) && !HasAttachedStorageAdaptor())
if (player.CanBuild() && (bool)player.GetHeldEntity() && player.GetHeldEntity().GetComponent<Hammer>() != null && (GetSlot(Slot.Lock) == null || !GetSlot(Slot.Lock).IsLocked()) && !HasAttachedStorageAdaptor() && !HasAttachedStorageMonitor())
{
base.transform.rotation = Quaternion.LookRotation(-base.transform.forward, base.transform.up);
SendNetworkUpdate();
@ -670,7 +670,7 @@ public class BuildingPrivlidge : StorageContainer
{
if (ConVar.Decay.upkeep_grief_protection > 0f)
{
PurchaseUpkeepTime(ConVar.Decay.upkeep_grief_protection * 60f);
PurchaseAntiGriefTime(ConVar.Decay.upkeep_grief_protection * 60f);
}
base.Die(info);
}
@ -695,6 +695,19 @@ public class BuildingPrivlidge : StorageContainer
public override void DecayTick()
{
BuildingBlock nearbyBuildingBlock = GetNearbyBuildingBlock();
if (nearbyBuildingBlock != null)
{
BuildingManager.Building building = nearbyBuildingBlock.GetBuilding();
if (building != null && building.ID != buildingID)
{
AttachToBuilding(building.ID);
}
}
else
{
Kill(DestroyMode.Gib);
}
if (EnsurePrimary())
{
base.DecayTick();
@ -905,6 +918,29 @@ public class BuildingPrivlidge : StorageContainer
}
}
public void PurchaseAntiGriefTime(float deltaTime)
{
BuildingManager.Building building = GetBuilding();
if (building == null || !building.HasDecayEntities())
{
return;
}
foreach (DecayEntity decayEntity in building.decayEntities)
{
float protectedSeconds = decayEntity.GetProtectedSeconds();
float num = Mathf.Max(0f, deltaTime - protectedSeconds);
if (num > 0f)
{
float time = PurchaseUpkeepTime(decayEntity, num);
decayEntity.AddUpkeepTime(time);
if (IsDebugging())
{
Debug.Log(ToString() + " purchased upkeep time for " + decayEntity.ToString() + ": " + protectedSeconds + " + " + time + " = " + decayEntity.GetProtectedSeconds());
}
}
}
}
public static string FormatUpkeepMinutes(float minutes)
{
int num = Mathf.FloorToInt(minutes / 60f);

View file

@ -329,6 +329,12 @@ public class CH47HelicopterAIController : CH47Helicopter
}
}
public override void AdminKill()
{
DismountAllPlayers();
base.AdminKill();
}
public void SetAltitudeProtection(bool on)
{
altitudeProtection = on;

View file

@ -542,7 +542,7 @@ public class Catapult : BaseSiegeWeapon
animator.SetFloat("Reload", reloadProgress);
switch (ammo)
{
case 4:
case 5:
StartCoroutine(SpawnAndMountBotPlayer());
break;
default:
@ -560,6 +560,9 @@ public class Catapult : BaseSiegeWeapon
case 3:
itemToCreate = ItemManager.FindItemDefinition("catapult.ammo.explosive");
break;
case 4:
itemToCreate = ItemManager.FindItemDefinition("catapult.ammo.bee");
break;
}
ammoStorageRef.Get(base.isServer).inventory.AddItem(itemToCreate, 1, 0uL);
break;
@ -638,7 +641,7 @@ public class Catapult : BaseSiegeWeapon
return;
}
int value = arg.GetInt(0, 1);
value = Mathf.Clamp(value, 0, 4);
value = Mathf.Clamp(value, 0, 5);
Catapult[] array = Util.FindAll<Catapult>();
int num = 0;
Catapult[] array2 = array;

View file

@ -10,4 +10,13 @@ public class CatapultAmmoContainer : StorageContainer
base.OnItemAddedOrRemoved(item, added);
catapult.UpdateLoadedAmmo(item, added);
}
public override bool CanBeLooted(BasePlayer player)
{
if (catapult != null)
{
return catapult.CanBeLooted(player);
}
return false;
}
}

View file

@ -320,6 +320,12 @@ public class Chainsaw : BaseMelee
SetEngineStatus(status: false);
}
SendNetworkUpdate();
MarkChainsawItemDirty();
}
private void MarkChainsawItemDirty()
{
GetItem()?.MarkDirty();
}
[RPC_Server]
@ -336,6 +342,7 @@ public class Chainsaw : BaseMelee
ammo += num;
item.UseItem(num);
}
MarkChainsawItemDirty();
SendNetworkUpdateImmediate();
ItemManager.DoRemoves();
ownerPlayer.inventory.ServerUpdate(0f);
@ -445,12 +452,14 @@ public class Chainsaw : BaseMelee
if (num > 0)
{
ammo = 0;
item.MarkDirty();
SendNetworkUpdateImmediate();
Item item2 = ItemManager.Create(fuelType, num, 0uL);
if (!item2.MoveToContainer(player.inventory.containerMain))
{
item2.Drop(player.GetDropPosition(), player.GetDropVelocity());
}
MarkChainsawItemDirty();
}
}

View file

@ -41,6 +41,8 @@ public class ChangeSignText : UIDialog
public RustSlider brushOpacitySlider;
public GameObject chatToggleButton;
[Header("Layout")]
public FlexElement rootElement;

View file

@ -54,7 +54,7 @@ public class ChickenCoop : StorageContainer
public const Flags Hatching = Flags.Reserved1;
public const Flags Full = Flags.Reserved2;
public const Flags Full = Flags.Reserved3;
public const int EggInsertSlot = 0;
@ -183,7 +183,7 @@ public class ChickenCoop : StorageContainer
[RPC_Server.IsVisible(3f)]
private void SubmitEggForHatching()
{
if (HasFlag(Flags.Reserved2) || HasFlag(Flags.Reserved1))
if (HasFlag(Flags.Reserved3) || HasFlag(Flags.Reserved1))
{
return;
}
@ -196,7 +196,7 @@ public class ChickenCoop : StorageContainer
TimeUntilHatch = ChickenHatchTimeMinutes * 60f
});
SetFlag(Flags.Reserved1, b: true);
SetFlag(Flags.Reserved2, Animals.Count >= MaxChickens);
SetFlag(Flags.Reserved3, Animals.Count >= MaxChickens);
if (!IsInvoking(CheckEggHatchState))
{
InvokeRepeating(CheckEggHatchState, 10f, 10f);
@ -338,7 +338,7 @@ public class ChickenCoop : StorageContainer
item.SpawnedAnimal.Set(entity);
Animals.Add(item);
}
SetFlag(Flags.Reserved2, b: true);
SetFlag(Flags.Reserved3, b: true);
}
[RPC_Server]
@ -376,7 +376,7 @@ public class ChickenCoop : StorageContainer
break;
}
}
SetFlag(Flags.Reserved2, Animals.Count >= MaxChickens, recursive: false, networkupdate: false);
SetFlag(Flags.Reserved3, Animals.Count >= MaxChickens, recursive: false, networkupdate: false);
SendNetworkUpdate();
}

View file

@ -0,0 +1,218 @@
#define UNITY_ASSERTIONS
using System;
using ConVar;
using Facepunch;
using Network;
using ProtoBuf;
using UnityEngine;
using UnityEngine.Assertions;
public class CommandBlock : IOEntity
{
public GameObjectRef commandPanelPrefab;
[HideInInspector]
public string currentCommand;
private int currentPower;
private ulong lastPlayerID;
private static readonly Translate.Phrase disabledErrorPhrase = new Translate.Phrase("commandblock.disabled.error", "Command blocks are currently disabled");
[ServerVar(Help = "Can command blocks execute commands")]
public static bool commands_enabled = false;
[ServerVar(Help = "If enabled, commands from command blocks will run using the last player who set them, allowing for a wider range of commands to be used")]
public static bool use_player = false;
[ServerVar(Help = "Print a log message when a command block is executed")]
public static bool log_executions = true;
public override bool OnRpcMessage(BasePlayer player, uint rpc, Message msg)
{
using (TimeWarning.New("CommandBlock.OnRpcMessage"))
{
if (rpc == 1558722905 && player != null)
{
Assert.IsTrue(player.isServer, "SV_RPC Message is using a clientside player!");
if (Global.developer > 2)
{
Debug.Log("SV_RPCMessage: " + player?.ToString() + " - RPC_SetCommand ");
}
using (TimeWarning.New("RPC_SetCommand"))
{
using (TimeWarning.New("Conditions"))
{
if (!RPC_Server.CallsPerSecond.Test(1558722905u, "RPC_SetCommand", this, player, 5uL))
{
return true;
}
if (!RPC_Server.IsVisible.Test(1558722905u, "RPC_SetCommand", this, player, 3f))
{
return true;
}
}
try
{
using (TimeWarning.New("Call"))
{
RPCMessage msg2 = new RPCMessage
{
connection = msg.connection,
player = player,
read = msg.read
};
RPC_SetCommand(msg2);
}
}
catch (Exception exception)
{
Debug.LogException(exception);
player.Kick("RPC Error in RPC_SetCommand");
}
}
return true;
}
if (rpc == 1052196345 && player != null)
{
Assert.IsTrue(player.isServer, "SV_RPC Message is using a clientside player!");
if (Global.developer > 2)
{
Debug.Log("SV_RPCMessage: " + player?.ToString() + " - SERVER_RequestOpenPanel ");
}
using (TimeWarning.New("SERVER_RequestOpenPanel"))
{
using (TimeWarning.New("Conditions"))
{
if (!RPC_Server.CallsPerSecond.Test(1052196345u, "SERVER_RequestOpenPanel", this, player, 3uL))
{
return true;
}
if (!RPC_Server.IsVisible.Test(1052196345u, "SERVER_RequestOpenPanel", this, player, 3f))
{
return true;
}
if (!RPC_Server.MaxDistance.Test(1052196345u, "SERVER_RequestOpenPanel", this, player, 3f))
{
return true;
}
}
try
{
using (TimeWarning.New("Call"))
{
RPCMessage msg3 = new RPCMessage
{
connection = msg.connection,
player = player,
read = msg.read
};
SERVER_RequestOpenPanel(msg3);
}
}
catch (Exception exception2)
{
Debug.LogException(exception2);
player.Kick("RPC Error in SERVER_RequestOpenPanel");
}
}
return true;
}
}
return base.OnRpcMessage(player, rpc, msg);
}
public override void Load(LoadInfo info)
{
base.Load(info);
if (info.msg.commandBlock != null)
{
currentCommand = info.msg.commandBlock.currentCommand;
}
}
public override void Save(SaveInfo info)
{
base.Save(info);
if (info.forDisk)
{
if (info.msg.commandBlock == null)
{
info.msg.commandBlock = Facepunch.Pool.Get<ProtoBuf.CommandBlock>();
}
info.msg.commandBlock.currentCommand = currentCommand;
}
}
public override void IOStateChanged(int inputAmount, int inputSlot)
{
base.IOStateChanged(inputAmount, inputSlot);
if (!commands_enabled)
{
currentPower = inputAmount;
return;
}
if (inputAmount == 0 || currentPower > 0)
{
currentPower = inputAmount;
return;
}
if (string.IsNullOrEmpty(currentCommand))
{
currentPower = inputAmount;
return;
}
if (log_executions)
{
Debug.Log("Executing \"" + currentCommand + "\" via CommandBlock");
}
ConsoleSystem.Option options = ConsoleSystem.Option.Server;
if (use_player)
{
BasePlayer basePlayer = BasePlayer.FindByID(lastPlayerID);
if (basePlayer != null && basePlayer.Connection != null)
{
options = ConsoleSystem.Option.Server.FromConnection(basePlayer.Connection);
}
}
ConsoleSystem.Run(options, currentCommand);
currentPower = inputAmount;
}
public override int ConsumptionAmount()
{
return 0;
}
[RPC_Server]
[RPC_Server.IsVisible(3f)]
[RPC_Server.MaxDistance(3f)]
[RPC_Server.CallsPerSecond(3uL)]
public void SERVER_RequestOpenPanel(RPCMessage msg)
{
BasePlayer player = msg.player;
if (!(player == null) && (player.IsAdmin || player.IsDeveloper))
{
if (!commands_enabled)
{
player.ShowToast(GameTip.Styles.Error, disabledErrorPhrase, true);
}
ClientRPC(RpcTarget.Player("CLIENT_OpenPanel", player), currentCommand);
}
}
[RPC_Server]
[RPC_Server.IsVisible(3f)]
[RPC_Server.CallsPerSecond(5uL)]
public void RPC_SetCommand(RPCMessage msg)
{
BasePlayer player = msg.player;
if (!(player == null) && (player.IsAdmin || player.IsDeveloper))
{
string text = msg.read.String();
currentCommand = text;
lastPlayerID = player.userID.Get();
}
}
}

View file

@ -0,0 +1,4 @@
public class CommandBlockConfig : IOConfig<CommandBlock>
{
private string _currentCommand;
}

View file

@ -165,7 +165,7 @@ public class Admin : ConsoleSystem
if (!flag && text.Length == 0)
{
text2 = text2 + "hostname: " + Server.hostname + "\n";
text2 = text2 + "version : " + 2588 + " secure (secure mode enabled, connected to Steam3)\n";
text2 = text2 + "version : " + 2590 + " secure (secure mode enabled, connected to Steam3)\n";
text2 = text2 + "map : " + Server.level + "\n";
text2 += $"players : {BasePlayer.activePlayerList.Count()} ({Server.maxplayers} max) ({SingletonComponent<ServerMgr>.Instance.connectionQueue.Queued} queued) ({SingletonComponent<ServerMgr>.Instance.connectionQueue.Joining} joining)\n\n";
}
@ -339,12 +339,12 @@ public class Admin : ConsoleSystem
}
}
[ServerVar(Help = "add_wallpaper_radius 'wallpaper' 'radius'")]
[ServerVar(Help = "<name/id> <radius> | Use print_wallpaper_skins for a list | 0 -> default, -1 -> random")]
public static void add_wallpaper_radius(Arg arg)
{
if (!arg.HasArgs(2))
{
arg.ReplyWith("Format is 'add_wallpaper_radius {skin} {radius}'");
arg.ReplyWith("Format is 'add_wallpaper_radius {skin} {radius}' | Use print_wallpaper_skins for a list | 0 -> default, -1 -> random");
}
else
{
@ -352,12 +352,12 @@ public class Admin : ConsoleSystem
}
}
[ServerVar(Help = "change_wallpaper_radius 'wallpaper' 'radius'")]
[ServerVar(Help = "<name/id> <radius> | Use print_wallpaper_skins for a list | 0 -> default, -1 -> random")]
public static void change_wallpaper_radius(Arg arg)
{
if (!arg.HasArgs(2))
{
arg.ReplyWith("Format is 'change_wallpaper_radius {skin} {radius}'");
arg.ReplyWith("Format is 'change_wallpaper_radius {skin} {radius}' | Use print_wallpaper_skins for a list | 0 -> default, -1 -> random");
}
else
{
@ -365,7 +365,7 @@ public class Admin : ConsoleSystem
}
}
[ServerVar(Help = "clear_wallpaper_radius 'radius'")]
[ServerVar(Help = "clear_wallpaper_radius <radius>")]
public static void clear_wallpaper_radius(Arg arg)
{
if (!arg.HasArgs())
@ -532,19 +532,20 @@ public class Admin : ConsoleSystem
skinIdParsed = -1;
}
bool flag = false;
ItemSkinDirectory.Skin[] skins = WallpaperPlanner.WallpaperItemDef.skins;
for (int i = 0; i < skins.Length; i++)
string foundSkinName = "";
foreach (ItemSkinDirectory.Skin item in WallpaperSettings.WallpaperItemDef.skins.Concat(WallpaperSettings.FlooringItemDef.skins).Concat(WallpaperSettings.CeilingItemDef.skins))
{
ItemSkinDirectory.Skin skin = skins[i];
if (skinIdParsed != -1 && skin.id == skinIdParsed)
if (skinIdParsed != -1 && item.id == skinIdParsed)
{
flag = true;
foundSkinName = item.invItem.displayName.english.Trim();
break;
}
if (skinIdParsed == -1 && (skin.invItem.displayName.english.Contains(text, StringComparison.InvariantCultureIgnoreCase) || skin.invItem.name.Contains(text, StringComparison.InvariantCultureIgnoreCase)))
if (skinIdParsed == -1 && (item.invItem.displayName.english.Contains(text, StringComparison.InvariantCultureIgnoreCase) || item.invItem.name.Contains(text, StringComparison.InvariantCultureIgnoreCase)))
{
flag = true;
skinIdParsed = skin.id;
foundSkinName = item.invItem.displayName.english.Trim();
skinIdParsed = item.id;
break;
}
}
@ -560,37 +561,90 @@ public class Admin : ConsoleSystem
RunInRadius(radius, basePlayer, delegate(BuildingBlock block)
{
bool flag2 = block.HasWallpaper();
bool flag3 = flag2;
if (addIfMissing && !flag2)
{
flag2 = false;
Socket_Base[] array = PrefabAttribute.server.FindAll<Socket_Base>(block.prefabID);
for (int j = 0; j < array.Length; j++)
{
if (array[j] is Socket_Specific_Female socket_Specific_Female && socket_Specific_Female.socketName.Contains("wallpaper"))
{
flag2 = true;
break;
}
}
flag3 = WallpaperPlanner.Settings.CanUseWallpaper(block);
}
if (block.HasWallpaper() || flag2)
if (block.HasWallpaper() || flag3)
{
if (skinIdParsed == -1)
{
int id = WallpaperPlanner.WallpaperItemDef.skins.GetRandom().id;
block.SetWallpaper((ulong)id);
block.SetWallpaper((ulong)id, 1);
arg.ReplyWith("Applying random wallpaper");
for (int i = 0; i < 2; i++)
{
ItemDefinition wallpaperItem = WallpaperPlanner.Settings.GetWallpaperItem(block, i);
if (wallpaperItem != null)
{
int id = wallpaperItem.skins.GetRandom().id;
block.SetWallpaper((ulong)id, i);
}
}
}
else if (skinIdParsed == 0)
{
arg.ReplyWith("Applying default wallpaper");
block.SetWallpaper(0uL);
block.SetWallpaper(0uL, 1);
}
else
{
block.SetWallpaper((ulong)skinIdParsed);
block.SetWallpaper((ulong)skinIdParsed, 1);
arg.ReplyWith("Applying '" + foundSkinName + "' wallpaper to compatible blocks");
for (int j = 0; j < 2; j++)
{
ItemDefinition wallpaperItem2 = WallpaperPlanner.Settings.GetWallpaperItem(block, j);
if (wallpaperItem2 != null && wallpaperItem2.skins.Any((ItemSkinDirectory.Skin x) => x.id == skinIdParsed))
{
block.SetWallpaper((ulong)skinIdParsed, j);
}
}
}
block.CheckWallpaper();
}
});
}
[ServerVar(Help = "Lists all wallpaper skins")]
public static void print_wallpaper_skins(Arg arg)
{
TextTable textTable = new TextTable();
textTable.AddColumns("Id", "Type", "Name");
ItemSkinDirectory.Skin[] skins = WallpaperSettings.WallpaperItemDef.skins;
for (int i = 0; i < skins.Length; i++)
{
ItemSkinDirectory.Skin skin = skins[i];
string[] array = new string[3];
int id = skin.id;
array[0] = id.ToString();
array[1] = "Wall";
array[2] = skin.invItem.displayName.english.Trim();
textTable.AddRow(array);
}
skins = WallpaperSettings.FlooringItemDef.skins;
for (int i = 0; i < skins.Length; i++)
{
ItemSkinDirectory.Skin skin2 = skins[i];
string[] array2 = new string[3];
int id = skin2.id;
array2[0] = id.ToString();
array2[1] = "Floor";
array2[2] = skin2.invItem.displayName.english.Trim();
textTable.AddRow(array2);
}
skins = WallpaperSettings.CeilingItemDef.skins;
for (int i = 0; i < skins.Length; i++)
{
ItemSkinDirectory.Skin skin3 = skins[i];
string[] array3 = new string[3];
int id = skin3.id;
array3[0] = id.ToString();
array3[1] = "Ceiling";
array3[2] = skin3.invItem.displayName.english.Trim();
textTable.AddRow(array3);
}
arg.ReplyWith(textTable.ToString());
}
[ServerVar]
public static void killplayer(Arg arg)
{
@ -1290,17 +1344,23 @@ public class Admin : ConsoleSystem
{
return "Player is not in a team";
}
TextTable textTable = new TextTable();
bool flag = arg.HasArg("--json");
TextTable textTable = new TextTable(!flag);
textTable.ResizeColumns(4);
textTable.AddColumn("steamID");
textTable.AddColumn("username");
textTable.AddColumn("online");
textTable.AddColumn("leader");
textTable.ResizeRows(playerTeam.members.Count);
foreach (ulong memberId in playerTeam.members)
{
bool flag = Network.Net.sv.connections.FirstOrDefault((Connection c) => c.connected && c.userid == memberId) != null;
textTable.AddRow(memberId.ToString(), GetPlayerName(memberId), flag ? "x" : "", (memberId == playerTeam.teamLeader) ? "x" : "");
bool flag2 = Network.Net.sv.connections.FirstOrDefault((Connection c) => c.connected && c.userid == memberId) != null;
textTable.AddValue(memberId);
textTable.AddValue(GetPlayerName(memberId));
textTable.AddValue(flag2 ? "x" : "");
textTable.AddValue((memberId == playerTeam.teamLeader) ? "x" : "");
}
if (!arg.HasArg("--json"))
if (!flag)
{
return $"ID: {playerTeam.teamID}\n\n{textTable}";
}
@ -1822,7 +1882,7 @@ public class Admin : ConsoleSystem
NetworkOut = (int)((Network.Net.sv != null) ? Network.Net.sv.GetStat(null, BaseNetwork.StatTypeLong.BytesSent_LastSecond) : 0),
Restarting = SingletonComponent<ServerMgr>.Instance.Restarting,
SaveCreatedTime = SaveRestore.SaveCreatedTime.ToString(),
Version = 2588,
Version = 2590,
Protocol = Protocol.printable
};
}
@ -1932,6 +1992,11 @@ public class Admin : ConsoleSystem
if (uGCType == UGCType.PatternBoomer)
{
flag = true;
PatternFirework patternFirework = component as PatternFirework;
if (patternFirework != null && patternFirework.Design == null)
{
flag = false;
}
}
if (uGCType == UGCType.VendingMachine && !string.IsNullOrEmpty(text))
{
@ -2002,7 +2067,7 @@ public class Admin : ConsoleSystem
{
NetworkableId entityID = arg.GetEntityID(0);
BaseNetworkable baseNetworkable = BaseNetworkable.serverEntities.Find(entityID);
if (baseNetworkable != null && baseNetworkable is PatternFirework patternFirework)
if (baseNetworkable != null && baseNetworkable is PatternFirework { Design: not null } patternFirework)
{
SendInfo sendInfo = new SendInfo(arg.Connection);
sendInfo.channel = 2;

View file

@ -467,6 +467,9 @@ public class AntiHack : ConsoleSystem
[Help("How far a player is allowed to move in forgiveness scenarios")]
public static float tick_distance_forgiveness = 5f;
[ServerVar(Help = "Should explosives parented to vehicles damage deployables")]
public static bool explosive_vehicle_parent_damage_deployables = false;
[ServerVar]
[Help("How long, in seconds, can the clients progress timer deviate from the servers")]
public static float rpc_timer_forgiveness = 1f;

View file

@ -3,19 +3,19 @@ namespace ConVar;
[Factory("batching")]
public class Batching : ConsoleSystem
{
[ClientVar]
[ClientVar(ClientAdmin = true)]
public static bool renderers = true;
[ClientVar]
[ClientVar(ClientAdmin = true)]
public static bool renderer_threading = true;
[ClientVar]
[ClientVar(ClientAdmin = true)]
public static int renderer_capacity = 30000;
[ClientVar]
[ClientVar(ClientAdmin = true)]
public static int renderer_vertices = 1000;
[ClientVar]
[ClientVar(ClientAdmin = true)]
public static int renderer_submeshes = 1;
[ServerVar]

View file

@ -678,6 +678,39 @@ public class Debugging : ConsoleSystem
}
}
[ServerVar(Help = "Spawns one of every deployable in a grid")]
public static void spawn_all_deployables(Arg arg)
{
BasePlayer basePlayer = arg.Player();
if (basePlayer == null || (!basePlayer.IsAdmin && !basePlayer.IsDeveloper))
{
arg.ReplyWith("Must be called by admin player");
return;
}
arg.ReplyWith("Spawning all deployables");
bool stability = Server.stability;
Server.stability = false;
try
{
Vector3 position = basePlayer.transform.position;
List<ItemModDeployable> list = (from x in ItemManager.itemList
where x.GetComponent<ItemModDeployable>() != null && x.shortname != "legacy.shelter.wood"
select x.GetComponent<ItemModDeployable>()).ToList();
int num = 12;
float num2 = Mathf.Ceil(Mathf.Sqrt(list.Count));
float num3 = num2 * (float)num / 2f;
for (int num4 = 0; num4 < list.Count; num4++)
{
Vector3 pos = new Vector3(position.x - num3 + (float)num * ((float)num4 % num2), position.y, position.z - num3 + (float)num * Mathf.Floor((float)num4 / num2));
GameManager.server.CreateEntity(list[num4].entityPrefab.resourcePath, pos)?.Spawn();
}
}
finally
{
Server.stability = stability;
}
}
[ServerVar(Help = "Spawn lots of IO entities to lag the server")]
public static void bench_io(Arg arg)
{
@ -1025,4 +1058,19 @@ public class Debugging : ConsoleSystem
}
arg.ReplyWith($"Respawned {num2} trees in {num}m, {num3} were blocked by players");
}
[ServerVar]
public static void conveyorStrictModeReport(Arg arg)
{
StringBuilder stringBuilder = new StringBuilder();
IndustrialConveyor[] array = BaseEntity.Util.FindAll<IndustrialConveyor>();
foreach (IndustrialConveyor industrialConveyor in array)
{
if (industrialConveyor.strictMode)
{
stringBuilder.AppendLine($"{industrialConveyor.transform.position}");
}
}
arg.ReplyWith(stringBuilder.ToString());
}
}

View file

@ -466,4 +466,9 @@ public class Entity : ConsoleSystem
electricBattery.SetCharge(num);
arg.ReplyWith($"Set battery charge to {num}");
}
[ServerVar(EditorOnly = true)]
public static void test_pooling(Arg args)
{
}
}

View file

@ -37,6 +37,10 @@ public class GraphicsSettings : ConsoleSystem
set
{
QualitySettings.globalTextureMipmapLimit = Mathf.Clamp(value, 0, 3);
if (SingletonComponent<FoliageGrid>.Instance != null)
{
SingletonComponent<FoliageGrid>.Instance.OnGlobalTextureMipmapLimitChange();
}
}
}

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Facepunch.Extend;
using UnityEngine;
namespace ConVar;
@ -20,6 +21,122 @@ public class Profile : ConsoleSystem
private const string PerfSnapshot_StreamHelp = "profile.perfsnapshot_stream [name='Profile', str, no extension, max 32chars] [MainCap=32, int, max 256, buffer size for Main thread in Megabytes] [WorkerCap=8, int, max 256, buffer size for each Worker thread in Megabytes] [debug=false, dumps a binary snapshot as well]\nWill stream <mainCap>MB worth of data and generate a JSON snapshot that can be viewed in Perfetto or similar tools";
private const string WatchAllocsHelp = "Params: [Name = 'Allocs'] [maxStackDepth = 16].\nStarts tracking of allocs, dumping a [Name].json.gz record once conditions are met";
private static uint notifyOnTotalAllocCount = 16000u;
private static uint notifyOnTotalMemKB = 12288u;
private static uint notifyOnMainAllocCount = 0u;
private static uint notifyOnMainMemKB = 0u;
private static uint notifyOnWorkerAllocCount = 0u;
private static uint notifyOnWorkerMemKB = 0u;
[ServerVar]
public static int NotifyOnTotalAllocCount
{
get
{
return (int)notifyOnTotalAllocCount;
}
set
{
if (notifyOnTotalAllocCount != value)
{
notifyOnTotalAllocCount = (uint)value;
ServerProfiler.Native.SetContinuousProfilerNotifySettings(ServerProfiler.NotifyMetric.TotalAllocCount, notifyOnTotalAllocCount);
}
}
}
[ServerVar]
public static int NotifyOnTotalMemKB
{
get
{
return (int)notifyOnTotalMemKB;
}
set
{
if (notifyOnTotalMemKB != value)
{
notifyOnTotalMemKB = (uint)value;
ServerProfiler.Native.SetContinuousProfilerNotifySettings(ServerProfiler.NotifyMetric.TotalMem, notifyOnTotalMemKB * 1024);
}
}
}
[ServerVar]
public static int NotifyOnMainAllocCount
{
get
{
return (int)notifyOnMainAllocCount;
}
set
{
if (notifyOnMainAllocCount != value)
{
notifyOnMainAllocCount = (uint)value;
ServerProfiler.Native.SetContinuousProfilerNotifySettings(ServerProfiler.NotifyMetric.MainAllocCount, notifyOnMainAllocCount);
}
}
}
[ServerVar]
public static int NotifyOnMainMemKB
{
get
{
return (int)notifyOnMainMemKB;
}
set
{
if (notifyOnMainMemKB != value)
{
notifyOnMainMemKB = (uint)value;
ServerProfiler.Native.SetContinuousProfilerNotifySettings(ServerProfiler.NotifyMetric.MainMem, notifyOnMainMemKB * 1024);
}
}
}
[ServerVar]
public static int NotifyOnWorkerAllocCount
{
get
{
return (int)notifyOnWorkerAllocCount;
}
set
{
if (notifyOnWorkerAllocCount != value)
{
notifyOnWorkerAllocCount = (uint)value;
ServerProfiler.Native.SetContinuousProfilerNotifySettings(ServerProfiler.NotifyMetric.WorkerAllocCount, notifyOnWorkerAllocCount);
}
}
}
[ServerVar]
public static int NotifyOnWorkerMemKB
{
get
{
return (int)notifyOnWorkerMemKB;
}
set
{
if (notifyOnWorkerMemKB != value)
{
notifyOnWorkerMemKB = (uint)value;
ServerProfiler.Native.SetContinuousProfilerNotifySettings(ServerProfiler.NotifyMetric.WorkerMem, notifyOnWorkerMemKB * 1024);
}
}
}
private static void NeedProfileFolder()
{
if (!Directory.Exists("profile"))
@ -86,6 +203,7 @@ public class Profile : ConsoleSystem
exportDone = true;
});
});
arg.ReplyWith("ServerProfiler is recording a perf snapshot");
return;
}
Chat.Broadcast($"Server will be taking a perf snapshot, expect stutters in {delay} seconds", "SERVER", "#eee", 0uL);
@ -121,6 +239,7 @@ public class Profile : ConsoleSystem
}
};
InvokeHandler.InvokeRepeating(SingletonComponent<InvokeHandler>.Instance, delayedTakeSnapshot, 0f, 1f);
arg.ReplyWith("ServerProfiler will record a perf snapshot after a delay");
}
[ServerVar(Help = "profile.perfsnapshot_stream [name='Profile', str, no extension, max 32chars] [MainCap=32, int, max 256, buffer size for Main thread in Megabytes] [WorkerCap=8, int, max 256, buffer size for each Worker thread in Megabytes] [debug=false, dumps a binary snapshot as well]\nWill stream <mainCap>MB worth of data and generate a JSON snapshot that can be viewed in Perfetto or similar tools")]
@ -161,5 +280,56 @@ public class Profile : ConsoleSystem
exportDone = true;
});
});
arg.ReplyWith("ServerProfiler started recording a perf stream snapshot");
}
[ServerVar(Help = "Params: [Name = 'Allocs'] [maxStackDepth = 16].\nStarts tracking of allocs, dumping a [Name].json.gz record once conditions are met")]
public static void WatchAllocs(Arg arg)
{
if (!ServerProfiler.IsEnabled())
{
arg.ReplyWith("ServerProfiler is disabled");
return;
}
if (ServerProfiler.IsRunning)
{
arg.ReplyWith("ServerProfiler is busy with a previous task");
return;
}
ServerProfiler.Native.SetContinuousProfilerNotifySettings(ServerProfiler.NotifyMetric.TotalAllocCount, notifyOnTotalAllocCount);
ServerProfiler.Native.SetContinuousProfilerNotifySettings(ServerProfiler.NotifyMetric.TotalMem, notifyOnTotalMemKB * 1024);
ServerProfiler.Native.SetContinuousProfilerNotifySettings(ServerProfiler.NotifyMetric.MainAllocCount, notifyOnMainAllocCount);
ServerProfiler.Native.SetContinuousProfilerNotifySettings(ServerProfiler.NotifyMetric.MainMem, notifyOnMainMemKB * 1024);
ServerProfiler.Native.SetContinuousProfilerNotifySettings(ServerProfiler.NotifyMetric.WorkerAllocCount, notifyOnWorkerAllocCount);
ServerProfiler.Native.SetContinuousProfilerNotifySettings(ServerProfiler.NotifyMetric.WorkerMem, notifyOnWorkerMemKB * 1024);
string name = arg.GetString(0, "Allocs");
ServerProfiler.StartContinuousRecording((byte)arg.GetInt(1, 16), delegate(IList<ServerProfiler.Profile> profiles, ServerProfiler.MemoryState memState)
{
Task.Run(delegate
{
if (ProfileExporter.JSON.Export(name, profiles, memState))
{
ServerProfiler.ResumeContinuousRecording();
}
else
{
Debug.Log("Stopping watching allocations due to export error");
ServerProfiler.StopContinuousRecording();
}
});
});
arg.ReplyWith("ServerProfiler started tracking allocations");
}
[ServerVar(Help = "Stops tracking of allocations")]
public static void StopWatchingAllocs(Arg arg)
{
if (!ServerProfiler.IsEnabled())
{
arg.ReplyWith("ServerProfiler is disabled");
return;
}
ServerProfiler.StopContinuousRecording();
arg.ReplyWith("ServerProfiler stopped tracking allocations");
}
}

View file

@ -182,6 +182,9 @@ public class Server : ConsoleSystem
[ServerVar(Saved = true)]
public static float bleedingdamage = 1f;
[ServerVar(Help = "Lower damage of explosives to 1 and allow them to be triggered multiple times")]
public static bool explosive_testing_mode = false;
[ServerVar(Saved = true)]
public static float oilrig_radiation_amount_scale = 1f;
@ -402,7 +405,7 @@ public class Server : ConsoleSystem
public static float industrialFrameBudgetMs = 0.5f;
[ServerVar(Help = "When enabled industrial transfers will abort if they start to take too long. Will lead to inconsistent splitting but should retain performance", Saved = true)]
public static bool industrialTransferStrictTimeLimits = false;
public static bool industrialTransferStrictTimeLimits = true;
[ServerVar(Help = "Enables a faster way to move items around during conveyor transfers. Should be on unless there's a issue")]
public static bool industrialAllowQuickMove = true;
@ -524,6 +527,9 @@ public class Server : ConsoleSystem
[ServerVar]
public static int maxpacketspersecond_voice = 100;
[ServerVar]
public static int maxpacketspersecond_syncvar = 200;
[ServerVar]
public static bool packetlog_enabled = false;
@ -533,7 +539,8 @@ public class Server : ConsoleSystem
[ServerVar]
public static bool UsePlayerUpdateJobs = false;
public const bool EmergencyDisablePlayerJobs = true;
[ServerVar(Help = "Runs extra validation checks to prevent crashes and instead switch back to vanilla processing")]
public static bool EmergencyDisablePlayerJobs = true;
[ServerVar(Saved = true)]
public static string server_id

View file

@ -41,6 +41,12 @@ public class Spawn : ConsoleSystem
[ServerVar]
public static float tick_individuals = 300f;
[ServerVar(Help = "When scaling loot respawn rates by population, this will be considered the 'max' population, preventing loot speeding up if player counts are above this")]
public static int population_cap_rate = 300;
[ServerVar(Help = "If set the loot spawn system will consider this the player count, not the actual player count. Useful for testing")]
public static int loot_population_test = 0;
[ServerVar]
public static void fill_populations(Arg args)
{
@ -71,7 +77,7 @@ public class Spawn : ConsoleSystem
SingletonComponent<SpawnHandler>.Instance?.DeleteAllPopulations();
}
[ServerVar]
[ServerVar(Help = "<iterations> - Simulates a number of iterations on the closest loot container and sums up the items spawned")]
public static void simulate_loot(Arg args)
{
BasePlayer player = args.Player();
@ -83,7 +89,7 @@ public class Spawn : ConsoleSystem
int num = Mathf.Clamp(args.GetInt(0, 100), 1, 10000);
List<LootContainer> list = new List<LootContainer>();
global::Vis.Entities(player.transform.position, 5f, list, -1, QueryTriggerInteraction.Ignore);
LootContainer lootContainer = list.OrderByDescending((LootContainer x) => Vector3.Distance(player.transform.position, x.transform.position)).FirstOrDefault();
LootContainer lootContainer = list.OrderBy((LootContainer x) => Vector3.Distance(player.transform.position, x.transform.position)).FirstOrDefault();
if (lootContainer == null)
{
args.ReplyWith("No loot container found");
@ -104,10 +110,12 @@ public class Spawn : ConsoleSystem
}
}
}
int totalWidth = dictionary.Max((KeyValuePair<string, int> x) => x.Key.Length);
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.AppendLine($"Simulated loot from {num} {lootContainer.ShortPrefabName}:");
foreach (KeyValuePair<string, int> item2 in dictionary.OrderByDescending((KeyValuePair<string, int> x) => x.Value))
{
stringBuilder.AppendLine($"{item2.Key}: {item2.Value}");
stringBuilder.AppendLine($"{item2.Key.PadRight(totalWidth)} : {item2.Value}");
}
args.ReplyWith(stringBuilder.ToString());
}

View file

@ -27,13 +27,24 @@ public class vehicle : ConsoleSystem
[ServerUserVar]
public static void swapseats(Arg arg)
{
int targetSeat = 0;
BasePlayer basePlayer = arg.Player();
if (basePlayer == null || basePlayer.SwapSeatCooldown())
int seat = -1;
TryMovePlayerToSeat(arg.Player(), seat);
}
[ServerUserVar]
public static void swaptoseat(Arg arg)
{
int seat = arg.GetInt(0, -1);
TryMovePlayerToSeat(arg.Player(), seat);
}
public static void TryMovePlayerToSeat(BasePlayer ply, int seat)
{
if (ply == null || ply.SwapSeatCooldown())
{
return;
}
BaseMountable mounted = basePlayer.GetMounted();
BaseMountable mounted = ply.GetMounted();
if (!(mounted == null))
{
BaseVehicle baseVehicle = mounted.GetComponent<BaseVehicle>();
@ -43,7 +54,7 @@ public class vehicle : ConsoleSystem
}
if (!(baseVehicle == null))
{
baseVehicle.SwapSeats(basePlayer, targetSeat);
baseVehicle.SwapSeats(ply, seat);
}
}
}
@ -90,6 +101,14 @@ public class vehicle : ConsoleSystem
num++;
}
}
HotAirBalloon[] array5 = BaseEntity.Util.FindAll<HotAirBalloon>();
foreach (HotAirBalloon hotAirBalloon in array5)
{
if (hotAirBalloon.isServer && Vector3.Distance(hotAirBalloon.transform.position, basePlayer.transform.position) <= 10f && hotAirBalloon.AdminFixUp())
{
num++;
}
}
arg.ReplyWith($"Fixed up {num} vehicles.");
}

View file

@ -44,7 +44,7 @@ public class ConditionalModel : PrefabAttribute
return true;
}
public GameObject InstantiateSkin(BaseEntity parent)
public virtual GameObject InstantiateSkin(BaseEntity parent)
{
if (!onServer && isServer)
{

View file

@ -0,0 +1,41 @@
using System;
using UnityEngine;
public class ConditionalModelWallpaper : ConditionalModel
{
public bool softSide;
public override GameObject InstantiateSkin(BaseEntity parent)
{
if (!onServer && isServer)
{
return null;
}
GameObject gameObject = gameManager.CreatePrefab(prefab.resourcePath, parent.transform, active: false);
if (gameObject != null)
{
gameObject.transform.localPosition = worldPosition;
gameObject.transform.localRotation = worldRotation;
BuildingBlock buildingBlock = parent as BuildingBlock;
if (buildingBlock != null)
{
ItemDefinition itemDefForCategory = WallpaperSettings.GetItemDefForCategory(WallpaperPlanner.Settings.GetCategory(buildingBlock, (!softSide) ? 1 : 0));
SkinHelpers.SetSkin(gameObject, itemDefForCategory, softSide ? buildingBlock.wallpaperID : buildingBlock.wallpaperID2);
float num = (softSide ? buildingBlock.wallpaperRotation : buildingBlock.wallpaperRotation2);
if (num != 0f)
{
Vector3 localEulerAngles = gameObject.transform.localEulerAngles;
localEulerAngles.y += num;
gameObject.transform.localRotation = Quaternion.Euler(localEulerAngles);
}
gameObject.AwakeFromInstantiate();
}
}
return gameObject;
}
protected override Type GetIndexedType()
{
return typeof(ConditionalModel);
}
}

View file

@ -67,7 +67,7 @@ public class ConnectionAuth : MonoBehaviour
Reject(connection, "Invalid SteamID");
return;
}
if (connection.protocol != 2588)
if (connection.protocol != 2590)
{
if (!DeveloperList.Contains(connection.userid))
{

View file

@ -14,7 +14,7 @@ using UnityEngine;
public class ConsoleGen
{
public static ConsoleSystem.Command[] All = new ConsoleSystem.Command[1535]
public static ConsoleSystem.Command[] All = new ConsoleSystem.Command[1559]
{
new ConsoleSystem.Command
{
@ -1345,6 +1345,48 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "commands_enabled",
Parent = "commandblock",
FullName = "commandblock.commands_enabled",
ServerAdmin = true,
Description = "Can command blocks execute commands",
Variable = true,
GetOveride = () => CommandBlock.commands_enabled.ToString(),
SetOveride = delegate(string str)
{
CommandBlock.commands_enabled = str.ToBool();
}
},
new ConsoleSystem.Command
{
Name = "log_executions",
Parent = "commandblock",
FullName = "commandblock.log_executions",
ServerAdmin = true,
Description = "Print a log message when a command block is executed",
Variable = true,
GetOveride = () => CommandBlock.log_executions.ToString(),
SetOveride = delegate(string str)
{
CommandBlock.log_executions = str.ToBool();
}
},
new ConsoleSystem.Command
{
Name = "use_player",
Parent = "commandblock",
FullName = "commandblock.use_player",
ServerAdmin = true,
Description = "If enabled, commands from command blocks will run using the last player who set them, allowing for a wider range of commands to be used",
Variable = true,
GetOveride = () => CommandBlock.use_player.ToString(),
SetOveride = delegate(string str)
{
CommandBlock.use_player = str.ToBool();
}
},
new ConsoleSystem.Command
{
Name = "echo",
Parent = "commands",
@ -1589,12 +1631,29 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "alternativeloschecks_enabled",
Parent = "construction",
FullName = "construction.alternativeloschecks_enabled",
ServerAdmin = true,
ClientAdmin = true,
Client = true,
Replicated = true,
Variable = true,
GetOveride = () => Construction.alternativeLOSChecks_enabled.ToString(),
SetOveride = delegate(string str)
{
Construction.alternativeLOSChecks_enabled = str.ToBool();
},
Default = "True"
},
new ConsoleSystem.Command
{
Name = "add_wallpaper_radius",
Parent = "global",
FullName = "global.add_wallpaper_radius",
ServerAdmin = true,
Description = "add_wallpaper_radius 'wallpaper' 'radius'",
Description = "<name/id> <radius> | Use print_wallpaper_skins for a list | 0 -> default, -1 -> random",
Variable = false,
Call = delegate(ConsoleSystem.Arg arg)
{
@ -1863,7 +1922,7 @@ public class ConsoleGen
Parent = "global",
FullName = "global.change_wallpaper_radius",
ServerAdmin = true,
Description = "change_wallpaper_radius 'wallpaper' 'radius'",
Description = "<name/id> <radius> | Use print_wallpaper_skins for a list | 0 -> default, -1 -> random",
Variable = false,
Call = delegate(ConsoleSystem.Arg arg)
{
@ -1876,7 +1935,7 @@ public class ConsoleGen
Parent = "global",
FullName = "global.clear_wallpaper_radius",
ServerAdmin = true,
Description = "clear_wallpaper_radius 'radius'",
Description = "clear_wallpaper_radius <radius>",
Variable = false,
Call = delegate(ConsoleSystem.Arg arg)
{
@ -2166,6 +2225,19 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "print_wallpaper_skins",
Parent = "global",
FullName = "global.print_wallpaper_skins",
ServerAdmin = true,
Description = "Lists all wallpaper skins",
Variable = false,
Call = delegate(ConsoleSystem.Arg arg)
{
Admin.print_wallpaper_skins(arg);
}
},
new ConsoleSystem.Command
{
Name = "recoverplayer",
Parent = "global",
@ -3714,6 +3786,20 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "explosive_vehicle_parent_damage_deployables",
Parent = "antihack",
FullName = "antihack.explosive_vehicle_parent_damage_deployables",
ServerAdmin = true,
Description = "Should explosives parented to vehicles damage deployables",
Variable = true,
GetOveride = () => ConVar.AntiHack.explosive_vehicle_parent_damage_deployables.ToString(),
SetOveride = delegate(string str)
{
ConVar.AntiHack.explosive_vehicle_parent_damage_deployables = str.ToBool();
}
},
new ConsoleSystem.Command
{
Name = "eye_clientframes",
Parent = "antihack",
@ -6416,6 +6502,18 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "conveyorstrictmodereport",
Parent = "debug",
FullName = "debug.conveyorstrictmodereport",
ServerAdmin = true,
Variable = false,
Call = delegate(ConsoleSystem.Arg arg)
{
Debugging.conveyorStrictModeReport(arg);
}
},
new ConsoleSystem.Command
{
Name = "debugdismounts",
Parent = "debug",
@ -6816,6 +6914,19 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "spawn_all_deployables",
Parent = "debug",
FullName = "debug.spawn_all_deployables",
ServerAdmin = true,
Description = "Spawns one of every deployable in a grid",
Variable = false,
Call = delegate(ConsoleSystem.Arg arg)
{
Debugging.spawn_all_deployables(arg);
}
},
new ConsoleSystem.Command
{
Name = "spawnparachutetester",
Parent = "debug",
@ -11407,6 +11518,84 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "notifyonmainalloccount",
Parent = "profile",
FullName = "profile.notifyonmainalloccount",
ServerAdmin = true,
Variable = true,
GetOveride = () => Profile.NotifyOnMainAllocCount.ToString(),
SetOveride = delegate(string str)
{
Profile.NotifyOnMainAllocCount = str.ToInt();
}
},
new ConsoleSystem.Command
{
Name = "notifyonmainmemkb",
Parent = "profile",
FullName = "profile.notifyonmainmemkb",
ServerAdmin = true,
Variable = true,
GetOveride = () => Profile.NotifyOnMainMemKB.ToString(),
SetOveride = delegate(string str)
{
Profile.NotifyOnMainMemKB = str.ToInt();
}
},
new ConsoleSystem.Command
{
Name = "notifyontotalalloccount",
Parent = "profile",
FullName = "profile.notifyontotalalloccount",
ServerAdmin = true,
Variable = true,
GetOveride = () => Profile.NotifyOnTotalAllocCount.ToString(),
SetOveride = delegate(string str)
{
Profile.NotifyOnTotalAllocCount = str.ToInt();
}
},
new ConsoleSystem.Command
{
Name = "notifyontotalmemkb",
Parent = "profile",
FullName = "profile.notifyontotalmemkb",
ServerAdmin = true,
Variable = true,
GetOveride = () => Profile.NotifyOnTotalMemKB.ToString(),
SetOveride = delegate(string str)
{
Profile.NotifyOnTotalMemKB = str.ToInt();
}
},
new ConsoleSystem.Command
{
Name = "notifyonworkeralloccount",
Parent = "profile",
FullName = "profile.notifyonworkeralloccount",
ServerAdmin = true,
Variable = true,
GetOveride = () => Profile.NotifyOnWorkerAllocCount.ToString(),
SetOveride = delegate(string str)
{
Profile.NotifyOnWorkerAllocCount = str.ToInt();
}
},
new ConsoleSystem.Command
{
Name = "notifyonworkermemkb",
Parent = "profile",
FullName = "profile.notifyonworkermemkb",
ServerAdmin = true,
Variable = true,
GetOveride = () => Profile.NotifyOnWorkerMemKB.ToString(),
SetOveride = delegate(string str)
{
Profile.NotifyOnWorkerMemKB = str.ToInt();
}
},
new ConsoleSystem.Command
{
Name = "perfsnapshot",
Parent = "profile",
@ -11472,6 +11661,32 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "stopwatchingallocs",
Parent = "profile",
FullName = "profile.stopwatchingallocs",
ServerAdmin = true,
Description = "Stops tracking of allocations",
Variable = false,
Call = delegate(ConsoleSystem.Arg arg)
{
Profile.StopWatchingAllocs(arg);
}
},
new ConsoleSystem.Command
{
Name = "watchallocs",
Parent = "profile",
FullName = "profile.watchallocs",
ServerAdmin = true,
Description = "Params: [Name = 'Allocs'] [maxStackDepth = 16].\nStarts tracking of allocs, dumping a [Name].json.gz record once conditions are met",
Variable = false,
Call = delegate(ConsoleSystem.Arg arg)
{
Profile.WatchAllocs(arg);
}
},
new ConsoleSystem.Command
{
Name = "print_global_entities",
Parent = "render",
@ -12290,6 +12505,20 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "emergencydisableplayerjobs",
Parent = "server",
FullName = "server.emergencydisableplayerjobs",
ServerAdmin = true,
Description = "Runs extra validation checks to prevent crashes and instead switch back to vanilla processing",
Variable = true,
GetOveride = () => ConVar.Server.EmergencyDisablePlayerJobs.ToString(),
SetOveride = delegate(string str)
{
ConVar.Server.EmergencyDisablePlayerJobs = str.ToBool();
}
},
new ConsoleSystem.Command
{
Name = "emojiownershipcheck",
Parent = "server",
@ -12416,6 +12645,20 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "explosive_testing_mode",
Parent = "server",
FullName = "server.explosive_testing_mode",
ServerAdmin = true,
Description = "Lower damage of explosives to 1 and allow them to be triggered multiple times",
Variable = true,
GetOveride = () => ConVar.Server.explosive_testing_mode.ToString(),
SetOveride = delegate(string str)
{
ConVar.Server.explosive_testing_mode = str.ToBool();
}
},
new ConsoleSystem.Command
{
Name = "farmchickenlocalavoidance",
Parent = "server",
@ -13207,6 +13450,19 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "maxpacketspersecond_syncvar",
Parent = "server",
FullName = "server.maxpacketspersecond_syncvar",
ServerAdmin = true,
Variable = true,
GetOveride = () => ConVar.Server.maxpacketspersecond_syncvar.ToString(),
SetOveride = delegate(string str)
{
ConVar.Server.maxpacketspersecond_syncvar = str.ToInt();
}
},
new ConsoleSystem.Command
{
Name = "maxpacketspersecond_tick",
Parent = "server",
@ -14931,6 +15187,20 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "loot_population_test",
Parent = "spawn",
FullName = "spawn.loot_population_test",
ServerAdmin = true,
Description = "If set the loot spawn system will consider this the player count, not the actual player count. Useful for testing",
Variable = true,
GetOveride = () => Spawn.loot_population_test.ToString(),
SetOveride = delegate(string str)
{
Spawn.loot_population_test = str.ToInt();
}
},
new ConsoleSystem.Command
{
Name = "max_density",
Parent = "spawn",
@ -15009,6 +15279,20 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "population_cap_rate",
Parent = "spawn",
FullName = "spawn.population_cap_rate",
ServerAdmin = true,
Description = "When scaling loot respawn rates by population, this will be considered the 'max' population, preventing loot speeding up if player counts are above this",
Variable = true,
GetOveride = () => Spawn.population_cap_rate.ToString(),
SetOveride = delegate(string str)
{
Spawn.population_cap_rate = str.ToInt();
}
},
new ConsoleSystem.Command
{
Name = "report",
Parent = "spawn",
@ -15077,6 +15361,7 @@ public class ConsoleGen
Parent = "spawn",
FullName = "spawn.simulate_loot",
ServerAdmin = true,
Description = "<iterations> - Simulates a number of iterations on the closest loot container and sums up the items spawned",
Variable = false,
Call = delegate(ConsoleSystem.Arg arg)
{
@ -15606,6 +15891,18 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "swaptoseat",
Parent = "vehicle",
FullName = "vehicle.swaptoseat",
ServerUser = true,
Variable = false,
Call = delegate(ConsoleSystem.Arg arg)
{
vehicle.swaptoseat(arg);
}
},
new ConsoleSystem.Command
{
Name = "trainskeeprunning",
Parent = "vehicle",
@ -16494,6 +16791,19 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "demolish_seconds",
Parent = "decayentity",
FullName = "decayentity.demolish_seconds",
ServerAdmin = true,
Variable = true,
GetOveride = () => DecayEntity.demolish_seconds.ToString(),
SetOveride = delegate(string str)
{
DecayEntity.demolish_seconds = str.ToInt();
}
},
new ConsoleSystem.Command
{
Name = "dump",
Parent = "global",
@ -18768,6 +19078,19 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "directionaldropenabled",
Parent = "playerinventory",
FullName = "playerinventory.directionaldropenabled",
ServerAdmin = true,
Variable = true,
GetOveride = () => PlayerInventory.directionalDropEnabled.ToString(),
SetOveride = delegate(string str)
{
PlayerInventory.directionalDropEnabled = str.ToBool();
}
},
new ConsoleSystem.Command
{
Name = "forcebirthday",
Parent = "playerinventory",
@ -19809,19 +20132,6 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "demolish_seconds",
Parent = "stabilityentity",
FullName = "stabilityentity.demolish_seconds",
ServerAdmin = true,
Variable = true,
GetOveride = () => StabilityEntity.demolish_seconds.ToString(),
SetOveride = delegate(string str)
{
StabilityEntity.demolish_seconds = str.ToInt();
}
},
new ConsoleSystem.Command
{
Name = "population",
Parent = "stag",
@ -19956,6 +20266,20 @@ public class ConsoleGen
}
},
new ConsoleSystem.Command
{
Name = "trainturretinaccuratepervelocity",
Parent = "traincar",
FullName = "traincar.trainturretinaccuratepervelocity",
ServerAdmin = true,
Description = "Chance to miss per m/s of velocity for turrets shooting players on moving trains",
Variable = true,
GetOveride = () => TrainCar.TrainTurretInaccuratePerVelocity.ToString(),
SetOveride = delegate(string str)
{
TrainCar.TrainTurretInaccuratePerVelocity = str.ToFloat();
}
},
new ConsoleSystem.Command
{
Name = "wagons_per_engine",
Parent = "traincar",

View file

@ -128,6 +128,13 @@ public class Construction : PrefabAttribute
public bool canFloodFillSockets;
[Space]
public bool alternativeLOSChecks;
public Vector3[] alternativeLOSPositions;
public bool canUseLastValidPosition = true;
[Range(0f, 10f)]
public float healthMultiplier = 1f;
@ -137,6 +144,9 @@ public class Construction : PrefabAttribute
[Range(1f, 50f)]
public float maxplaceDistance = 4f;
[Range(0f, 10f)]
public float minPlaceDistance = 1f;
public UnityEngine.Mesh guideMesh;
[NonSerialized]
@ -169,6 +179,9 @@ public class Construction : PrefabAttribute
[NonSerialized]
public ConstructionPlaceholder placeholder;
[ReplicatedVar]
public static bool alternativeLOSChecks_enabled = true;
public static Translate.Phrase lastPlacementError = string.Empty;
public static bool lastPlacementErrorIsDetailed;
@ -271,6 +284,15 @@ public class Construction : PrefabAttribute
return typeof(Construction);
}
public bool HasAlternativeLOSChecks()
{
if (alternativeLOSChecks_enabled && alternativeLOSChecks && alternativeLOSPositions != null)
{
return alternativeLOSPositions.Length != 0;
}
return false;
}
public bool UpdatePlacement(Transform transform, Construction common, ref Target target)
{
if (!target.valid)
@ -329,11 +351,29 @@ public class Construction : PrefabAttribute
lastPlacementError = ConstructionErrors.ThroughRock;
continue;
}
if (!TestPlacingThroughWall(ref placement, transform, common, target))
if (common.HasAlternativeLOSChecks())
{
if (target.socket == null && !TestPlacingThroughWall(ref placement, transform, common, target))
{
transform.position = placement.position;
transform.rotation = placement.rotation;
lastPlacementError = ConstructionErrors.ThroughWalls;
lastPlacementErrorDebug = "Placing through walls";
continue;
}
if (!Planner.HasLineOfSight(ref placement, common, target))
{
transform.position = placement.position;
transform.rotation = placement.rotation;
lastPlacementError = ConstructionErrors.LineOfSightBlocked;
continue;
}
}
else if (!TestPlacingThroughWall(ref placement, transform, common, target))
{
transform.position = placement.position;
transform.rotation = placement.rotation;
lastPlacementError = ConstructionErrors.LineOfSightBlocked;
lastPlacementError = ConstructionErrors.ThroughWalls;
lastPlacementErrorDebug = "Placing through walls";
continue;
}

View file

@ -11,6 +11,8 @@ public static class ConstructionErrors
public static readonly Translate.Phrase ThroughRock = new Translate.Phrase("error_throughrock", "Placing through rock");
public static readonly Translate.Phrase ThroughWalls = new Translate.Phrase("error_throughwalls", "Placing through walls");
public static readonly Translate.Phrase InsideObjects = new Translate.Phrase("error_insideobjects", "Can't deploy inside objects");
public static readonly Translate.Phrase TooCloseToRoad = new Translate.Phrase("error_tooclosetoroad", "Placing too close to road");

View file

@ -5,15 +5,19 @@ public class ConstructionSkin : BasePrefab
{
public List<GameObject> conditionals;
public int DetermineConditionalModelState(BuildingBlock parent)
public ulong DetermineConditionalModelState(BuildingBlock parent)
{
ConditionalModel[] array = PrefabAttribute.server.FindAll<ConditionalModel>(prefabID);
int num = 0;
for (int i = 0; i < array.Length; i++)
if (array.Length > 64)
{
Debug.LogError("Too many ConditionalModels on " + parent.name + "! Maximum supported is 64");
}
ulong num = 0uL;
for (int i = 0; i < array.Length && i < 64; i++)
{
if (array[i].RunTests(parent))
{
num |= 1 << i;
num |= (ulong)(1L << i);
}
}
return num;
@ -56,17 +60,6 @@ public class ConstructionSkin : BasePrefab
{
DestroyConditionalModels(parent);
CreateConditionalModels(parent);
if (!parent.HasWallpaper())
{
return;
}
foreach (GameObject conditional in conditionals)
{
if (conditional.CompareTag("Wallpaper"))
{
SkinHelpers.SetSkin(conditional, WallpaperPlanner.WallpaperItemDef, (conditional.transform.localRotation.y == 0f) ? parent.wallpaperID : parent.wallpaperID2);
}
}
}
public void Destroy(BuildingBlock parent)

View file

@ -346,6 +346,22 @@ public class ContainerIOEntity : IOEntity, IItemContainerEntity, IIdealSlotEntit
return false;
}
protected bool HasAttachedStorageMonitor()
{
if (children == null)
{
return false;
}
foreach (BaseEntity child in children)
{
if (child is StorageMonitor)
{
return true;
}
}
return false;
}
public bool OccupiedCheck(BasePlayer player = null)
{
if (player != null && player.inventory.loot.entitySource == this)

View file

@ -0,0 +1,24 @@
using UnityEngine;
using UnityEngine.Animations;
public class CurveStateSpeed : StateMachineBehaviour
{
public AnimationCurve SpeedCurve = AnimationCurve.Constant(0f, 1f, 1f);
public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex, AnimatorControllerPlayable controller)
{
base.OnStateUpdate(animator, stateInfo, layerIndex, controller);
float speed = 1f;
if (!animator.IsInTransition(layerIndex))
{
speed = SpeedCurve.Evaluate(stateInfo.normalizedTime);
}
animator.speed = speed;
}
public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
base.OnStateExit(animator, stateInfo, layerIndex);
animator.speed = 1f;
}
}

View file

@ -5,7 +5,7 @@ using UnityEngine;
public static class DamageUtil
{
public static void RadiusDamage(BaseEntity attackingPlayer, BaseEntity weaponPrefab, Vector3 pos, float minradius, float radius, List<DamageTypeEntry> damage, int layers, bool useLineOfSight, bool ignoreAI = false, bool ignoreAttackingPlayer = false, bool extendedLineOfSight = false, List<DamageTypeEntry> playerDamage = null)
public static void RadiusDamage(BaseEntity attackingPlayer, BaseEntity weaponPrefab, Vector3 pos, float minradius, float radius, List<DamageTypeEntry> damage, int layers, bool useLineOfSight, bool ignoreAI = false, bool ignoreAttackingPlayer = false, bool extendedLineOfSight = false, List<DamageTypeEntry> playerDamage = null, bool removeWallpaper = false)
{
using (TimeWarning.New("DamageUtil.RadiusDamage"))
{
@ -27,6 +27,11 @@ public static class DamageUtil
continue;
}
float amount = 1f - num;
if (removeWallpaper && baseEntity is BuildingBlock buildingBlock)
{
buildingBlock.RemoveWallpaper(0);
buildingBlock.RemoveWallpaper(1);
}
if ((!extendedLineOfSight || GamePhysics.LineOfSight(baseEntity.CenterPoint(), pos, 1218519041, baseEntity)) && (!useLineOfSight || baseEntity.IsVisible(pos)))
{
HitInfo hitInfo = new HitInfo();

View file

@ -1,10 +1,14 @@
#define UNITY_ASSERTIONS
using System;
using System.Collections.Generic;
using ConVar;
using Facepunch;
using Facepunch.Rust;
using Network;
using ProtoBuf;
using Rust;
using UnityEngine;
using UnityEngine.Assertions;
public class DecayEntity : BaseCombatEntity
{
@ -18,6 +22,10 @@ public class DecayEntity : BaseCombatEntity
public bool dropToTerrain;
}
public static readonly Translate.Phrase CancelTitle = new Translate.Phrase("cancel", "Cancel");
public static readonly Translate.Phrase CancelDesc = new Translate.Phrase("cancel_desc");
public GameObjectRef debrisPrefab;
public Vector3 debrisRotationOffset = Vector3.zero;
@ -43,12 +51,108 @@ public class DecayEntity : BaseCombatEntity
private float decayVariance = 1f;
public static readonly Translate.Phrase DemolishTitle = new Translate.Phrase("demolish", "Demolish");
public static readonly Translate.Phrase DemolishDesc = new Translate.Phrase("demolish_desc", "Slowly and automatically dismantle this block");
[ServerVar]
public static int demolish_seconds = 600;
public const Flags DemolishFlag = Flags.Reserved2;
[Header("Demolish")]
public bool canBeDemolished;
public Upkeep Upkeep => upkeep;
public virtual bool BypassInsideDecayMultiplier => false;
public virtual bool AllowOnCargoShip => false;
public virtual bool IsDemolishSupported => canBeDemolished;
public override bool OnRpcMessage(BasePlayer player, uint rpc, Message msg)
{
using (TimeWarning.New("DecayEntity.OnRpcMessage"))
{
if (rpc == 2858062413u && player != null)
{
Assert.IsTrue(player.isServer, "SV_RPC Message is using a clientside player!");
if (ConVar.Global.developer > 2)
{
Debug.Log("SV_RPCMessage: " + player?.ToString() + " - DoDemolish ");
}
using (TimeWarning.New("DoDemolish"))
{
using (TimeWarning.New("Conditions"))
{
if (!RPC_Server.MaxDistance.Test(2858062413u, "DoDemolish", this, player, 3f))
{
return true;
}
}
try
{
using (TimeWarning.New("Call"))
{
RPCMessage msg2 = new RPCMessage
{
connection = msg.connection,
player = player,
read = msg.read
};
DoDemolish(msg2);
}
}
catch (Exception exception)
{
Debug.LogException(exception);
player.Kick("RPC Error in DoDemolish");
}
}
return true;
}
if (rpc == 216608990 && player != null)
{
Assert.IsTrue(player.isServer, "SV_RPC Message is using a clientside player!");
if (ConVar.Global.developer > 2)
{
Debug.Log("SV_RPCMessage: " + player?.ToString() + " - DoImmediateDemolish ");
}
using (TimeWarning.New("DoImmediateDemolish"))
{
using (TimeWarning.New("Conditions"))
{
if (!RPC_Server.MaxDistance.Test(216608990u, "DoImmediateDemolish", this, player, 3f))
{
return true;
}
}
try
{
using (TimeWarning.New("Call"))
{
RPCMessage msg3 = new RPCMessage
{
connection = msg.connection,
player = player,
read = msg.read
};
DoImmediateDemolish(msg3);
}
}
catch (Exception exception2)
{
Debug.LogException(exception2);
player.Kick("RPC Error in DoImmediateDemolish");
}
}
return true;
}
}
return base.OnRpcMessage(player, rpc, msg);
}
public override void ResetState()
{
base.ResetState();
@ -151,6 +255,10 @@ public class DecayEntity : BaseCombatEntity
BuildingManager.server.CheckMerge(this);
}
lastDecayTick = UnityEngine.Time.time;
if (IsDemolishSupported && (HasFlag(Flags.Reserved2) || !Rust.Application.isLoadingSave))
{
StartBeingDemolishable();
}
}
internal override void DoServerDestroy()
@ -396,6 +504,71 @@ public class DecayEntity : BaseCombatEntity
return baseEntity.ForceDeployableSetParent();
}
private bool CanDemolish(BasePlayer player)
{
if (IsDemolishSupported && IsDemolishable())
{
return HasDemolishPrivilege(player);
}
return false;
}
private bool IsDemolishable()
{
if (!ConVar.Server.pve && !HasFlag(Flags.Reserved2))
{
return false;
}
return true;
}
private bool HasDemolishPrivilege(BasePlayer player)
{
return player.IsBuildingAuthed(base.transform.position, base.transform.rotation, bounds);
}
[RPC_Server]
[RPC_Server.MaxDistance(3f)]
private void DoDemolish(RPCMessage msg)
{
if (msg.player.CanInteract() && CanDemolish(msg.player))
{
StabilityEntity stabilityEntity = this as StabilityEntity;
if (stabilityEntity != null)
{
Analytics.Azure.OnBuildingBlockDemolished(msg.player, stabilityEntity);
}
Kill(DestroyMode.Gib);
}
}
[RPC_Server]
[RPC_Server.MaxDistance(3f)]
private void DoImmediateDemolish(RPCMessage msg)
{
if (msg.player.CanInteract() && msg.player.IsAdmin)
{
StabilityEntity stabilityEntity = this as StabilityEntity;
if (stabilityEntity != null)
{
Analytics.Azure.OnBuildingBlockDemolished(msg.player, stabilityEntity);
}
Kill(DestroyMode.Gib);
}
}
private void StopBeingDemolishable()
{
SetFlag(Flags.Reserved2, b: false);
SendNetworkUpdate();
}
private void StartBeingDemolishable()
{
SetFlag(Flags.Reserved2, b: true);
Invoke(StopBeingDemolishable, demolish_seconds);
}
public override void Save(SaveInfo info)
{
base.Save(info);
@ -411,19 +584,22 @@ public class DecayEntity : BaseCombatEntity
public override void Load(LoadInfo info)
{
base.Load(info);
if (info.msg.decayEntity == null)
if (info.msg.decayEntity != null)
{
return;
}
decayTimer = info.msg.decayEntity.decayTimer;
upkeepTimer = info.msg.decayEntity.upkeepTimer;
if (buildingID != info.msg.decayEntity.buildingID)
{
AttachToBuilding(info.msg.decayEntity.buildingID);
if (info.fromDisk)
decayTimer = info.msg.decayEntity.decayTimer;
upkeepTimer = info.msg.decayEntity.upkeepTimer;
if (buildingID != info.msg.decayEntity.buildingID)
{
BuildingManager.server.LoadBuildingID(buildingID);
AttachToBuilding(info.msg.decayEntity.buildingID);
if (info.fromDisk)
{
BuildingManager.server.LoadBuildingID(buildingID);
}
}
}
if (info.fromDisk && IsDemolishSupported)
{
SetFlag(Flags.Reserved2, b: false);
}
}
}

View file

@ -79,9 +79,9 @@ public abstract class DeployVolume : PrefabAttribute
return false;
}
public static bool Check(Vector3 position, Quaternion rotation, DeployVolume[] volumes, OBB test, int mask = -1)
public static bool Check(Vector3 position, Quaternion rotation, List<DeployVolume> volumes, OBB test, int mask = -1)
{
for (int i = 0; i < volumes.Length; i++)
for (int i = 0; i < volumes.Count; i++)
{
if (volumes[i].Check(position, rotation, test, mask))
{
@ -184,34 +184,46 @@ public abstract class DeployVolume : PrefabAttribute
return true;
}
MonumentInfo monument = list[i].GetMonument();
if ((monument != null && !monument.IsSafeZone && volume.ignore.HasFlag(ColliderInfo.Flags.Monument)) || (component != null && (volume.ignore & component.flags) != 0) || (!(component == null) && volume.ignore != 0 && component.HasFlag(volume.ignore)))
if ((!(monument != null) || monument.IsSafeZone || !volume.ignore.HasFlag(ColliderInfo.Flags.Monument)) && (!(component != null) || (volume.ignore & component.flags) == 0))
{
continue;
}
if (volume.entityList == null || volume.entityGroups == null || (volume.entityList.Length == 0 && volume.entityGroups.Length == 0))
{
return true;
}
if (volume.entityGroups.Length != 0)
{
EntityListScriptableObject[] array = volume.entityGroups;
foreach (EntityListScriptableObject entityListScriptableObject in array)
if (component != null && volume.ignore != 0 && component.HasFlag(volume.ignore))
{
if (entityListScriptableObject.entities.IsNullOrEmpty())
{
Debug.LogWarning("Skipping entity group '" + entityListScriptableObject.name + "' when checking volume: there are no entities");
}
else if (CheckEntityList(baseEntity, entityListScriptableObject.entities, trueIfAnyFound: true))
{
return true;
}
return false;
}
if (ShouldApplyVolumeForEntity(volume, baseEntity))
{
return true;
}
}
if (volume.entityList.Length != 0 && CheckEntityList(baseEntity, volume.entityList, volume.entityMode == EntityMode.IncludeList))
}
return false;
}
public static bool ShouldApplyVolumeForEntity(DeployVolume volume, BaseEntity entity)
{
if (volume.entityList == null || volume.entityGroups == null || (volume.entityList.Length == 0 && volume.entityGroups.Length == 0))
{
return true;
}
if (volume.entityGroups.Length != 0)
{
EntityListScriptableObject[] array = volume.entityGroups;
foreach (EntityListScriptableObject entityListScriptableObject in array)
{
return true;
if (entityListScriptableObject.entities.IsNullOrEmpty())
{
Debug.LogWarning("Skipping entity group '" + entityListScriptableObject.name + "' when checking volume: there are no entities");
}
else if (CheckEntityList(entity, entityListScriptableObject.entities, trueIfAnyFound: true))
{
return true;
}
}
}
if (volume.entityList.Length != 0 && CheckEntityList(entity, volume.entityList, volume.entityMode == EntityMode.IncludeList))
{
return true;
}
return false;
}

View file

@ -17,12 +17,23 @@ public class DeployVolumeEntityBoundsReverse : DeployVolume
Vis.Entities(position, test.extents.magnitude, obj, (int)layers & mask);
foreach (BaseEntity item in obj)
{
DeployVolume[] volumes = PrefabAttribute.server.FindAll<DeployVolume>(item.prefabID);
if (DeployVolume.Check(item.transform.position, item.transform.rotation, volumes, test, 1 << layer))
DeployVolume[] array = PrefabAttribute.server.FindAll<DeployVolume>(item.prefabID);
List<DeployVolume> obj2 = Pool.Get<List<DeployVolume>>();
DeployVolume[] array2 = array;
foreach (DeployVolume deployVolume in array2)
{
if (DeployVolume.ShouldApplyVolumeForEntity(deployVolume, item))
{
obj2.Add(deployVolume);
}
}
if (DeployVolume.Check(item.transform.position, item.transform.rotation, obj2, test, 1 << layer))
{
Pool.FreeUnmanaged(ref obj2);
Pool.FreeUnmanaged(ref obj);
return true;
}
Pool.FreeUnmanaged(ref obj2);
}
Pool.FreeUnmanaged(ref obj);
return false;

View file

@ -44,7 +44,7 @@ public class Door : AnimatedBuildingBlock, INotifyTrigger, ISimpleUpgradable
public bool allowOnCargoShip;
public ItemDefinition UpgradeItem;
public List<ItemDefinition> UpgradeItems;
public Menu.Option UpgradeMenu;
@ -961,18 +961,18 @@ public class Door : AnimatedBuildingBlock, INotifyTrigger, ISimpleUpgradable
}
}
public ItemDefinition GetUpgradeItem()
public List<ItemDefinition> GetUpgradeItems()
{
return UpgradeItem;
return UpgradeItems;
}
public bool CanUpgrade(BasePlayer player)
public bool CanUpgrade(BasePlayer player, ItemDefinition upgradeItem)
{
if (IsOpen())
{
return false;
}
return SimpleUpgrade.CanUpgrade(this, UpgradeItem, player);
return SimpleUpgrade.CanUpgrade(this, upgradeItem, player);
}
public bool HasLock()
@ -980,9 +980,9 @@ public class Door : AnimatedBuildingBlock, INotifyTrigger, ISimpleUpgradable
return GetSlot(Slot.Lock) != null;
}
public void DoUpgrade(BasePlayer player)
public void DoUpgrade(BasePlayer player, ItemDefinition upgradeItem)
{
SimpleUpgrade.DoUpgrade(this, player);
SimpleUpgrade.DoUpgrade(this, player, upgradeItem);
}
[RPC_Server]
@ -993,16 +993,22 @@ public class Door : AnimatedBuildingBlock, INotifyTrigger, ISimpleUpgradable
if (base.SecondsSinceAttacked < 30f)
{
msg.player.ShowToast(GameTip.Styles.Error, ConstructionErrors.CantUpgradeRecentlyDamaged, false, (30f - base.SecondsSinceAttacked).ToString("N0"));
return;
}
else if (CanUpgrade(msg.player))
int num = msg.read.Int32();
if (num >= 0 && num < UpgradeItems.Count && CanUpgrade(msg.player, UpgradeItems[num]))
{
DoUpgrade(msg.player);
DoUpgrade(msg.player, UpgradeItems[num]);
}
}
public bool UpgradingEnabled()
{
return UpgradeItem != null;
if (UpgradeItems != null)
{
return UpgradeItems.Count > 0;
}
return false;
}
public bool CostIsItem()

View file

@ -1,6 +1,7 @@
using System;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class DragMe : MonoBehaviour, IBeginDragHandler, IEventSystemHandler, IDragHandler, IEndDragHandler
{
@ -8,6 +9,8 @@ public class DragMe : MonoBehaviour, IBeginDragHandler, IEventSystemHandler, IDr
public static GameObject dragIcon;
public static Image dragImage;
public static object data;
[NonSerialized]
@ -23,6 +26,10 @@ public class DragMe : MonoBehaviour, IBeginDragHandler, IEventSystemHandler, IDr
{
}
public static void SetDropAppearance()
{
}
public virtual void OnEndDrag(PointerEventData eventData)
{
}

View file

@ -60,6 +60,8 @@ public class Drone : RemoteControlEntity, IRemoteControllableClientCallbacks, IR
public bool killInWater = true;
public bool killInTerrain = true;
public bool enableGrounding = true;
public bool keepAboveTerrain = true;
@ -251,15 +253,23 @@ public class Drone : RemoteControlEntity, IRemoteControllableClientCallbacks, IR
{
return;
}
float num = WaterFactor();
if (killInWater && num > 0f)
if (killInTerrain && AntiHack.TestInsideTerrain(base.transform.position))
{
if (num > 0.99f)
{
Kill();
}
Kill();
return;
}
if (killInWater)
{
float num = WaterFactor();
if (num > 0f)
{
if (num > 0.99f)
{
Kill();
}
return;
}
}
if ((!base.IsBeingControlled && !targetPosition.HasValue) || (isGrounded && currentInput.throttle <= 0f))
{
if (HasFlag(Flags.Reserved2))

View file

@ -203,6 +203,7 @@ public class DroppedItemContainer : BaseCombatEntity, LootPanel.IHasLootPanel, I
public static void TakeFractionOfItems(ItemContainer[] source, ItemContainer output, float movePercent)
{
output.containerVolume = source.Max((ItemContainer x) => x.containerVolume);
List<Item> list = Facepunch.Pool.Get<List<Item>>();
ItemContainer[] array = source;
foreach (ItemContainer obj in array)
@ -222,7 +223,6 @@ public class DroppedItemContainer : BaseCombatEntity, LootPanel.IHasLootPanel, I
item.DropAndTossUpwards(output.dropPosition);
}
}
output.containerVolume = source.Max((ItemContainer x) => x.containerVolume);
}
[RPC_Server]

View file

@ -0,0 +1,32 @@
using UnityEngine;
public class EffectSilencerSelect : MonoBehaviour
{
public GameObjectRef MilitaryEffect;
public GameObjectRef OilFilterEffect;
public GameObjectRef SodaCanEffect;
public bool GetEffectForSilencerType(ProjectileWeaponMod.SilencerType silencerType, out GameObjectRef result)
{
result = null;
switch (silencerType)
{
case ProjectileWeaponMod.SilencerType.Military:
result = MilitaryEffect;
break;
case ProjectileWeaponMod.SilencerType.OilFilter:
result = OilFilterEffect;
break;
case ProjectileWeaponMod.SilencerType.SodaCan:
result = SodaCanEffect;
break;
}
if (result != null)
{
return result.isValid;
}
return false;
}
}

View file

@ -52,7 +52,7 @@ public class ElectricGenerator : IOEntity
public override void PostServerLoad()
{
base.PostServerLoad();
Invoke(ForcePuzzleReset, 1f);
Invoke(ForcePuzzleReset, 4f);
}
private void ForcePuzzleReset()

View file

@ -6,6 +6,8 @@ public class ElectricalHeater : IOEntity
public Light sourceLight;
public Light secondaryLight;
public GrowableHeatSource growableHeatSource;
public override int ConsumptionAmount()

View file

@ -13,4 +13,13 @@ public class EmissionBlink : FacepunchBehaviour, IClientComponent, INotifyLOD
public float onIntensity = 3f;
public float offIntensity = 1f;
[Header("Optional Secondary Light")]
public bool useSecondaryLight;
public Light secondaryLight;
public float secondaryOnIntensity = 2f;
public float secondaryOffIntensity = 0.5f;
}

View file

@ -77,12 +77,21 @@ public class EntityFuelSystem : IFuelSystem
{
if (child.prefabID == fuelStorageID)
{
fuelStorageInstance.Set((StorageContainer)child);
if (child is StorageContainer storageContainer)
{
fuelStorageInstance.Set(storageContainer);
storageContainer.inventory.onItemAddedRemoved = OnFuelAddedRemoved;
}
return true;
}
return false;
}
private void OnFuelAddedRemoved(Item arg1, bool arg2)
{
nextFuelCheckTime = 0f;
}
public Item GetFuelItem()
{
StorageContainer fuelContainer = GetFuelContainer();

View file

@ -1,8 +1,7 @@
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class EnvironmentVolume : MonoBehaviour
public class EnvironmentVolume : MonoBehaviour, IPrefabPreProcess
{
private static readonly Vector3[] volumeCorners = new Vector3[8]
{
@ -26,8 +25,6 @@ public class EnvironmentVolume : MonoBehaviour
public Vector3 Size = Vector3.one;
public static List<EnvironmentVolume> EnabledEnvironmentVolumes { get; } = new List<EnvironmentVolume>();
[field: SerializeField]
[field: Tooltip("Controls the falloff amount of the positive axes of spatially aware volumes.")]
public Vector3 FalloffPositive { get; private set; } = Vector3.zero;
@ -56,10 +53,7 @@ public class EnvironmentVolume : MonoBehaviour
public Collider trigger { get; private set; }
protected virtual void Awake()
{
UpdateTrigger();
}
public bool IsSpatialVolume => (Type & EnvironmentType.SpatiallyAware) != 0;
private void OnValidate()
{
@ -67,9 +61,21 @@ public class EnvironmentVolume : MonoBehaviour
UpdateVolumeTransformationAndBounds();
}
public void PreProcess(IPrefabProcessor preProcess, GameObject rootObj, string name, bool serverside, bool clientside, bool bundling)
{
if (clientside && GetComponent<EnvironmentVolumeLOD>() == null)
{
base.gameObject.AddComponent<EnvironmentVolumeLOD>();
}
}
protected void Awake()
{
UpdateTrigger();
}
protected void OnEnable()
{
EnabledEnvironmentVolumes.Add(this);
if ((bool)trigger && !trigger.enabled)
{
trigger.enabled = true;
@ -80,7 +86,6 @@ public class EnvironmentVolume : MonoBehaviour
protected void OnDisable()
{
EnabledEnvironmentVolumes.Remove(this);
if ((bool)trigger && trigger.enabled)
{
trigger.enabled = false;

View file

@ -0,0 +1,4 @@
public class EnvironmentVolumeLOD : LODComponent
{
public float Distance = 500f;
}

View file

@ -0,0 +1,31 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
public class ExactArrayPool<T>
{
private readonly Dictionary<int, ConcurrentQueue<T[]>> _buffers = new Dictionary<int, ConcurrentQueue<T[]>>();
public T[] Rent(int size)
{
if (!_buffers.TryGetValue(size, out var value))
{
value = new ConcurrentQueue<T[]>();
_buffers[size] = value;
}
if (!value.TryDequeue(out var result))
{
return new T[size];
}
return result;
}
public void Return(T[] array)
{
if (!_buffers.TryGetValue(array.Length, out var value))
{
value = new ConcurrentQueue<T[]>();
_buffers[array.Length] = value;
}
value.Enqueue(array);
}
}

View file

@ -64,6 +64,8 @@ public static class RuntimeProfiler
private static DateTime nextPoolFlush;
private static DateTime lastInvokeSerialization = DateTime.UtcNow;
private static readonly ProfilerRecorderOptions PhysicsRecorderOptions = ProfilerRecorderOptions.WrapAroundWhenCapacityReached;
private static readonly List<RustProfilerRecorder> recorders = new List<RustProfilerRecorder>
@ -451,7 +453,7 @@ public static class RuntimeProfiler
}
if (invokeDetailsUploader.NeedsCreation())
{
invokeDetailsUploader = AzureAnalyticsUploader.Create("invoke_breakdown", TimeSpan.FromSeconds(runtime_profiling_interval), AnalyticsDocumentMode.CSV);
invokeDetailsUploader = AzureAnalyticsUploader.Create("invoke_minute_breakdown", TimeSpan.FromSeconds(runtime_profiling_interval), AnalyticsDocumentMode.CSV);
}
if (methodUploader.NeedsCreation())
{
@ -501,8 +503,12 @@ public static class RuntimeProfiler
SerializeCommon(eventRecord, obj);
SerializeNetworking(eventRecord, frameIndex, utcNow);
SerializeInvokes(eventRecord);
SerializeInvokeExecutionTime(InvokeProfiler.update, invokeDetailsUploader, frameIndex, utcNow);
SerializeInvokeExecutionTime(InvokeProfiler.fixedUpdate, invokeDetailsUploader, frameIndex, utcNow);
if (DateTime.UtcNow >= lastInvokeSerialization + TimeSpan.FromSeconds(60.0))
{
SerializeInvokeExecutionTime(InvokeProfiler.update, invokeDetailsUploader, utcNow);
SerializeInvokeExecutionTime(InvokeProfiler.fixedUpdate, invokeDetailsUploader, utcNow);
lastInvokeSerialization = DateTime.UtcNow;
}
SerializeProfilingSamples(eventRecord);
EntityProfiler.Serialize(eventRecord, frameIndex, utcNow, entityProfilingUploader);
EntityProfiler.TrySerializeEntityAggregates(frameIndex, utcNow, entityAggregateUploader);
@ -578,7 +584,7 @@ public static class RuntimeProfiler
int num3 = 0;
int num4 = 0;
int num5 = 0;
for (int i = 0; i < 27; i++)
for (int i = 0; i < 29; i++)
{
int num6 = PacketProfiler.inboundCount[i];
int num7 = PacketProfiler.inboundBytes[i];
@ -638,7 +644,7 @@ public static class RuntimeProfiler
}
}
private static void SerializeInvokeExecutionTime(InvokeProfiler profiler, AzureAnalyticsUploader uploader, int frameIndex, DateTime timestamp, bool reset = true)
private static void SerializeInvokeExecutionTime(InvokeProfiler profiler, AzureAnalyticsUploader uploader, DateTime timestamp, bool reset = true)
{
if (profiler.mode < 2)
{
@ -652,8 +658,7 @@ public static class RuntimeProfiler
if (trackingData.Calls != 0)
{
EventRecord eventRecord = EventRecord.CSV();
eventRecord.AddField("", frameIndex).AddField("", timestamp).AddField("", profiler.Name)
.AddField("", trackingData.TypeName)
eventRecord.AddField("", timestamp).AddField("", profiler.Name).AddField("", trackingData.TypeName)
.AddField("", trackingData.Key.MethodName)
.AddField("", trackingData.ExecutionTime)
.AddField("", trackingData.Calls)
@ -667,8 +672,7 @@ public static class RuntimeProfiler
}
invokeExecutionResetTimer.Stop();
EventRecord eventRecord2 = EventRecord.CSV();
eventRecord2.AddField("", frameIndex).AddField("", timestamp).AddField("", "Update")
.AddField("", "RuntimeProfiler")
eventRecord2.AddField("", timestamp).AddField("", "Update").AddField("", "RuntimeProfiler")
.AddField("", "Invoke_Execution_Serialization")
.AddField("", invokeExecutionResetTimer.Elapsed)
.AddField("", 1)

View file

@ -181,6 +181,8 @@ public static class Analytics
public const string FailedFish = "fishing_failed";
public const string CaughtFish = "fishing_caught";
public const string InjureStateChange = "injure_state";
}
private struct SimpleItemAmount
@ -337,6 +339,8 @@ public static class Analytics
public string ActiveItem;
public string Biome;
public void EnterPool()
{
UserId = null;
@ -345,6 +349,7 @@ public static class Analytics
Hotbar.Clear();
Worn.Clear();
ActiveItem = null;
Biome = null;
}
public void LeavePool()
@ -404,8 +409,8 @@ public static class Analytics
.AddField("ip_convar", global::Network.Net.sv.ip)
.AddField("port_convar", global::Network.Net.sv.port)
.AddField("net_protocol", global::Network.Net.sv.ProtocolId)
.AddField("protocol_network", 2588)
.AddField("protocol_save", 267)
.AddField("protocol_network", 2590)
.AddField("protocol_save", 268)
.AddField("changeset", BuildInfo.Current?.Scm.ChangeId ?? "0")
.AddField("unity_version", UnityEngine.Application.unityVersion)
.AddField("branch", BuildInfo.Current?.Scm.Branch ?? "empty")
@ -735,18 +740,18 @@ public static class Analytics
{
return;
}
List<string> obj = Pool.Get<List<string>>();
List<ulong> obj = Pool.Get<List<ulong>>();
try
{
if (members != null)
{
foreach (ulong member in members)
{
obj.Add(SingletonComponent<ServerMgr>.Instance.persistance.GetUserWipeId(member));
obj.Add(member);
}
}
SubmitPoint(EventRecord.New("team_change").AddField("team_leader", SingletonComponent<ServerMgr>.Instance.persistance.GetUserWipeId(teamLeader)).AddField("team", teamId)
.AddField("target_user", SingletonComponent<ServerMgr>.Instance.persistance.GetUserWipeId(user))
SubmitPoint(EventRecord.New("team_change").AddField("team_leader", teamLeader).AddField("team", teamId)
.AddField("target_user", user)
.AddField("change", change)
.AddObject("users", obj)
.AddField("member_count", members.Count));
@ -766,10 +771,9 @@ public static class Analytics
}
try
{
string userWipeId = SingletonComponent<ServerMgr>.Instance.persistance.GetUserWipeId(targetUser);
SubmitPoint(EventRecord.New("auth_change").AddField("entity", entity).AddField("player", player)
.AddField("target", userWipeId)
.AddObject("auth_list", authedList.Select((ulong x) => SingletonComponent<ServerMgr>.Instance.persistance.GetUserWipeId(x)))
.AddField("target", targetUser)
.AddObject("auth_list", authedList)
.AddField("change", change));
}
catch (Exception exception)
@ -786,9 +790,8 @@ public static class Analytics
}
try
{
string value = ((targetUser != 0L) ? SingletonComponent<ServerMgr>.Instance.persistance.GetUserWipeId(targetUser) : "");
SubmitPoint(EventRecord.New("sleeping_bag_assign").AddField("entity", bag).AddField("player", player)
.AddField("target", value));
.AddField("target", targetUser));
}
catch (Exception exception)
{
@ -1068,8 +1071,7 @@ public static class Analytics
}
try
{
string userWipeId = SingletonComponent<ServerMgr>.Instance.persistance.GetUserWipeId(player);
SubmitPoint(EventRecord.New("hackable_crate_ended").AddField("player_userid", userWipeId).AddField("entity", crate));
SubmitPoint(EventRecord.New("hackable_crate_ended").AddField("player_steamid", player).AddField("entity", crate));
}
catch (Exception exception)
{
@ -1086,7 +1088,7 @@ public static class Analytics
try
{
SubmitPoint(EventRecord.New("stash_hidden").AddField("player", player).AddField("entity", entity)
.AddField("owner", SingletonComponent<ServerMgr>.Instance.persistance.GetUserWipeId(entity.OwnerID)));
.AddField("owner", entity.OwnerID));
}
catch (Exception exception)
{
@ -1103,7 +1105,7 @@ public static class Analytics
try
{
SubmitPoint(EventRecord.New("stash_reveal").AddField("player", player).AddField("entity", entity)
.AddField("owner", SingletonComponent<ServerMgr>.Instance.persistance.GetUserWipeId(entity.OwnerID)));
.AddField("owner", entity.OwnerID));
}
catch (Exception exception)
{
@ -1124,7 +1126,7 @@ public static class Analytics
.AddField("message", message);
if (BuildInfo.Current != null)
{
eventRecord.AddField("changeset", BuildInfo.Current.Scm.ChangeId).AddField("network", 2588);
eventRecord.AddField("changeset", BuildInfo.Current.Scm.ChangeId).AddField("network", 2590);
}
switch (type)
{
@ -1810,6 +1812,7 @@ public static class Analytics
{
string userWipeId = SingletonComponent<ServerMgr>.Instance.persistance.GetUserWipeId(steamId);
eventRecord.AddField("player_userid", userWipeId);
eventRecord.AddField("player_steamid", steamId);
}
SubmitPoint(eventRecord);
}
@ -2237,9 +2240,13 @@ public static class Analytics
{
if (TickLogging.tickUploader.NeedsCreation())
{
TickLogging.tickUploader = AzureAnalyticsUploader.Create("player_ticks", TimeSpan.FromSeconds(TickLogging.tick_uploader_lifetime), AnalyticsDocumentMode.CSV);
BuildInfo current = BuildInfo.Current;
bool num = (current.Scm.Branch != null && current.Scm.Branch == "experimental/release") || current.Scm.Branch == "release";
bool isEditor = UnityEngine.Application.isEditor;
string text = ((num && !isEditor) ? "release" : (isEditor ? "editor" : "staging"));
TickLogging.tickUploader = AzureAnalyticsUploader.Create("player_ticks_" + text, TimeSpan.FromSeconds(TickLogging.tick_uploader_lifetime), AnalyticsDocumentMode.CSV);
}
TickLogging.tickUploader.Append(EventRecord.New("player_tick").AddField("player_userid", player.WipeId).AddField("modelstate", (player.modelStateTick ?? player.modelState).flags)
TickLogging.tickUploader.Append(EventRecord.New("player_tick").AddField("player_steamid", player.UserIDString).AddField("modelstate", (player.modelStateTick ?? player.modelState).flags)
.AddField("heldentity", (player.GetHeldEntity() != null) ? player.GetHeldEntity().ShortPrefabName : "")
.AddField("pitch", player.tickViewAngles.x)
.AddField("yaw", player.tickViewAngles.y)
@ -2327,6 +2334,23 @@ public static class Analytics
}
}
public static void OnPlayerChangeInjureState(BasePlayer player, BasePlayer.InjureState oldState, BasePlayer.InjureState newState)
{
if (!GameplayAnalytics)
{
return;
}
try
{
SubmitPoint(EventRecord.New("injure_state").AddField("player", player).AddField("old_state", (int)oldState)
.AddField("new_state", (int)newState));
}
catch (Exception exception)
{
UnityEngine.Debug.LogException(exception);
}
}
private static string GetGenesAsString(GrowableEntity plant)
{
int key = GrowableGeneEncoding.EncodeGenesToInt(plant.Genes);
@ -2580,19 +2604,17 @@ public static class Analytics
private static IEnumerator AggregatePlayers(bool blueprints = false, bool positions = false)
{
Stopwatch watch = Stopwatch.StartNew();
List<BasePlayer> list = Pool.Get<List<BasePlayer>>();
list.AddRange(BasePlayer.activePlayerList);
Dictionary<int, int> playerBps = (blueprints ? new Dictionary<int, int>() : null);
List<PlayerAggregate> playerPositions = (positions ? Pool.Get<List<PlayerAggregate>>() : null);
foreach (BasePlayer item in list)
foreach (BasePlayer activePlayer in BasePlayer.activePlayerList)
{
if (item == null || item.IsDestroyed)
if (activePlayer == null || activePlayer.IsDestroyed)
{
continue;
}
if (blueprints)
{
foreach (int unlockedItem in item.PersistantPlayerInfo.unlockedItems)
foreach (int unlockedItem in activePlayer.PersistantPlayerInfo.unlockedItems)
{
playerBps.TryGetValue(unlockedItem, out var value);
playerBps[unlockedItem] = value + 1;
@ -2601,18 +2623,19 @@ public static class Analytics
if (positions)
{
PlayerAggregate playerAggregate = Pool.Get<PlayerAggregate>();
playerAggregate.UserId = item.WipeId;
playerAggregate.Position = item.transform.position;
playerAggregate.Direction = item.eyes.bodyRotation.eulerAngles;
foreach (Item item2 in item.inventory.containerBelt.itemList)
playerAggregate.UserId = activePlayer.UserIDString;
playerAggregate.Position = activePlayer.transform.position;
playerAggregate.Direction = activePlayer.eyes.bodyRotation.eulerAngles;
foreach (Item item in activePlayer.inventory.containerBelt.itemList)
{
playerAggregate.Hotbar.Add(item2.info.shortname);
playerAggregate.Hotbar.Add(item.info.shortname);
}
foreach (Item item3 in item.inventory.containerWear.itemList)
foreach (Item item2 in activePlayer.inventory.containerWear.itemList)
{
playerAggregate.Worn.Add(item3.info.shortname);
playerAggregate.Worn.Add(item2.info.shortname);
}
playerAggregate.ActiveItem = item.GetActiveItem()?.info.shortname;
playerAggregate.ActiveItem = activePlayer.GetActiveItem()?.info.shortname;
playerAggregate.Biome = GetBiome(activePlayer.transform.position);
playerPositions.Add(playerAggregate);
}
if (watch.ElapsedMilliseconds > MaxMSPerFrame)
@ -2629,17 +2652,11 @@ public static class Analytics
value = x.Value
})));
}
if (!positions)
if (positions)
{
yield break;
SubmitPoint(EventRecord.New("player_positions").AddObject("positions", playerPositions).AddObject("player_count", playerPositions.Count));
Pool.Free(ref playerPositions, freeElements: true);
}
SubmitPoint(EventRecord.New("player_positions").AddObject("positions", playerPositions).AddObject("player_count", playerPositions.Count));
foreach (PlayerAggregate item4 in playerPositions)
{
PlayerAggregate obj = item4;
Pool.Free(ref obj);
}
Pool.Free(ref playerPositions, freeElements: false);
}
private static IEnumerator AggregateTeams()

View file

@ -223,6 +223,7 @@ public class EventRecord : Pool.IPooled
{
string userWipeId = SingletonComponent<ServerMgr>.Instance.persistance.GetUserWipeId(basePlayer.userID);
AddField(key, "_userid", userWipeId);
AddField(key, "_steamid", basePlayer.UserIDString);
AddField(key, "_modelstate", (basePlayer.modelStateTick ?? basePlayer.modelState).flags);
AddField(key, "_tickViewAngles", basePlayer.tickViewAngles);
AddField(key, "_mouse_delta", basePlayer.tickMouseDelta);
@ -257,6 +258,7 @@ public class EventRecord : Pool.IPooled
string userWipeId2 = SingletonComponent<ServerMgr>.Instance.persistance.GetUserWipeId(droppedItem.DroppedBy);
AddField("dropped_at", ((DateTimeOffset)droppedItem.DroppedTime).ToUnixTimeMilliseconds());
AddField("dropped_by", userWipeId2);
AddField("dropped_by_steam_id", droppedItem.DroppedBy);
}
if (entity is Door door)
{

Some files were not shown because too many files have changed in this diff Show more