Skip to content

Commit 4dce8da

Browse files
authored
feature: csgo (#113)
1 parent 5e29cc0 commit 4dce8da

File tree

16 files changed

+13225
-11424
lines changed

16 files changed

+13225
-11424
lines changed

generated/schema.graphql

Lines changed: 505 additions & 1 deletion
Large diffs are not rendered by default.

generated/schema.ts

Lines changed: 521 additions & 55 deletions
Large diffs are not rendered by default.

generated/types.ts

Lines changed: 12047 additions & 11318 deletions
Large diffs are not rendered by default.

hasura/functions/match/get_match_connection.sql

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,21 @@ CREATE OR REPLACE FUNCTION public.get_match_connection_link(match public.matches
3333
AS $$
3434
DECLARE
3535
server_host text;
36+
server_game text;
3637
BEGIN
3738
server_host := get_match_server_info(match);
3839

3940
IF(server_host IS NULL OR is_in_lineup(match, hasura_session) = FALSE) THEN
4041
return NULL;
4142
END IF;
4243

43-
RETURN CONCAT('steam://run/730//+connect ', server_host);
44+
SELECT s.game INTO server_game
45+
FROM matches m
46+
INNER JOIN servers s ON s.id = m.server_id
47+
WHERE m.id = match.id
48+
LIMIT 1;
49+
50+
RETURN CONCAT('steam://run/', CASE WHEN server_game = 'csgo' THEN '4465480' ELSE '730' END, '//+connect ', server_host);
4451
END;
4552
$$;
4653

hasura/functions/servers/get_server_connection.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ BEGIN
3838

3939
server_host := get_server_host(server);
4040

41-
RETURN CONCAT('steam://run/730//+connect ', server_host);
41+
RETURN CONCAT('steam://run/', CASE WHEN server.game = 'csgo' THEN '4465480' ELSE '730' END, '//+connect ', server_host);
4242
END;
4343
$$;
4444

hasura/metadata/actions.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ type Mutation {
324324
type Mutation {
325325
updateCs(
326326
game_server_node_id: uuid
327+
game: String
327328
): SuccessOutput
328329
}
329330

hasura/metadata/databases/default/tables/public_game_server_nodes.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ select_permissions:
6060
- cpu_governor_info
6161
- cpu_sockets
6262
- cpu_threads_per_core
63+
- csgo_build_id
6364
- demo_network_limiter
6465
- enabled
6566
- end_port_range

hasura/metadata/databases/default/tables/public_servers.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ select_permissions:
7171
- connect_password
7272
- connected
7373
- enabled
74+
- game
7475
- game_server_node_id
7576
- host
7677
- id
@@ -98,6 +99,7 @@ select_permissions:
9899
columns:
99100
- connected
100101
- enabled
102+
- game
101103
- host
102104
- id
103105
- label
@@ -124,6 +126,7 @@ select_permissions:
124126
columns:
125127
- connected
126128
- enabled
129+
- game
127130
- host
128131
- id
129132
- is_dedicated

hasura/metadata/databases/default/tables/public_tournaments.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,28 @@ computed_fields:
6262
name: can_close_tournament_registration
6363
schema: public
6464
session_argument: hasura_session
65-
- name: can_pause
65+
- name: can_join
6666
definition:
6767
function:
68-
name: can_pause_tournament
68+
name: can_join_tournament
6969
schema: public
7070
session_argument: hasura_session
71-
- name: can_resume
71+
- name: can_open_registration
7272
definition:
7373
function:
74-
name: can_resume_tournament
74+
name: can_open_tournament_registration
7575
schema: public
7676
session_argument: hasura_session
77-
- name: can_join
77+
- name: can_pause
7878
definition:
7979
function:
80-
name: can_join_tournament
80+
name: can_pause_tournament
8181
schema: public
8282
session_argument: hasura_session
83-
- name: can_open_registration
83+
- name: can_resume
8484
definition:
8585
function:
86-
name: can_open_tournament_registration
86+
name: can_resume_tournament
8787
schema: public
8888
session_argument: hasura_session
8989
- name: can_start
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
alter table "public"."game_server_nodes" drop column "csgo_build_id";

0 commit comments

Comments
 (0)