aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlaise <[email protected]>2019-08-02 17:33:08 -0500
committerMatthew Collins <[email protected]>2019-08-14 15:47:04 +0100
commitac6e49dba46ddec14efe60b8ca10451bbeddcc44 (patch)
tree3885dba3813307278871ee6d3e22fba6e9f2539a
parentMade serde dependency optional (diff)
downloadsteamworks-rs-ac6e49dba46ddec14efe60b8ca10451bbeddcc44.tar.xz
steamworks-rs-ac6e49dba46ddec14efe60b8ca10451bbeddcc44.zip
Implemented P2PSessionConnectFail callback and removed a result handler's Sync requirement
-rw-r--r--src/matchmaking.rs2
-rw-r--r--src/networking.rs19
2 files changed, 20 insertions, 1 deletions
diff --git a/src/matchmaking.rs b/src/matchmaking.rs
index 8b9f2f7..f3e3b94 100644
--- a/src/matchmaking.rs
+++ b/src/matchmaking.rs
@@ -52,7 +52,7 @@ impl LobbyId {
impl <Manager> Matchmaking<Manager> {
pub fn request_lobby_list<F>(&self, mut cb: F)
- where F: FnMut(Result<Vec<LobbyId>, SteamError>) + 'static + Send + Sync
+ where F: FnMut(SResult<Vec<LobbyId>>) + 'static + Send
{
unsafe {
let api_call = sys::SteamAPI_ISteamMatchmaking_RequestLobbyList(self.mm);
diff --git a/src/networking.rs b/src/networking.rs
index 696874b..ac2230c 100644
--- a/src/networking.rs
+++ b/src/networking.rs
@@ -109,3 +109,22 @@ unsafe impl Callback for P2PSessionRequest {
}
}
}
+
+#[derive(Clone, Debug, Serialize, Deserialize)]
+pub struct P2PSessionConnectFail {
+ pub remote: SteamId,
+ pub error: u8,
+}
+
+unsafe impl Callback for P2PSessionConnectFail {
+ const ID: i32 = 1203;
+ const SIZE: i32 = ::std::mem::size_of::<sys::P2PSessionConnectFail_t>() as i32;
+
+ unsafe fn from_raw(raw: *mut libc::c_void) -> Self {
+ let val = &mut *(raw as *mut sys::P2PSessionConnectFail_t);
+ P2PSessionConnectFail {
+ remote: SteamId(val.m_steamIDRemote.0),
+ error: val.m_eP2PSessionError,
+ }
+ }
+}