update to steam-vent 0.6

This commit is contained in:
Robin Appelman 2026-08-01 19:39:10 +02:00
commit 6f49aa5798
Signed by: robin
SSH key fingerprint: SHA256:kifqgrqnut7q1YUIrI0AdMNC23qiKAS/T9uGFmIYvbE
4 changed files with 387 additions and 53 deletions

View file

@ -3,8 +3,8 @@ use std::error::Error;
use std::io::stdin;
use std::str::FromStr;
use steam_vent::auth::{
AuthConfirmationHandler, ConsoleAuthConfirmationHandler, DeviceConfirmationHandler,
FileGuardDataStore, SharedSecretAuthConfirmationHandler,
ClientInfo, ConsoleAuthConfirmationHandler, DeviceConfirmationHandler, FileGuardDataStore,
SharedSecretAuthConfirmationHandler,
};
use steam_vent::{Connection, ServerList};
use steam_vent_chat::{ChatClient, ChatEvent};
@ -41,6 +41,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
&args.password,
FileGuardDataStore::user_cache(),
SharedSecretAuthConfirmationHandler::new(&secret),
&ClientInfo::default(),
)
.await?
}
@ -50,7 +51,11 @@ async fn main() -> Result<(), Box<dyn Error>> {
&args.username,
&args.password,
FileGuardDataStore::user_cache(),
ConsoleAuthConfirmationHandler::default().or(DeviceConfirmationHandler),
(
ConsoleAuthConfirmationHandler::default(),
DeviceConfirmationHandler,
),
&ClientInfo::default(),
)
.await?
}
@ -63,8 +68,14 @@ async fn main() -> Result<(), Box<dyn Error>> {
while let Some(Ok(event)) = events.next().await {
match event {
ChatEvent::Typing(event) => println!("{} is tying...", event.source.steam64()),
ChatEvent::Message(event) => println!("{}: {}", event.source.steam64(), event.message_no_bbcode.unwrap_or(event.message)),
ChatEvent::EchoMessage(event) => println!("me: {}", event.message_no_bbcode.unwrap_or(event.message)),
ChatEvent::Message(event) => println!(
"{}: {}",
event.source.steam64(),
event.message_no_bbcode.unwrap_or(event.message)
),
ChatEvent::EchoMessage(event) => {
println!("me: {}", event.message_no_bbcode.unwrap_or(event.message))
}
}
}
});