Skip to content

CylorineStudio/GameStub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GameStub

简体中文

What is this?

A macOS app written in Swift that enables the Game Mode (introduced in macOS Sonoma) for Java-based games such as Minecraft.

How to use?

For launcher developers

When creating the game process, change the executable path to /path/to/GameStub.app/Contents/Resources/launcher and prepend the absolute path of java to the arguments. This will activate the Game Mode.

For players

If your launcher supports setting a "Wrapper Command", simply enter /path/to/GameStub.app/Contents/Resources/launcher into the field.

What does it do?

  1. launcher starts the main executable (which we call runner) via NSWorkspace.openApplication.
  2. After runner is registered as a Game App, it replaces the current process with the java process using execv, allowing the game to inherit the Game App identity.

Warning

When Game Mode is active, macOS may reduce the performance of the launcher process. If runner is a child or descendant process of the launcher, its performance will also be degraded.
launcher uses NSWorkspace.openApplication to entrust runner to launchd to avoid game performance degradation. However, this approach prevents log and return value transmission.
We may add a Java Agent in future versions to transmit stdout, stderr, and the exit code to launcher via a socket, which will then forward them to the launcher.

How it works?

I don't know, it's probably... magic ✨

About

A macOS app that enables the Game Mode for Java-based games

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors