Skip to content

Commit 528bfeb

Browse files
committed
steam auth on playtest
1 parent df221f1 commit 528bfeb

4 files changed

Lines changed: 29 additions & 1 deletion

File tree

.github/workflows/steam.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ jobs:
1616
include:
1717
- variant: production
1818
steam_app_id: "4313790"
19+
steam_app_name: "production"
1920
- variant: playtest
2021
steam_app_id: "4313850"
22+
steam_app_name: "playtest"
2123
steps:
2224
- uses: actions/checkout@v4
2325

@@ -56,6 +58,7 @@ jobs:
5658
env:
5759
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5860
STEAM_APP_ID: ${{ matrix.steam_app_id }}
61+
STEAM_APP_NAME: ${{ matrix.steam_app_name }}
5962
with:
6063
args: --features steam --config src-tauri/tauri.steam.conf.json
6164

@@ -80,8 +83,11 @@ jobs:
8083
include:
8184
- variant: production
8285
steam_app_id: "4313790"
86+
steam_app_name: "production"
87+
8388
- variant: playtest
8489
steam_app_id: "4313850"
90+
steam_app_name: "playtest"
8591
steps:
8692
- uses: actions/checkout@v4
8793

@@ -126,6 +132,8 @@ jobs:
126132
APPIMAGE_EXTRACT_AND_RUN: 1
127133
LD_LIBRARY_PATH: /usr/lib
128134
STEAM_APP_ID: ${{ matrix.steam_app_id }}
135+
STEAM_APP_NAME: ${{ matrix.steam_app_name }}
136+
129137
with:
130138
args: --features steam --config src-tauri/tauri.steam.conf.json
131139

@@ -149,8 +157,11 @@ jobs:
149157
include:
150158
- variant: production
151159
steam_app_id: "4313790"
160+
steam_app_name: "production"
161+
152162
- variant: playtest
153163
steam_app_id: "4313850"
164+
steam_app_name: "playtest"
154165
steps:
155166
- uses: actions/checkout@v4
156167

@@ -188,6 +199,8 @@ jobs:
188199
env:
189200
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
190201
STEAM_APP_ID: ${{ matrix.steam_app_id }}
202+
STEAM_APP_NAME: ${{ matrix.steam_app_name }}
203+
191204
with:
192205
args: --features steam --target universal-apple-darwin --config src-tauri/tauri.steam.conf.json
193206

@@ -219,6 +232,7 @@ jobs:
219232
with:
220233
variant: production
221234
steam_app_id: "4313790"
235+
steam_app_name: "production"
222236
steam_username: ${{ secrets.STEAM_USERNAME }}
223237
steam_password: ${{ secrets.STEAM_PASSWORD }}
224238
steam_shared_secret: ${{ secrets.STEAM_SHARED_SECRET }}
@@ -234,6 +248,7 @@ jobs:
234248
with:
235249
variant: playtest
236250
steam_app_id: "4313850"
251+
steam_app_name: "playtest"
237252
steam_username: ${{ secrets.STEAM_USERNAME }}
238253
steam_password: ${{ secrets.STEAM_PASSWORD }}
239254
steam_shared_secret: ${{ secrets.STEAM_SHARED_SECRET }}

src-tauri/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ mod settings;
88
mod steam;
99

1010
pub const DEFAULT_STEAM_ID: u32 = 4313790;
11+
pub const DEFAULT_STEAM_NAME: &str = "production";
1112

1213
mod webview2;
1314

src-tauri/src/steam/commands.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ use std::sync::Arc;
33
use serde::{Deserialize, Serialize};
44
use tauri::State;
55

6+
use crate::steam::get_steam_app_name;
7+
68
use super::SteamState;
79

810
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -31,6 +33,7 @@ pub struct SteamAuthResult {
3133
struct SteamAuthRequest {
3234
ticket: String,
3335
steam_id: String,
36+
instance: String,
3437
display_name: String,
3538
create_account_if_missing: bool,
3639
}
@@ -92,6 +95,7 @@ pub async fn authenticate_with_steam(
9295
let request = SteamAuthRequest {
9396
ticket,
9497
steam_id,
98+
instance: get_steam_app_name(),
9599
display_name,
96100
create_account_if_missing,
97101
};

src-tauri/src/steam/mod.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub use commands::{
1010
pub use presence::SteamPresence;
1111
pub use state::SteamState;
1212

13-
use crate::DEFAULT_STEAM_ID;
13+
use crate::{DEFAULT_STEAM_ID, DEFAULT_STEAM_NAME};
1414

1515
pub fn get_steam_app_id() -> u32 {
1616
if let Some(env) = option_env!("STEAM_APP_ID") {
@@ -19,3 +19,11 @@ pub fn get_steam_app_id() -> u32 {
1919
DEFAULT_STEAM_ID
2020
}
2121
}
22+
23+
pub fn get_steam_app_name() -> String {
24+
if let Some(env) = option_env!("STEAM_APP_NAME") {
25+
env.to_string()
26+
} else {
27+
DEFAULT_STEAM_NAME.to_string()
28+
}
29+
}

0 commit comments

Comments
 (0)