feat(plugin): gate pages on companion features
This commit is contained in:
@@ -66,6 +66,15 @@ type GameClientBridgePageContract struct {
|
||||
CommandTypes []string
|
||||
SnapshotTypes []string
|
||||
QueryTemplateKeys []string
|
||||
FeatureKeys []string
|
||||
}
|
||||
|
||||
type GameClientBridgeFeatureDeclaration struct {
|
||||
Key string
|
||||
Title string
|
||||
Permission string
|
||||
RequiredHandlers []string
|
||||
RequiredEventProducers []string
|
||||
}
|
||||
|
||||
type GameClientBridgeCompanionDeclaration struct {
|
||||
@@ -90,6 +99,7 @@ type GameClientBridgeManifest struct {
|
||||
QueryTemplates []GameClientBridgeQueryTemplateDeclaration
|
||||
Retention GameClientBridgeRetention
|
||||
Pages []GameClientBridgePageContract
|
||||
Features []GameClientBridgeFeatureDeclaration
|
||||
Companion GameClientBridgeCompanionDeclaration
|
||||
}
|
||||
|
||||
@@ -278,13 +288,21 @@ type GameClientBridgeSnapshotQuery struct {
|
||||
}
|
||||
|
||||
type GameClientBridgeProfileDeclaration struct {
|
||||
PluginID string
|
||||
ProfileKey string
|
||||
Available bool
|
||||
Reason string
|
||||
CommandTypes []string
|
||||
SnapshotTypes []string
|
||||
QueryTemplateKeys []string
|
||||
PluginID string
|
||||
ProfileKey string
|
||||
Available bool
|
||||
Reason string
|
||||
CommandTypes []string
|
||||
SnapshotTypes []string
|
||||
QueryTemplateKeys []string
|
||||
HandlerTypes []string
|
||||
EventProducerTypes []string
|
||||
}
|
||||
|
||||
type GameClientBridgeFeatureAvailability struct {
|
||||
Key string
|
||||
Available bool
|
||||
Reason string
|
||||
}
|
||||
|
||||
type GameClientBridgeStatus struct {
|
||||
@@ -293,12 +311,15 @@ type GameClientBridgeStatus struct {
|
||||
Available bool
|
||||
Reason string
|
||||
Profiles []GameClientBridgeProfileDeclaration
|
||||
Features []GameClientBridgeFeatureAvailability
|
||||
}
|
||||
|
||||
func CopyGameClientBridgeProfileDeclaration(value GameClientBridgeProfileDeclaration) GameClientBridgeProfileDeclaration {
|
||||
value.CommandTypes = CopyStringSlice(value.CommandTypes)
|
||||
value.SnapshotTypes = CopyStringSlice(value.SnapshotTypes)
|
||||
value.QueryTemplateKeys = CopyStringSlice(value.QueryTemplateKeys)
|
||||
value.HandlerTypes = CopyStringSlice(value.HandlerTypes)
|
||||
value.EventProducerTypes = CopyStringSlice(value.EventProducerTypes)
|
||||
return value
|
||||
}
|
||||
|
||||
@@ -307,6 +328,7 @@ func CopyGameClientBridgeStatus(value GameClientBridgeStatus) GameClientBridgeSt
|
||||
for index := range value.Profiles {
|
||||
value.Profiles[index] = CopyGameClientBridgeProfileDeclaration(value.Profiles[index])
|
||||
}
|
||||
value.Features = append([]GameClientBridgeFeatureAvailability(nil), value.Features...)
|
||||
return value
|
||||
}
|
||||
|
||||
@@ -365,10 +387,16 @@ func CopyGameClientBridgeManifest(value GameClientBridgeManifest) GameClientBrid
|
||||
value.Snapshots = append([]GameClientBridgeSnapshotDeclaration(nil), value.Snapshots...)
|
||||
value.QueryTemplates = append([]GameClientBridgeQueryTemplateDeclaration(nil), value.QueryTemplates...)
|
||||
value.Pages = append([]GameClientBridgePageContract(nil), value.Pages...)
|
||||
value.Features = append([]GameClientBridgeFeatureDeclaration(nil), value.Features...)
|
||||
for index := range value.Pages {
|
||||
value.Pages[index].CommandTypes = CopyStringSlice(value.Pages[index].CommandTypes)
|
||||
value.Pages[index].SnapshotTypes = CopyStringSlice(value.Pages[index].SnapshotTypes)
|
||||
value.Pages[index].QueryTemplateKeys = CopyStringSlice(value.Pages[index].QueryTemplateKeys)
|
||||
value.Pages[index].FeatureKeys = CopyStringSlice(value.Pages[index].FeatureKeys)
|
||||
}
|
||||
for index := range value.Features {
|
||||
value.Features[index].RequiredHandlers = CopyStringSlice(value.Features[index].RequiredHandlers)
|
||||
value.Features[index].RequiredEventProducers = CopyStringSlice(value.Features[index].RequiredEventProducers)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user