mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-26 17:31:45 +02:00
Add gamemode_query_status and teach gamemoded '-s'
This allows the client to query the daemon about the status of gamemode. Returns the following: 0 if gamemode is inactive 1 if gamemode is active 2 if gamemode is active and this client is registered -1 if the query failed Passing -s to gamemoded will simply query and print the current status. Allows for more comprehensive testing when using 'gamemoded -r' as well as more reactionary program behaviour
This commit is contained in:
@ -73,3 +73,13 @@ bool game_mode_context_register(GameModeContext *self, pid_t pid);
|
||||
* @returns True if the client was removed, and existed.
|
||||
*/
|
||||
bool game_mode_context_unregister(GameModeContext *self, pid_t pid);
|
||||
|
||||
/**
|
||||
* Query the current status of gamemode
|
||||
*
|
||||
* @param pid Process ID for the remote client
|
||||
* @returns Positive if gamemode is active
|
||||
* 1 if gamemode is active but the client is not registered
|
||||
* 2 if gamemode is active and the client is registered
|
||||
*/
|
||||
int game_mode_context_query_status(GameModeContext *self, pid_t pid);
|
||||
|
Reference in New Issue
Block a user