pub struct ServerGameDll<'s> { /* private fields */ }Expand description
The game’s half of the engine interface (IServerGameDLL), implemented
by the game’s CServerGameDLL.
See the module documentation for how each method is exposed.
Implementations§
Source§impl<'s> ServerGameDll<'s>
impl<'s> ServerGameDll<'s>
Source§impl<'s> ServerGameDll<'s>
impl<'s> ServerGameDll<'s>
Sourcepub fn async_prepare_level_resources(
self,
map: &CStr,
) -> Result<LevelPreparation, MapNameTooLong>
pub fn async_prepare_level_resources( self, map: &CStr, ) -> Result<LevelPreparation, MapNameTooLong>
Starts or polls preparing a level’s resources without blocking.
The game starts from map and the file maps/<map>.bsp, as for
Self::prepare_level_resources. Fails if either does not fit in the
game’s buffers.
Sourcepub fn can_provide_level(
self,
map: &CStr,
) -> Result<LevelProvision, MapNameTooLong>
pub fn can_provide_level( self, map: &CStr, ) -> Result<LevelProvision, MapNameTooLong>
What the game would do with a map name if asked to prepare it, without
blocking. Fails if the name, or the file maps/<map>.bsp, does not fit
in the game’s buffers, as for Self::prepare_level_resources.
Sourcepub fn entity_net_prop(
self,
entity: Entity<'s>,
name: &CStr,
) -> Result<NetProp<'s>, NetPropError>
pub fn entity_net_prop( self, entity: Entity<'s>, name: &CStr, ) -> Result<NetProp<'s>, NetPropError>
Resolves a networked variable of an entity’s class by name, as
Self::net_prop does.
Fails with NetPropError::NotNetworked for an entity without a
server class.
Sourcepub fn game_description(self) -> CString
pub fn game_description(self) -> CString
A description of the game, such as Team Fortress, or empty if the game
returns none.
Sourcepub fn gc_lobby(self) -> Option<ServerGcLobby<'s>>
pub fn gc_lobby(self) -> Option<ServerGcLobby<'s>>
The game coordinator’s lobby for this server, if the game has one.
Sourcepub fn invalidate_mdl_cache(self)
pub fn invalidate_mdl_cache(self)
Makes the game drop its cached model data, as the engine does after flushing the model cache.
Sourcepub fn is_manual_map_change_okay(self) -> Result<(), MapChangeRefused>
pub fn is_manual_map_change_okay(self) -> Result<(), MapChangeRefused>
Whether the game allows the map or changelevel commands right now.
Sourcepub fn is_restoring(self) -> bool
pub fn is_restoring(self) -> bool
Whether a single-player save is being restored.
Sourcepub fn net_prop(
self,
class: ServerClass<'s>,
name: &CStr,
) -> Result<NetProp<'s>, NetPropError>
pub fn net_prop( self, class: ServerClass<'s>, name: &CStr, ) -> Result<NetProp<'s>, NetPropError>
Resolves a networked variable of a class by name.
The first variable with the name is found, searching the class’s table
and the tables nested within it depth first, which includes those of
base classes and embedded structures such as m_Local.
Fails if the class has no send table, the game provides no standard send proxies, or the variable is missing or cannot be addressed.
Sourcepub fn prepare_level_resources(
self,
map: &CStr,
) -> Result<LevelResources, MapNameTooLong>
pub fn prepare_level_resources( self, map: &CStr, ) -> Result<LevelResources, MapNameTooLong>
Resolves a map name, and has the game prepare its resources, such as downloading a workshop map. This may block for a long time.
The game starts from map and the file maps/<map>.bsp, and may
replace either. Fails if either does not fit in the game’s buffers.
Sourcepub fn save_comment(
self,
minutes: f32,
seconds: f32,
include_time: bool,
) -> CString
pub fn save_comment( self, minutes: f32, seconds: f32, include_time: bool, ) -> CString
The comment the game would give a save made after the given play time.
Sourcepub fn server_browser_game_data(self) -> Option<CString>
pub fn server_browser_game_data(self) -> Option<CString>
The game data string sent to the master server, or None if the game
returns none.
Sourcepub fn server_browser_map_override(self) -> Option<CString>
pub fn server_browser_map_override(self) -> Option<CString>
What the server browser’s map column shows instead of the map name, or
None if it shows the map name.
Sourcepub fn server_class(self, name: &CStr) -> Option<ServerClass<'s>>
pub fn server_class(self, name: &CStr) -> Option<ServerClass<'s>>
Finds a networked entity class by name, such as CTFPlayer, or None
if the game has none with the name.
Sourcepub fn server_classes(self) -> ServerClasses<'s> ⓘ
pub fn server_classes(self) -> ServerClasses<'s> ⓘ
Every networked entity class, sorted by name.
Sourcepub fn should_hide_server(self) -> bool
pub fn should_hide_server(self) -> bool
Whether the game asks not to list the server publicly.
Sourcepub fn standard_send_proxies(self) -> Option<StandardSendProxies<'s>>
pub fn standard_send_proxies(self) -> Option<StandardSendProxies<'s>>
The game DLL’s standard send proxies, or None if the game returns
none.
Sourcepub fn status(self) -> CString
pub fn status(self) -> CString
The lines the game adds to the status command’s output.
Each line is formatted as the game prints it, truncated to 1023 bytes.
Sourcepub fn tick_interval(self) -> f32
pub fn tick_interval(self) -> f32
Seconds per simulation tick.
Sourcepub fn user_message(self, index: usize) -> Option<UserMessage>
pub fn user_message(self, index: usize) -> Option<UserMessage>
The user message the game registered at an index, or None if there is
none.
Sourcepub fn user_messages(self) -> impl Iterator<Item = UserMessage> + use<'s>
pub fn user_messages(self) -> impl Iterator<Item = UserMessage> + use<'s>
Every user message the game registered, in index order, up to the first index without one.
Sourcepub fn workshop_map(self, index: u32) -> Option<WorkshopMap>
pub fn workshop_map(self, index: u32) -> Option<WorkshopMap>
The workshop map the game knows at an index, or None if the index is
invalid.
Sourcepub fn workshop_maps(self) -> impl Iterator<Item = WorkshopMap> + use<'s>
pub fn workshop_maps(self) -> impl Iterator<Item = WorkshopMap> + use<'s>
Every workshop map the game knows, in index order, up to the first invalid index.