Skip to content

Commit 7a753e0

Browse files
committed
fix: partially undo the change I made 4 hours ago, GameBorderStyle 2 should be no camera holds (all false), instead of all true
1 parent 395a0f2 commit 7a753e0

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

Intersect (Core)/Network/Packets/Server/MapPacket.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public MapPacket(
3131
int revision = -1,
3232
int gridX = -1,
3333
int gridY = -1,
34-
bool[] borders = null
34+
bool[]? borders = null
3535
)
3636
{
3737
MapId = mapId;
@@ -70,7 +70,7 @@ public MapPacket(
7070
public int GridY { get; set; }
7171

7272
[Key(8)]
73-
public bool[] CameraHolds { get; set; }
73+
public bool[]? CameraHolds { get; set; }
7474

7575
[IgnoreMember]
7676
public string? CacheChecksum
@@ -102,13 +102,13 @@ public string? CacheVersion
102102
}
103103
}
104104

105-
public static string ComputeCacheVersion(Guid id, int revision, int gridX, int gridY, bool[] cameraHolds)
105+
public static string ComputeCacheVersion(Guid id, int revision, int gridX, int gridY, bool[]? cameraHolds)
106106
{
107107
var hashInputData = id.ToByteArray()
108108
.Concat(BitConverter.GetBytes(revision))
109109
.Concat(BitConverter.GetBytes(gridX))
110110
.Concat(BitConverter.GetBytes(gridY))
111-
.Concat(cameraHolds.SelectMany(BitConverter.GetBytes))
111+
.Concat(cameraHolds?.SelectMany(BitConverter.GetBytes) ?? [])
112112
.ToArray();
113113
var versionData = SHA256.HashData(hashInputData);
114114
var version = Convert.ToBase64String(versionData);

Intersect.Client.Core/Networking/PacketHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ private void HandleMap(IPacketSender packetSender, MapPacket packet, bool skipSa
245245
packet.GridY,
246246
packet.Revision,
247247
packet.CacheVersion,
248-
$"[{string.Join(", ", packet.CameraHolds)}]"
248+
$"[{string.Join(", ", packet.CameraHolds ?? [])}]"
249249
);
250250

251251
ObjectCacheData<MapBase> cacheData = new()
@@ -305,7 +305,7 @@ private void HandleMap(IPacketSender packetSender, MapPacket packet, bool skipSa
305305

306306
mapInstance.GridX = gridPosition.X;
307307
mapInstance.GridY = gridPosition.Y;
308-
mapInstance.CameraHolds = packet.CameraHolds;
308+
mapInstance.CameraHolds = packet.CameraHolds ?? [false, false, false, false];
309309

310310
ApplicationContext.CurrentContext.Logger.LogDebug(
311311
"Loading map {Id} ({Name}) @ ({GridX}, {GridY}) revision {Revision} version {Version} holds {CameraHolds}",

Intersect.Server.Core/Maps/MapController.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,13 @@ public int MapGridY
9090
}
9191
}
9292

93-
public bool[] GetCameraHolds()
93+
public bool[]? GetCameraHolds()
9494
{
9595
switch (Options.Instance.Map.GameBorderStyle)
9696
{
9797
case 1:
9898
return [true, true, true, true];
9999

100-
break;
101-
102100
case 0:
103101
var grid = DbInterface.GetGrid(MapGrid);
104102
if (grid != null)
@@ -115,7 +113,7 @@ public bool[] GetCameraHolds()
115113
break;
116114
}
117115

118-
return [true, true, true, true];
116+
return null;
119117
}
120118

121119
//Temporary Values

0 commit comments

Comments
 (0)