Skip to content

Commit 6cf19da

Browse files
authored
Merge pull request #6294 from decentraland/hotfix/2025-11-28
hotfix: reduced gc allocs and scene loading radius
2 parents 8b9802c + fdb9e04 commit 6cf19da

3 files changed

Lines changed: 22 additions & 35 deletions

File tree

Explorer/Assets/DCL/Quality/Quality Settings.asset

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ MonoBehaviour:
367367
lensFlareEnabled: 1
368368
lensFlareComponent: {fileID: 4642727729545981125, guid: 771c68288bf78564cb5301f95b69811d, type: 3}
369369
environmentSettings:
370-
sceneLoadRadius: 50
370+
sceneLoadRadius: 20
371371
lod1Threshold: 5
372372
terrainLODBias: 100
373373
detailDensity: 70
@@ -428,7 +428,7 @@ MonoBehaviour:
428428
lensFlareEnabled: 0
429429
lensFlareComponent: {fileID: 2726953631672280614, guid: 91fed6d77ceea8246b3d136a8e67a12c, type: 3}
430430
environmentSettings:
431-
sceneLoadRadius: 80
431+
sceneLoadRadius: 20
432432
lod1Threshold: 5
433433
terrainLODBias: 125
434434
detailDensity: 100
@@ -488,20 +488,20 @@ MonoBehaviour:
488488
- {fileID: 2915607160997281497, guid: 0c7b9d3b12885d541a70add26520ccdb, type: 2}
489489
- {fileID: -1628976218549508611, guid: 0c7b9d3b12885d541a70add26520ccdb, type: 2}
490490
- {fileID: 6840260418858268937, guid: 0c7b9d3b12885d541a70add26520ccdb, type: 2}
491-
- {fileID: -4906195724866340262, guid: 0c7b9d3b12885d541a70add26520ccdb, type: 2}
492491
- {fileID: -9034674521452425196, guid: 0c7b9d3b12885d541a70add26520ccdb, type: 2}
492+
- {fileID: -9074318883601618405, guid: 0c7b9d3b12885d541a70add26520ccdb, type: 2}
493493
- {fileID: 1798844783772877419, guid: 8fcac0d7d22effc45a7f7b4f87116a61, type: 2}
494494
- {fileID: -2161158766388826272, guid: 8fcac0d7d22effc45a7f7b4f87116a61, type: 2}
495495
- {fileID: -8887782192993502672, guid: 8fcac0d7d22effc45a7f7b4f87116a61, type: 2}
496496
- {fileID: 6470208710530210403, guid: 8fcac0d7d22effc45a7f7b4f87116a61, type: 2}
497-
- {fileID: -3253943072471734078, guid: 8fcac0d7d22effc45a7f7b4f87116a61, type: 2}
498497
- {fileID: 8547050541902374763, guid: 8fcac0d7d22effc45a7f7b4f87116a61, type: 2}
498+
- {fileID: 4851537350754814979, guid: 8fcac0d7d22effc45a7f7b4f87116a61, type: 2}
499499
- {fileID: 1757973802043764545, guid: fef5685522a9f2e4181cc4c31f10f100, type: 2}
500500
- {fileID: 4908790961291395409, guid: fef5685522a9f2e4181cc4c31f10f100, type: 2}
501501
- {fileID: -4982935907446270823, guid: fef5685522a9f2e4181cc4c31f10f100, type: 2}
502502
- {fileID: 5175788798212861771, guid: fef5685522a9f2e4181cc4c31f10f100, type: 2}
503-
- {fileID: -7326921190901022776, guid: fef5685522a9f2e4181cc4c31f10f100, type: 2}
504503
- {fileID: -4991993260910906933, guid: fef5685522a9f2e4181cc4c31f10f100, type: 2}
504+
- {fileID: 8054367766033506950, guid: fef5685522a9f2e4181cc4c31f10f100, type: 2}
505505
--- !u!114 &627882838885633079
506506
MonoBehaviour:
507507
m_ObjectHideFlags: 3

Explorer/Assets/DCL/SceneBannedUsers/BannedUsersFromCurrentScene.cs

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,22 @@ public partial class BannedUsersFromCurrentScene
1717
private readonly bool includeBannedUsersFromScene;
1818

1919
private CancellationTokenSource checkIfPlayerIsBannedCts;
20+
private string roomMetadata = string.Empty;
21+
private BannedUsersRoomMetadata bannedUsersRoomMetadata;
2022

2123
public BannedUsersFromCurrentScene(
2224
IRoomHub roomHub,
2325
bool includeBannedUsersFromScene)
2426
{
2527
this.roomHub = roomHub;
2628
this.includeBannedUsersFromScene = includeBannedUsersFromScene;
29+
roomHub.SceneRoom().Room().RoomMetadataChanged += OnRoomMetadataChanged;
30+
}
31+
32+
private void OnRoomMetadataChanged(string metadata)
33+
{
34+
roomMetadata = metadata;
35+
bannedUsersRoomMetadata = JsonConvert.DeserializeObject<BannedUsersRoomMetadata>(roomMetadata);
2736
}
2837

2938
/// <summary>
@@ -39,13 +48,9 @@ public bool IsUserBanned(string userId)
3948
if (roomHub.SceneRoom().Room().Info.ConnectionState != ConnectionState.ConnConnected)
4049
return false;
4150

42-
string roomMetadata = roomHub.SceneRoom().Room().Info.Metadata;
43-
4451
if (string.IsNullOrEmpty(roomMetadata))
4552
return false;
4653

47-
BannedUsersRoomMetadata bannedUsersRoomMetadata = JsonConvert.DeserializeObject<BannedUsersRoomMetadata>(roomMetadata);
48-
4954
if (bannedUsersRoomMetadata.bannedAddresses == null)
5055
return false;
5156

@@ -57,27 +62,5 @@ public bool IsUserBanned(string userId)
5762

5863
return false;
5964
}
60-
61-
/// <summary>
62-
/// Returns the number of banned users from the current scene.
63-
/// </summary>
64-
/// <returns>Number of banned users from the current scene.</returns>
65-
public int BannedUsersCount()
66-
{
67-
if (!includeBannedUsersFromScene)
68-
return 0;
69-
70-
if (roomHub.SceneRoom().Room().Info.ConnectionState != ConnectionState.ConnConnected)
71-
return 0;
72-
73-
string roomMetadata = roomHub.SceneRoom().Room().Info.Metadata;
74-
75-
if (string.IsNullOrEmpty(roomMetadata))
76-
return 0;
77-
78-
BannedUsersRoomMetadata bannedUsersRoomMetadata = JsonConvert.DeserializeObject<BannedUsersRoomMetadata>(roomMetadata);
79-
80-
return bannedUsersRoomMetadata.bannedAddresses?.Length ?? 0;
81-
}
8265
}
8366
}

Explorer/ProjectSettings/QualitySettings.asset

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ QualitySettings:
66
serializedVersion: 5
77
m_CurrentQuality: 0
88
m_QualitySettings:
9-
- serializedVersion: 4
9+
- serializedVersion: 5
1010
name: Low
1111
pixelLightCount: 0
1212
shadows: 0
@@ -34,6 +34,7 @@ QualitySettings:
3434
adaptiveVsyncExtraA: 0
3535
adaptiveVsyncExtraB: 0
3636
lodBias: 0.75
37+
meshLodThreshold: 1
3738
maximumLODLevel: 0
3839
enableLODCrossFade: 1
3940
streamingMipmapsActive: 1
@@ -58,7 +59,7 @@ QualitySettings:
5859
terrainFadeLength: 5
5960
terrainMaxTrees: 50
6061
excludedTargetPlatforms: []
61-
- serializedVersion: 4
62+
- serializedVersion: 5
6263
name: Medium
6364
pixelLightCount: 0
6465
shadows: 0
@@ -86,6 +87,7 @@ QualitySettings:
8687
adaptiveVsyncExtraA: 0
8788
adaptiveVsyncExtraB: 0
8889
lodBias: 1
90+
meshLodThreshold: 1
8991
maximumLODLevel: 0
9092
enableLODCrossFade: 1
9193
streamingMipmapsActive: 1
@@ -110,7 +112,7 @@ QualitySettings:
110112
terrainFadeLength: 5
111113
terrainMaxTrees: 50
112114
excludedTargetPlatforms: []
113-
- serializedVersion: 4
115+
- serializedVersion: 5
114116
name: High
115117
pixelLightCount: 0
116118
shadows: 0
@@ -138,6 +140,7 @@ QualitySettings:
138140
adaptiveVsyncExtraA: 0
139141
adaptiveVsyncExtraB: 0
140142
lodBias: 1.25
143+
meshLodThreshold: 1
141144
maximumLODLevel: 0
142145
enableLODCrossFade: 1
143146
streamingMipmapsActive: 1
@@ -163,4 +166,5 @@ QualitySettings:
163166
terrainMaxTrees: 50
164167
excludedTargetPlatforms: []
165168
m_TextureMipmapLimitGroupNames: []
166-
m_PerPlatformDefaultQuality: {}
169+
m_PerPlatformDefaultQuality:
170+
Standalone: 0

0 commit comments

Comments
 (0)