@@ -9,10 +9,12 @@ CREATE OR REPLACE FUNCTION public.get_match_tv_connection_string(match public.ma
99 tv_port int ;
1010 started_at timestamp ;
1111 tv_delay int ;
12+ match_id uuid;
1213 use_playcast text ;
14+ relay_domain text ;
1315 BEGIN
14- SELECT s .host , s .tv_port , m .started_at , mo .tv_delay
15- INTO server_host, tv_port, started_at, tv_delay
16+ SELECT s .host , s .tv_port , m .started_at , mo .tv_delay , m . id
17+ INTO server_host, tv_port, started_at, tv_delay, match_id
1618 FROM matches m
1719 INNER JOIN servers s ON s .id = m .server_id
1820 INNER JOIN match_options mo on mo .id = m .match_options_id
@@ -29,10 +31,11 @@ CREATE OR REPLACE FUNCTION public.get_match_tv_connection_string(match public.ma
2931 return null ;
3032 end if;
3133
34+ relay_domain := get_setting(' relay_domain' );
3235 use_playcast := get_setting(' use_playcast' , ' false' );
3336
34- if(use_playcast = ' true' ) then
35- return CONCAT(' playcast ' , ' "https://relay.5stack.gg/ ' , match_id, ' "' );
37+ if(use_playcast = ' true' and relay_url is not null ) then
38+ return CONCAT(' playcast ' , ' "' , relay_domain , match_id, ' "' );
3639 else
3740 return CONCAT(' connect ' , CONCAT(server_host, ' :' , tv_port), ' ; password ' , password);
3841 end if;
0 commit comments