Skip to content

Commit daf8fbd

Browse files
authored
Merge branch 'Facepunch:master' into feature/fix-regex
2 parents 4d71232 + 36122b4 commit daf8fbd

File tree

160 files changed

+5036
-1394
lines changed

Some content is hidden

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

160 files changed

+5036
-1394
lines changed

.github/workflows/pull_request.yml

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pull Request
1+
name: PR Triage
22
on:
33
pull_request_target:
44
types: [ labeled ]
@@ -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: 4 additions & 7 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
@@ -22,11 +22,8 @@ jobs:
2222
with:
2323
dotnet-version: '10.0.x'
2424

25-
- name: Format
26-
run: dotnet run --project .\engine\Tools\SboxBuild\SboxBuild.csproj -- format --verify
27-
28-
- name: Bootstrap
29-
run: .\Bootstrap.bat
25+
- name: Build
26+
run: dotnet run --project .\engine\Tools\SboxBuild\SboxBuild.csproj -- build --config Developer
3027

3128
- name: Test
3229
run: dotnet run --project .\engine\Tools\SboxBuild\SboxBuild.csproj -- test
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Formatting
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
format:
12+
runs-on: [ windows-latest ]
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
clean: true
18+
fetch-depth: 1
19+
persist-credentials: false
20+
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v5
23+
with:
24+
dotnet-version: '10.0.x'
25+
26+
- name: Format
27+
run: dotnet run --project .\engine\Tools\SboxBuild\SboxBuild.csproj -- format --verify

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/Definitions/resources/CPhysAggregateData.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ native class VPhysXBodyPart_t
7777
float m_flInertiaScale;
7878
float m_flLinearDamping;
7979
float m_flAngularDamping;
80+
float m_flGravityScale;
8081

8182
bool m_bOverrideMassCenter;
8283
Vector3 m_vMassCenterOverride;

engine/Definitions/tools/widgetutil.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ native static class WidgetUtil Native.WidgetUtil
1717
static void PostKeyEvent( QWidget target, int key );
1818

1919
static void PaintSetFont( QPainter painter, string fontName, int size, int weight, bool italic, bool heightInPixels );
20-
static SwapChainHandle_t CreateSwapChain( QWidget target );
20+
static SwapChainHandle_t CreateSwapChain( QWidget target, RenderMultisampleType_t nMSAAAmount );
2121

2222
static void SetWindowNoActivate( QWidget widget );
2323

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.*",

0 commit comments

Comments
 (0)