diff options
| author | Matthew Collins <[email protected]> | 2018-05-05 15:46:12 +0100 |
|---|---|---|
| committer | Matthew Collins <[email protected]> | 2018-05-05 15:46:12 +0100 |
| commit | 5ef3f6e17cd14d452cfcdbb8a30abf61e513e84d (patch) | |
| tree | e667ed1dccc3d3ac0df83e8c66b76dd5dc0771e8 /src/server.rs | |
| parent | Minor bump due to slight mistake with last publish (diff) | |
| download | steamworks-rs-5ef3f6e17cd14d452cfcdbb8a30abf61e513e84d.tar.xz steamworks-rs-5ef3f6e17cd14d452cfcdbb8a30abf61e513e84d.zip | |
Rework how the sys crate is generated
Due to packing issues with steam's structs we use wrapper methods
to access the fields and create the structs.
Diffstat (limited to 'src/server.rs')
| -rw-r--r-- | src/server.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/server.rs b/src/server.rs index ee37cac..fc1f6e8 100644 --- a/src/server.rs +++ b/src/server.rs @@ -62,9 +62,9 @@ impl Server { let version = CString::new(version).unwrap(); let raw_ip: u32 = ip.into(); let server_mode = match server_mode { - ServerMode::NoAuthentication => sys::ServerMode::NoAuthentication, - ServerMode::Authentication => sys::ServerMode::Authentication, - ServerMode::AuthenticationAndSecure => sys::ServerMode::AuthenticationAndSecure, + ServerMode::NoAuthentication => sys::EServerMode_eServerModeNoAuthentication, + ServerMode::Authentication => sys::EServerMode_eServerModeAuthentication, + ServerMode::AuthenticationAndSecure => sys::EServerMode_eServerModeAuthenticationAndSecure, }; if sys::steam_rust_game_server_init( raw_ip, steam_port, @@ -170,12 +170,13 @@ impl Server { user.0 ); Err(match res { - sys::BeginAuthSessionResult::Ok => return Ok(()), - sys::BeginAuthSessionResult::InvalidTicket => AuthSessionError::InvalidTicket, - sys::BeginAuthSessionResult::DuplicateRequest => AuthSessionError::DuplicateRequest, - sys::BeginAuthSessionResult::InvalidVersion => AuthSessionError::InvalidVersion, - sys::BeginAuthSessionResult::GameMismatch => AuthSessionError::GameMismatch, - sys::BeginAuthSessionResult::ExpiredTicket => AuthSessionError::ExpiredTicket, + sys::EBeginAuthSessionResult_k_EBeginAuthSessionResultOK => return Ok(()), + sys::EBeginAuthSessionResult_k_EBeginAuthSessionResultInvalidTicket => AuthSessionError::InvalidTicket, + sys::EBeginAuthSessionResult_k_EBeginAuthSessionResultDuplicateRequest => AuthSessionError::DuplicateRequest, + sys::EBeginAuthSessionResult_k_EBeginAuthSessionResultInvalidVersion => AuthSessionError::InvalidVersion, + sys::EBeginAuthSessionResult_k_EBeginAuthSessionResultGameMismatch => AuthSessionError::GameMismatch, + sys::EBeginAuthSessionResult_k_EBeginAuthSessionResultExpiredTicket => AuthSessionError::ExpiredTicket, + _ => unreachable!(), }) } } |