docs(reference): import Dune: Awakening server-manager references
Phase 2 references for the host-agent Dune adapter, moved out of volatile /tmp
into docs/reference-repos/ (per Commander). Three upstream projects, .git +
node_modules + compiled binaries stripped (16MB source). Nested AI-instruction
files (.claude/, CLAUDE.md) removed so they don't pollute Corrosion sessions.
- icehunter/ dune-admin (Go+React) — 4 control planes; SETUP_DOCKER.md is the
closest analog to our agent's Dune docker control plane (compose
lifecycle, docker logs, RabbitMQ-via-exec, dune Postgres schema)
- adainrivers/ Rust/Tauri desktop — SSH+k8s BattleGroup control, maintenance
daemon, in-game admin console (Rust idiom reference)
- the4rchangel/ Node web UI replacing battlegroup.bat — matches the Commander's
Hyper-V self-host path + game-config schema
See docs/reference-repos/README.md for the full index + how we use each.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
-- create_server_player_access_codes(in_account_id bigint, in_access_code integer, in_access_code_type integer, in_is_resettable boolean) -> void
|
||||
-- oid: 58185 kind: FUNCTION category: server
|
||||
|
||||
CREATE OR REPLACE FUNCTION dune.create_server_player_access_codes(in_account_id bigint, in_access_code integer, in_access_code_type integer, in_is_resettable boolean)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
BEGIN
|
||||
INSERT INTO player_access_codes(account_id, access_code, access_code_type,is_resettable)
|
||||
VALUES(in_account_id, in_access_code, in_access_code_type, in_is_resettable);
|
||||
END; $function$
|
||||
@@ -0,0 +1,14 @@
|
||||
-- delete_server_player_access_codes(in_account_id bigint, in_access_code integer, in_access_code_type integer) -> void
|
||||
-- oid: 58229 kind: FUNCTION category: server
|
||||
|
||||
CREATE OR REPLACE FUNCTION dune.delete_server_player_access_codes(in_account_id bigint, in_access_code integer, in_access_code_type integer)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
BEGIN
|
||||
DELETE FROM player_access_codes
|
||||
WHERE account_id = in_account_id
|
||||
AND access_code = in_access_code
|
||||
AND access_code_type = in_access_code_type;
|
||||
END
|
||||
$function$
|
||||
@@ -0,0 +1,14 @@
|
||||
-- get_active_servers_for_gateway() -> TABLE(server_id text, map text, partition_id bigint, dimension_index integer, game_addr inet, game_port integer, revision integer)
|
||||
-- oid: 58270 kind: FUNCTION category: server
|
||||
-- comment: Used by the gateway service to monitor for active servers.
|
||||
|
||||
CREATE OR REPLACE FUNCTION dune.get_active_servers_for_gateway()
|
||||
RETURNS TABLE(server_id text, map text, partition_id bigint, dimension_index integer, game_addr inet, game_port integer, revision integer)
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
DECLARE
|
||||
BEGIN
|
||||
-- If we have no partitions, assume dimension 0
|
||||
return query select fs.server_id, fs.map, wp.partition_id, coalesce(wp.dimension_index, 0), fs.game_addr, fs.game_port, fs.revision from active_server_ids as asi left join world_partition as wp on asi.server_id = wp.server_id join farm_state as fs on fs.server_id = asi.server_id;
|
||||
END
|
||||
$function$
|
||||
@@ -0,0 +1,10 @@
|
||||
-- mark_server_dead(in_server_id text) -> void
|
||||
-- oid: 58473 kind: FUNCTION category: server
|
||||
|
||||
CREATE OR REPLACE FUNCTION dune.mark_server_dead(in_server_id text)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
BEGIN
|
||||
UPDATE farm_state SET alive = false WHERE server_id = in_server_id;
|
||||
END $function$
|
||||
@@ -0,0 +1,24 @@
|
||||
-- register_lore_pickup(in_lore_pickup_ids text[]) -> SETOF smallint
|
||||
-- oid: 58507 kind: FUNCTION category: server
|
||||
|
||||
CREATE OR REPLACE FUNCTION dune.register_lore_pickup(in_lore_pickup_ids text[])
|
||||
RETURNS SETOF smallint
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
BEGIN
|
||||
RETURN query WITH
|
||||
input AS (
|
||||
SELECT UNNEST (in_lore_pickup_ids) as lore_pickup_id
|
||||
),
|
||||
existing AS (
|
||||
SELECT incremental_id, lore_pickup_id FROM lore_pickups WHERE lore_pickup_id = ANY(SELECT lore_pickup_id FROM input)
|
||||
),
|
||||
inserted AS (
|
||||
INSERT INTO lore_pickups("lore_pickup_id") SELECT lore_pickup_id FROM input WHERE NOT lore_pickup_id = ANY(SELECT lore_pickup_id FROM existing) returning incremental_id, lore_pickup_id
|
||||
),
|
||||
combined AS (
|
||||
SELECT incremental_id, lore_pickup_id FROM existing UNION ALL SELECT incremental_id, lore_pickup_id FROM inserted
|
||||
)
|
||||
SELECT incremental_id FROM combined ORDER BY lore_pickup_id;
|
||||
END
|
||||
$function$
|
||||
@@ -0,0 +1,15 @@
|
||||
-- register_per_player_lore_pickup(in_lore_pickup_ids text[], in_use_temporary boolean) -> SETOF smallint
|
||||
-- oid: 58510 kind: FUNCTION category: server
|
||||
|
||||
CREATE OR REPLACE FUNCTION dune.register_per_player_lore_pickup(in_lore_pickup_ids text[], in_use_temporary boolean)
|
||||
RETURNS SETOF smallint
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
BEGIN
|
||||
IF in_use_temporary THEN
|
||||
RETURN query select * from register_temporary_lore_pickup(in_lore_pickup_ids);
|
||||
ELSE
|
||||
RETURN query select * from register_lore_pickup(in_lore_pickup_ids);
|
||||
END IF;
|
||||
END
|
||||
$function$
|
||||
@@ -0,0 +1,24 @@
|
||||
-- register_temporary_lore_pickup(in_lore_pickup_ids text[]) -> SETOF smallint
|
||||
-- oid: 58513 kind: FUNCTION category: server
|
||||
|
||||
CREATE OR REPLACE FUNCTION dune.register_temporary_lore_pickup(in_lore_pickup_ids text[])
|
||||
RETURNS SETOF smallint
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
BEGIN
|
||||
RETURN query WITH
|
||||
input AS (
|
||||
SELECT UNNEST (in_lore_pickup_ids) as lore_pickup_id
|
||||
),
|
||||
existing AS (
|
||||
SELECT incremental_id, lore_pickup_id FROM lore_pickups_temporary WHERE lore_pickup_id = ANY(SELECT lore_pickup_id FROM input)
|
||||
),
|
||||
inserted AS (
|
||||
INSERT INTO lore_pickups_temporary("lore_pickup_id") SELECT lore_pickup_id FROM input WHERE NOT lore_pickup_id = ANY(SELECT lore_pickup_id FROM existing) returning incremental_id, lore_pickup_id
|
||||
),
|
||||
combined AS (
|
||||
SELECT incremental_id, lore_pickup_id FROM existing UNION ALL SELECT incremental_id, lore_pickup_id FROM inserted
|
||||
)
|
||||
SELECT incremental_id FROM combined ORDER BY lore_pickup_id;
|
||||
END
|
||||
$function$
|
||||
@@ -0,0 +1,20 @@
|
||||
-- server_info_match(in_actor dune.actors, in_server_info dune.serverinfo) -> boolean
|
||||
-- oid: 58586 kind: FUNCTION category: server
|
||||
|
||||
CREATE OR REPLACE FUNCTION dune.server_info_match(in_actor dune.actors, in_server_info dune.serverinfo)
|
||||
RETURNS boolean
|
||||
LANGUAGE plpgsql
|
||||
STABLE STRICT
|
||||
AS $function$
|
||||
BEGIN
|
||||
return in_actor.map = in_server_info.map
|
||||
AND in_actor.dimension_index = in_server_info.dimension_index
|
||||
AND (
|
||||
in_actor.partition_id IS NULL
|
||||
OR
|
||||
in_server_info.partition_id IS NULL
|
||||
OR
|
||||
in_actor.partition_id = in_server_info.partition_id
|
||||
);
|
||||
END
|
||||
$function$
|
||||
@@ -0,0 +1,12 @@
|
||||
-- update_server_learned_new_buildable_pieces(in_account_id bigint, in_new_buildable_pieces text[]) -> void
|
||||
-- oid: 58637 kind: FUNCTION category: server
|
||||
|
||||
CREATE OR REPLACE FUNCTION dune.update_server_learned_new_buildable_pieces(in_account_id bigint, in_new_buildable_pieces text[])
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql
|
||||
AS $function$
|
||||
BEGIN
|
||||
INSERT INTO building_progression(account_id, new_buildable_pieces)
|
||||
VALUES(in_account_id, in_new_buildable_pieces)
|
||||
ON CONFLICT(account_id) DO UPDATE SET new_buildable_pieces = in_new_buildable_pieces WHERE building_progression.account_id = in_account_id;
|
||||
END; $function$
|
||||
Reference in New Issue
Block a user