-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: enable host networking and root users on dev (#1387)
<!-- Please make sure there is an issue that this PR is correlated to. --> Fixes RVT-4049 ## Changes <!-- If there are frontend changes, please include screenshots. -->
- Loading branch information
1 parent
eaee5a5
commit a8ef10e
Showing
8 changed files
with
61 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
pub mod get; | ||
pub mod update; | ||
pub mod upsert; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use chirp_workflow::prelude::*; | ||
|
||
use crate::types::ServerRuntime; | ||
|
||
#[derive(Debug, Default)] | ||
pub struct Input { | ||
pub game_id: Uuid, | ||
pub host_networking_enabled: Option<bool>, | ||
pub root_user_enabled: Option<bool>, | ||
pub runtime: Option<ServerRuntime>, | ||
} | ||
|
||
#[operation] | ||
pub async fn ds_game_config_upsert(ctx: &OperationCtx, input: &Input) -> GlobalResult<()> { | ||
sql_execute!( | ||
[ctx] | ||
" | ||
INSERT INTO db_ds.game_config (game_id, host_networking_enabled, root_user_enabled, runtime) | ||
VALUES ($1, $2, $3, $4) | ||
ON CONFLICT (game_id) DO UPDATE | ||
SET | ||
host_networking_enabled = COALESCE($2, EXCLUDED.host_networking_enabled), | ||
root_user_enabled = COALESCE($3, EXCLUDED.root_user_enabled), | ||
runtime = COALESCE($4, EXCLUDED.runtime) | ||
", | ||
&input.game_id, | ||
input.host_networking_enabled, | ||
input.root_user_enabled, | ||
input.runtime.unwrap_or_default() as i32, | ||
) | ||
.await?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters