Skip to content

Commit 6962616

Browse files
Allow players to toggle realtime sync
1 parent ba0cec2 commit 6962616

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

Alidade.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MCMaps/Resources/Localizable.xcstrings

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,9 @@
425425
},
426426
"Preview Image" : {
427427

428+
},
429+
"Realtime Sync" : {
430+
428431
},
429432
"Recents" : {
430433

@@ -483,7 +486,7 @@
483486
"Show All Tips" : {
484487

485488
},
486-
"Show common points of interest and where players are on your Minecraft server from the Bluemap plugin.\n[Learn more...](http://example.com)" : {
489+
"Show common points of interest and where players are on your Minecraft server from the Bluemap plugin.\n[Learn more](http://example.com)" : {
487490

488491
},
489492
"Show in Finder" : {
@@ -551,6 +554,9 @@
551554
},
552555
"Type a tag above to create it." : {
553556

557+
},
558+
"Update player locations more frequently with Realtime Sync. [Learn more…](https://example.com)" : {
559+
554560
},
555561
"Update World" : {
556562

MCMaps/Shared/Services/CartographyIntegrationService.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ actor CartographyIntegrationService {
154154
throw .integrationDisabled
155155
}
156156

157+
if syncType == .realtime, !bluemapSettings.realtime {
158+
logger.debug("☁️ (\(syncType.logValue)) Bluemap realtime sync is not enabled. Skipping fetch.")
159+
throw .integrationDisabled
160+
}
161+
157162
let itemsToFetch = syncType == .realtime ? [.players] : bluemapSettings.displayOptions
158163
do {
159164
let response = await makeBluemapRequests(itemsToFetch: itemsToFetch, dimension: dimension)

MCMaps/Shared/Views/Forms/BluemapIntegrationFormSection.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct BluemapIntegrationFormSection: View {
2222
Text("Bluemap")
2323
} description: {
2424
// swiftlint:disable:next line_length
25-
Text("Show common points of interest and where players are on your Minecraft server from the Bluemap plugin.\n[Learn more...](http://example.com)")
25+
Text("Show common points of interest and where players are on your Minecraft server from the Bluemap plugin.\n[Learn more](http://example.com)")
2626
}
2727
Toggle("Enable Integration", isOn: $integration.enabled)
2828
} footer: {
@@ -44,8 +44,11 @@ struct BluemapIntegrationFormSection: View {
4444
step: 5
4545
)
4646
.foregroundStyle(integration.enabled ? .primary : .secondary)
47+
Toggle("Realtime Sync", isOn: $integration.realtime)
4748
} header: {
4849
Text("Bluemap Server")
50+
} footer: {
51+
Text("Update player locations more frequently with Realtime Sync. [Learn more…](https://example.com)")
4952
}
5053
.disabled(!integration.enabled)
5154

0 commit comments

Comments
 (0)