diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/friends.rs | 7 | ||||
| -rw-r--r-- | src/matchmaking.rs | 17 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/friends.rs b/src/friends.rs index b7a12f0..1958258 100644 --- a/src/friends.rs +++ b/src/friends.rs @@ -1,4 +1,3 @@ - use super::*; use std::net::Ipv4Addr; @@ -230,7 +229,7 @@ impl <Manager> Friend<Manager> { } } - /// Returns a small (32x32) avatar for the user + /// Returns a small (32x32) avatar for the user in RGBA format pub fn small_avatar(&self) -> Option<Vec<u8>> { unsafe { let utils = sys::steam_rust_get_utils(); @@ -253,7 +252,7 @@ impl <Manager> Friend<Manager> { } } - /// Returns a small (64x64) avatar for the user + /// Returns a medium (64x64) avatar for the user in RGBA format pub fn medium_avatar(&self) -> Option<Vec<u8>> { unsafe { let utils = sys::steam_rust_get_utils(); @@ -277,7 +276,7 @@ impl <Manager> Friend<Manager> { } } -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum FriendState { Offline, Online, diff --git a/src/matchmaking.rs b/src/matchmaking.rs index 30e4fa1..f10eff1 100644 --- a/src/matchmaking.rs +++ b/src/matchmaking.rs @@ -168,6 +168,23 @@ impl <Manager> Matchmaking<Manager> { members } } + + /// Sets whether or not a lobby is joinable by other players. This always defaults to enabled + /// for a new lobby. + /// + /// If joining is disabled, then no players can join, even if they are a friend or have been + /// invited. + /// + /// Lobbies with joining disabled will not be returned from a lobby search. + /// + /// Returns true on success, false if the current user doesn't own the lobby. + pub fn set_lobby_joinable(&self, lobby: LobbyId, joinable: bool) -> bool { + unsafe { + sys::SteamAPI_ISteamMatchmaking_SetLobbyJoinable( + self.mm, sys::CSteamID(lobby.0), joinable + ) != 0 + } + } } #[test] |