Skip to content

Commit 79a7f4f

Browse files
authored
Merge branch 'Facepunch:master' into notification-tooltip
2 parents dbc26a0 + e4e0cf0 commit 79a7f4f

File tree

135 files changed

+4657
-1237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+4657
-1237
lines changed

.github/workflows/pull_request.yml

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,48 @@ jobs:
88
runs-on: ubuntu-latest
99
if: github.event.label.name == 'triaged'
1010
steps:
11+
- name: Ensure PR checks passed
12+
uses: actions/github-script@v7
13+
with:
14+
github-token: ${{ secrets.GITHUB_TOKEN }}
15+
script: |
16+
const requiredChecks = ['format', 'tests'];
17+
18+
const pr = context.payload.pull_request;
19+
if (!pr) {
20+
throw new Error('No pull request found in event payload.');
21+
}
22+
23+
const { data } = await github.rest.checks.listForRef({
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
ref: pr.head.sha,
27+
per_page: 100
28+
});
29+
30+
const checkRuns = data.check_runs ?? [];
31+
for (const requiredCheck of requiredChecks) {
32+
const match = checkRuns.find(run => (run.name ?? '') === requiredCheck);
33+
34+
if (!match || match.conclusion !== 'success') {
35+
const status = match ? (match.conclusion ?? match.status ?? 'unknown') : 'missing';
36+
core.warning(`Required check '${requiredCheck}' did not pass (${status}).`);
37+
throw new Error('Cannot triage until required checks succeed. Remove and re-add the triaged label to retry.');
38+
}
39+
}
40+
1141
- name: Repository Dispatch
12-
uses: peter-evans/repository-dispatch@v4
42+
uses: actions/github-script@v7
43+
env:
44+
DISPATCH_CONTEXT: ${{ toJson(github) }}
1345
with:
14-
token: ${{ secrets.SBOXBOT_TOKEN }}
15-
repository: Facepunch/sbox
16-
event-type: pr-triaged
17-
client-payload: '{"github": ${{ toJson(github) }}}'
46+
github-token: ${{ secrets.SBOXBOT_TOKEN }}
47+
script: |
48+
const clientPayload = JSON.parse(process.env.DISPATCH_CONTEXT);
49+
50+
await github.rest.repos.createDispatchEvent({
51+
owner: 'Facepunch',
52+
repo: 'sbox',
53+
event_type: 'pr-triaged',
54+
client_payload: { github: clientPayload }
55+
});

.github/workflows/pull_request_checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pull Request Checks
1+
name: Tests
22

33
on:
44
pull_request:
@@ -8,7 +8,7 @@ permissions:
88
contents: read
99

1010
jobs:
11-
format:
11+
tests:
1212
runs-on: [ windows-latest ]
1313
steps:
1414
- name: Full Checkout
File renamed without changes.

engine/Definitions/common/Physics/IPhysicsJoint.def

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,43 @@ native class IPhysicsJoint as NativeEngine.IPhysicsJoint
7979
float Motor_GetAngularDampingRatio();
8080
float Motor_GetMaxSpringForce();
8181
float Motor_GetMaxSpringTorque();
82+
83+
void Wheel_EnableSuspension( bool flag );
84+
bool Wheel_IsSuspensionEnabled();
85+
void Wheel_SetSuspensionHertz( float hertz );
86+
float Wheel_GetSuspensionHertz();
87+
void Wheel_SetSuspensionDampingRatio( float dampingRatio );
88+
float Wheel_GetSuspensionDampingRatio();
89+
void Wheel_EnableSuspensionLimit( bool flag );
90+
bool Wheel_IsSuspensionLimitEnabled();
91+
float Wheel_GetLowerSuspensionLimit();
92+
float Wheel_GetUpperSuspensionLimit();
93+
void Wheel_SetSuspensionLimits( float lower, float upper );
94+
void Wheel_EnableSpinMotor( bool flag );
95+
bool Wheel_IsSpinMotorEnabled();
96+
void Wheel_SetSpinMotorSpeed( float speed );
97+
float Wheel_GetSpinMotorSpeed();
98+
void Wheel_SetMaxSpinTorque( float torque );
99+
float Wheel_GetMaxSpinTorque();
100+
void Wheel_EnableSteering( bool flag );
101+
bool Wheel_IsSteeringEnabled();
102+
void Wheel_SetSteeringHertz( float hertz );
103+
float Wheel_GetSteeringHertz();
104+
void Wheel_SetSteeringDampingRatio( float dampingRatio );
105+
float Wheel_GetSteeringDampingRatio();
106+
void Wheel_SetMaxSteeringTorque( float torque );
107+
float Wheel_GetMaxSteeringTorque();
108+
void Wheel_EnableSteeringLimit( bool flag );
109+
bool Wheel_IsSteeringLimitEnabled();
110+
float Wheel_GetLowerSteeringLimit();
111+
float Wheel_GetUpperSteeringLimit();
112+
void Wheel_SetSteeringLimits( float lowerRadians, float upperRadians );
113+
void Wheel_SetTargetSteeringAngle( float radians );
114+
float Wheel_GetTargetSteeringAngle();
115+
float Wheel_GetSpinSpeed();
116+
float Wheel_GetSpinTorque();
117+
float Wheel_GetSteeringAngle();
118+
float Wheel_GetSteeringTorque();
82119
}
83120

84121
managed static class Sandbox.Physics.PhysicsEngine

engine/Definitions/common/Physics/IPhysicsWorld.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ native class IPhysicsWorld
4343
IPhysicsJoint AddPrismaticJoint( IPhysicsBody pBody1, IPhysicsBody pBody2, Transform localFrame1, Transform localFrame2 );
4444
IPhysicsJoint AddSphericalJoint( IPhysicsBody pBody1, IPhysicsBody pBody2, Transform localFrame1, Transform localFrame2 );
4545
IPhysicsJoint AddMotorJoint( IPhysicsBody pBody1, IPhysicsBody pBody2, Transform localFrame1, Transform localFrame2 );
46+
IPhysicsJoint AddWheelJoint( IPhysicsBody pBody1, IPhysicsBody pBody2, Transform localFrame1, Transform localFrame2 );
4647

4748
//
4849
// Sets the collision rules using a json serialized Sandbox.Internal.CollisionRules

engine/Definitions/engine/engine.globals.def

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,6 @@ native static class global as NativeEngine.EngineGlobal
6666
bool SourceEngineFrame( CMaterialSystem2AppSystemDict appDict, double currentTime, double previousTime );
6767
void SourceEngineShutdown( CMaterialSystem2AppSystemDict appDict, bool forced );
6868

69-
inline void UpdateWindowSize()
70-
{
71-
VideoModeChange_t* pModeChange = g_pEngineServiceMgr->GetVideoModeChange();
72-
if ( pModeChange )
73-
{
74-
g_pRenderService->SetVideoMode( pModeChange->m_deviceInfo );
75-
pModeChange->ModeChangeComplete();
76-
}
77-
78-
SwapChainHandle_t m_hSwapChain = g_pEngineServiceMgr->GetEngineSwapChain();
79-
RenderViewport_t renderViewport;
80-
renderViewport.Init( 0, 0, 512, 512, 0, 1 );
81-
82-
CRenderContextPtr pRenderContext( g_pRenderDevice, RenderTargetDesc_t( m_hSwapChain, RENDER_SRGB ), "Clear" );
83-
pRenderContext->Clear( Vector4D( 0, 0, 0, 0 ) );
84-
pRenderContext->SetViewports( 1, &renderViewport );
85-
86-
pRenderContext->Submit();
87-
g_pRenderDevice->Present( m_hSwapChain );
88-
}
89-
9069
inline float GetDiagonalDpi()
9170
{
9271
return Plat_GetDPI();

engine/Mounting/Sandbox.Mounting/MountedGame/BaseGameMount.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ internal async Task MountInternal()
6363

6464
await Mount( new MountContext( this ) );
6565

66-
foreach ( var entry in _entries )
66+
foreach ( var entry in _entries.Values )
6767
{
6868
RootFolder.AddResource( entry );
6969
}
@@ -81,7 +81,7 @@ internal void ShutdownInternal()
8181

8282
Shutdown();
8383

84-
foreach ( var entry in _entries )
84+
foreach ( var entry in _entries.Values )
8585
{
8686
entry?.ShutdownInternal();
8787
}
@@ -98,19 +98,18 @@ protected virtual void Shutdown()
9898

9999
}
100100

101-
readonly List<ResourceLoader> _entries = [];
101+
readonly Dictionary<string, ResourceLoader> _entries = [];
102102

103103
/// <summary>
104104
/// All of the resources in this game
105105
/// </summary>
106-
public IReadOnlyCollection<ResourceLoader> Resources => _entries.AsReadOnly();
106+
public IReadOnlyCollection<ResourceLoader> Resources => _entries.Values;
107107

108108
public ResourceFolder RootFolder { get; internal set; }
109109

110110
internal void RegisterFileInternal( ResourceLoader entry )
111111
{
112-
_entries.Add( entry );
113-
112+
_entries[entry.Path] = entry;
114113
}
115114

116115
/// <summary>

engine/Sandbox.Access/Rules/BaseAccess.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ internal static partial class Rules
1818
"System.Private.CoreLib/System.Collections.*",
1919
"System.Collections/System.Collections.*",
2020
"System.Collections.Immutable/System.Collections.Immutable.*",
21+
"System.Collections.Immutable/System.Collections.Frozen.*",
2122
"System.Collections.Immutable/System.Linq.ImmutableArrayExtensions.*",
2223
"System.ObjectModel/System.Collections.ObjectModel.*",
2324
"System.ObjectModel/System.Collections.Specialized.*",

engine/Sandbox.Engine/Core/Interop/Handle.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ internal static int RegisterHandle( IntPtr ptr, uint type )
136136
if ( type == Types.PhysicsSphericalJoint ) return New( ptr, ( h ) => new Sandbox.Physics.BallSocketJoint( h ) );
137137
if ( type == Types.PhysicsPulleyJoint ) return New( ptr, ( h ) => new Sandbox.Physics.PulleyJoint( h ) );
138138
if ( type == Types.PhysicsMotorJoint ) return New( ptr, ( h ) => new Sandbox.Physics.ControlJoint( h ) );
139+
if ( type == Types.PhysicsWheelJoint ) return New( ptr, ( h ) => new Sandbox.Physics.WheelJoint( h ) );
139140
if ( type == Types.PhysicsJoint ) return New( ptr, ( h ) => new Sandbox.Physics.PhysicsJoint( h ) );
140141

141142
if ( type == Types.PhysicsConicalJoint ) return New( ptr, ( h ) => new Sandbox.Physics.PhysicsJoint( h ) );
@@ -193,6 +194,7 @@ static class Types
193194
internal static uint PhysicsPrismaticJoint { get; } = StringToken.FindOrCreate( "PhysicsPrismaticJoint" );
194195
internal static uint PhysicsConicalJoint { get; } = StringToken.FindOrCreate( "PhysicsConicalJoint" );
195196
internal static uint PhysicsMotorJoint { get; } = StringToken.FindOrCreate( "PhysicsMotorJoint" );
197+
internal static uint PhysicsWheelJoint { get; } = StringToken.FindOrCreate( "PhysicsWheelJoint" );
196198
internal static uint PhysicsPulleyJoint { get; } = StringToken.FindOrCreate( "PhysicsPulleyJoint" );
197199
internal static uint PhysicsGenericJoint { get; } = StringToken.FindOrCreate( "PhysicsGenericJoint" );
198200
internal static uint PhysicsNullJoint { get; } = StringToken.FindOrCreate( "PhysicsNullJoint" );

engine/Sandbox.Engine/Protocol.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static class Protocol
1313
/// <summary>
1414
/// We cannot talk to servers or clients with a network protocol different to this.
1515
/// </summary>
16-
public static int Network => 1094;
16+
public static int Network => 1095;
1717
}
1818

1919
// Api Versions
@@ -24,6 +24,7 @@ public static class Protocol
2424

2525

2626
// Network Versions
27+
// 1095. 23rd November 2025 - Snapshot parent salt
2728
// 1094. 10th November 2025 - Network visibility
2829
// 1093. 13th October 2025 - LZ4 compression
2930
// 1092. 1st October 2025 - Networking optimizations

0 commit comments

Comments
 (0)