Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions hasura/metadata/actions.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2635,3 +2635,42 @@ type TournamentInviteCodeOutput {
type TournamentDraftOutput {
teams_created: Int!
}

type Mutation {
setServerMapRotation(
server_id: uuid!
map_ids: [uuid!]!
shuffle: Boolean!
): SuccessOutput
}

type Mutation {
setServerPlugins(
server_id: uuid!
plugins: [ServerPluginInput!]!
): SuccessOutput
}

type Mutation {
importWorkshopCollection(
collection: String!
): ImportWorkshopCollectionOutput
}

input ServerPluginInput {
slug: String!
enabled: Boolean!
}

type ImportedWorkshopMap {
id: uuid!
name: String!
label: String
poster: String
workshop_map_id: String!
}

type ImportWorkshopCollectionOutput {
maps: [ImportedWorkshopMap!]!
skipped: Int!
}
27 changes: 27 additions & 0 deletions hasura/metadata/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1998,6 +1998,30 @@ actions:
- role: verified_user
- role: user
comment: Spend a tournament invite link for an unlock on an invite only tournament
- name: setServerMapRotation
definition:
kind: synchronous
handler: '{{HASURA_GRAPHQL_ACTIONS_HOOK}}'
forward_client_headers: true
permissions:
- role: administrator
comment: Replace a dedicated server's map rotation and restart it
- name: setServerPlugins
definition:
kind: synchronous
handler: '{{HASURA_GRAPHQL_ACTIONS_HOOK}}'
forward_client_headers: true
permissions:
- role: administrator
comment: Replace a dedicated server's per-server plugin overrides and restart it
- name: importWorkshopCollection
definition:
kind: synchronous
handler: '{{HASURA_GRAPHQL_ACTIONS_HOOK}}'
forward_client_headers: true
permissions:
- role: administrator
comment: Add every map in a Steam workshop collection to the map catalog
custom_types:
enums: []
input_objects:
Expand All @@ -2009,6 +2033,7 @@ custom_types:
- name: ClipSpecInput
- name: UtilityPlaybookStepInput
- name: UtilitySightlinePairInput
- name: ServerPluginInput
objects:
- name: Award
- name: AwardRecipient
Expand Down Expand Up @@ -2129,4 +2154,6 @@ custom_types:
- name: UtilityPurgeOutput
- name: UtilityRenderQueueOutput
- name: UtilityRenderClearOutput
- name: ImportedWorkshopMap
- name: ImportWorkshopCollectionOutput
scalars: []
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ select_permissions:
- config_schema
- config_path
- cvars
- map_rotation
- pairs_with
- panel
- wiring
Expand Down Expand Up @@ -92,6 +93,7 @@ insert_permissions:
- config_schema
- config_path
- cvars
- map_rotation
- pairs_with
- panel
- wiring
Expand Down Expand Up @@ -120,6 +122,7 @@ update_permissions:
- config_schema
- config_path
- cvars
- map_rotation
- pairs_with
- panel
- wiring
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
table:
name: server_map_rotation
schema: public
object_relationships:
- name: map
using:
foreign_key_constraint_on: map_id
- name: server
using:
foreign_key_constraint_on: server_id
select_permissions:
- role: guest
permission:
columns:
- map_id
- position
- server_id
filter:
server:
type:
_nin:
- Ranked
- Practice
allow_aggregations: true
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
table:
name: server_plugins
schema: public
object_relationships:
- name: install
using:
foreign_key_constraint_on: plugin_slug
- name: server
using:
foreign_key_constraint_on: server_id
select_permissions:
- role: administrator
permission:
columns:
- enabled
- plugin_slug
- server_id
filter: {}
comment: ""
17 changes: 17 additions & 0 deletions hasura/metadata/databases/default/tables/public_servers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,27 @@ object_relationships:
name: server_regions
schema: public
array_relationships:
- name: map_rotation
using:
foreign_key_constraint_on:
column: server_id
table:
name: server_map_rotation
schema: public
- name: matches
using:
foreign_key_constraint_on:
column: server_id
table:
name: matches
schema: public
- name: plugin_overrides
using:
foreign_key_constraint_on:
column: server_id
table:
name: server_plugins
schema: public
computed_fields:
- name: connection_link
definition:
Expand Down Expand Up @@ -84,6 +98,7 @@ select_permissions:
- id
- is_dedicated
- label
- map_rotation_shuffle
- max_players
- offline_at
- plugin_runtime
Expand Down Expand Up @@ -112,6 +127,7 @@ select_permissions:
- host
- id
- label
- map_rotation_shuffle
- max_players
- plugin_runtime
- plugin_version
Expand Down Expand Up @@ -144,6 +160,7 @@ select_permissions:
- id
- is_dedicated
- label
- map_rotation_shuffle
- max_players
- plugin_runtime
- plugin_version
Expand Down
2 changes: 2 additions & 0 deletions hasura/metadata/databases/default/tables/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@
- "!include public_plugin_versions.yaml"
- "!include public_push_subscriptions.yaml"
- "!include public_seasons.yaml"
- "!include public_server_map_rotation.yaml"
- "!include public_server_plugins.yaml"
- "!include public_server_regions.yaml"
- "!include public_servers.yaml"
- "!include public_settings.yaml"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ALTER TABLE public.game_plugins
DROP COLUMN IF EXISTS map_rotation;

DROP TABLE IF EXISTS public.server_plugins;

DROP TABLE IF EXISTS public.server_map_rotation;

ALTER TABLE public.servers
DROP COLUMN IF EXISTS map_rotation_shuffle;
28 changes: 28 additions & 0 deletions hasura/migrations/default/1889000000500_server_map_rotation/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ALTER TABLE public.servers
ADD COLUMN IF NOT EXISTS map_rotation_shuffle boolean NOT NULL DEFAULT true;

CREATE TABLE IF NOT EXISTS public.server_map_rotation (
server_id uuid NOT NULL,
map_id uuid NOT NULL,
position integer NOT NULL,
PRIMARY KEY (server_id, map_id),
CONSTRAINT server_map_rotation_server_fkey FOREIGN KEY (server_id)
REFERENCES public.servers (id) ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT server_map_rotation_map_fkey FOREIGN KEY (map_id)
REFERENCES public.maps (id) ON UPDATE CASCADE ON DELETE CASCADE
);

-- No row means the plugin follows its install's load flags on this server.
CREATE TABLE IF NOT EXISTS public.server_plugins (
server_id uuid NOT NULL,
plugin_slug text NOT NULL,
enabled boolean NOT NULL,
PRIMARY KEY (server_id, plugin_slug),
CONSTRAINT server_plugins_server_fkey FOREIGN KEY (server_id)
REFERENCES public.servers (id) ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT server_plugins_install_fkey FOREIGN KEY (plugin_slug)
REFERENCES public.game_plugin_installs (plugin_slug) ON UPDATE CASCADE ON DELETE CASCADE
);

ALTER TABLE public.game_plugins
ADD COLUMN IF NOT EXISTS map_rotation jsonb;
Loading
Loading