Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server.rs)Add functions that have already been extern "C" #214

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,19 @@ impl Server {
}
}

/// Indicate whether you wish to be listed on the master server list
/// and/or respond to server browser / LAN discovery packets.
/// The server starts with this value set to false. You should set all
/// relevant server parameters before enabling advertisement on the server.
///
/// (This function used to be named EnableHeartbeats, so if you are wondering
/// where that function went, it's right here. It does the same thing as before,
/// the old name was just confusing.)
#[inline(always)]
pub fn set_advertise_server_active(&self, active: bool) {
self.enable_heartbeats(active);
}

/// If your game is a "mod," pass the string that identifies it. The default is an empty
/// string, meaning this application is the original game, not a mod.
pub fn set_mod_dir(&self, mod_dir: &str) {
Expand Down Expand Up @@ -395,6 +408,20 @@ impl Server {
}
}

/// Let people know if your server will require a password
pub fn set_password_protected(&self, b_password_protected: bool) {
unsafe {
sys::SteamAPI_ISteamGameServer_SetPasswordProtected(self.server, b_password_protected);
}
}

/// Number of bots. Default value is zero
pub fn set_bot_player_count(&self, c_bot_players: i32) {
unsafe {
sys::SteamAPI_ISteamGameServer_SetBotPlayerCount(self.server, c_bot_players);
}
}

/// Returns an accessor to the steam UGC interface (steam workshop)
///
/// **For this to work properly, you need to call `UGC::init_for_game_server()`!**
Expand Down