Giter Club home page Giter Club logo

joinme.click-launcher's Introduction

joinme.click-launcher

ci Go Report Card License Last commit Discord

Launcher utility to handle custom game URL protocols supported on joinme.click.

joinme click-launcher

Supported games

Game URL protocol Minimum launcher version¹ Supported mods
Battlefield 1942 bf1942://{ip}:{port} v0.1.7-alpha The Road to Rome², Secret Weapons of WWII², Battlefield 1918, Desert Combat (0.7), Desert Combat Final, Pirates
Battlefield Vietnam bfvietnam://{ip}:{port} v0.1.7-alpha Battlegroup 42
Battlefield 2 bf2://{ip}:{port} v0.2.0 Special Forces², Allied Intent Xtended, Pirates (Yarr2), Point of Existence 2, Arctic Warfare
Battlefield 4 bf4://{gameid} v0.2.2
Battlefield 1 bf1://{gameid} v0.2.2
Call of Duty cod://{ip}:{port} v0.2.0
Call of Duty: United Offensive coduo://{ip}:{port} v0.2.0
Call of Duty 2 cod2://{ip}:{port} v0.2.0
Call of Duty 4: Modern Warfare cod4://{ip}:{port} v0.2.0
Call of Duty: World at War codwaw://{ip}:{port} v0.2.0
F.E.A.R./F.E.A.R. Combat fear://{ip}:{port} v0.2.0
F.E.A.R. Combat (SEC2) fearsec2://{ip}:{port} v0.1.3-alpha
ParaWorld paraworld://{ip}:{port} v0.1.7-alpha
SWAT 4 swat4://{ip}:{port} v0.1.3-alpha
SWAT 4: The Stetchkov Syndicate³ swat4x://{ip}:{port} v0.1.3-alpha
Unreal unreal://{ip}:{port} v0.2.0
Unreal Tournament ut://{ip}:{port} v0.2.0
Unreal Tournament 2003 ut2003://{ip}:{port} v0.2.0
Unreal Tournament 2004 ut2004://{ip}:{port} v0.2.0
Vietcong vietcong://{ip}:{port} v0.1.3-alpha

¹ refers to the minimum launcher version supporting all features relevant to the game

² these addons are considered mods for technical reasons, since they use the same game executable which is launched with different parameters

³ while technically an addon, it uses a separate game executable and is thus considered a different game

Usage

Registering URL handlers

Before you can launch games based on URLs, the launcher needs to register as a URL handler for the supported URL protocols. The installer will automatically do this during the setup. If you are using the portable launcher, simply run the launcher once after download. It will check which of the supported games are installed and register itself as a URL handler for each one it finds. After registering, the launcher shows the result for each supported game.

10: 37AM INF Checked status for game="Battlefield 1" result="launcher registered successfully"
10: 37AM INF Checked status for game="Battlefield 1942" result="not installed"
10: 37AM INF Checked status for game="Battlefield 2" result="launcher registered successfully"
10: 37AM INF Checked status for game="Battlefield 4" result="launcher registered successfully"
10: 37AM INF Checked status for game="Battlefield Vietnam" result="launcher registered successfully"
10: 37AM INF Checked status for game="Call of Duty" result="launcher registered successfully"
10: 37AM INF Checked status for game="Call of Duty 2" result="launcher registered successfully"
10: 37AM INF Checked status for game="Call of Duty 4: Modern Warfare" result="launcher registered successfully"
10: 37AM INF Checked status for game="Call of Duty: United Offensive" result="launcher registered successfully"
10: 37AM INF Checked status for game="Call of Duty: World at War" result="launcher registered successfully"
10: 37AM INF Checked status for game="F.E.A.R. Combat (SEC2)" result="not installed"
10: 37AM INF Checked status for game=ParaWorld result="launcher registered successfully"
10: 37AM INF Checked status for game="SWAT 4" result="launcher registered successfully"
10: 37AM INF Checked status for game="SWAT 4: The Stetchkov Syndicate" result="launcher registered successfully"
10: 37AM INF Checked status for game=Vietcong result="not installed"
10: 37AM INF Window will close in 15 seconds

Launching a game based on a URL

No extra steps are required to launch a game based on one of the supported URL protocols. If you click a link to bf2://95.172.92.116:16567 for example, the launcher will start Battlefield 2 and join 2F4Y.com - Best Maps No Rules!. If the game is already running and cannot join a server from a running state, the launcher will close any existing game instance automatically before launching a new one (only supported by launcher v0.1.8-alpha and newer).

10: 40AM INF Killing existing game process executable=BF2.exe pid=3916
10: 40AM INF Successfully launched game url=bf2://95.172.92.116:16567/
10: 40AM INF Window will close in 15 seconds

Depending on your browser and settings, you may need to confirm that you want to allow the launcher to start after clicking the link.

Browser URL protocol launch confirmation prompt

Advanced configuration

You can customize some elements of how the launcher starts your games. For example, you can provide additional command line arguments on a per-game basis. The config needs to be placed in the same folder as the launcher executable as config.yaml.

General configuration options

Option name Type Description Default value
quiet_launch boolean do not leave the window open any longer than required false
debug_logging boolean show lots of information relevant for debugging any issues with the launcher false

Per-game configuration options

These options can be configured (differently) on a per-game basis. They need to be placed in the config.yaml under games and then keyed by the game URL protocol (e.g. bf2). These options do not have any default values. Instead, they override dynamic values the launcher usually determines on its own (e.g. the game's install path). Some options also pass additional details to the launcher.

Option name Type Description
executable_name string name of the game executable (usually statically defined per game)
executable_path string relative path from the game's install path to folder containing the game executable (usually statically defined per game)
install_path string path where the game is installed (usually determined via the Windows registry)
args string[] array of additional arguments to pass the game when launching
hooks object[] array of hook configurations for the game

Hook configuration options

Hooks allow you to customize how games are launched. You can, for example, use the purge-server-history hook for Battlefield 2 to remove all server history items from your default profile and thus speed up the game launch.

Options can be configured differently for each hook and game. It is also possible to provide two configurations for the same hook, e.g. to run it with different arguments before and after launching a game.

Option name Type Description Default value
handler string Hook handler function to execute
when string When to run the hook (pre-launch, post-launch, always or never)
exit_on_error boolean Whether to exit if the hook returns an error false
args object Arguments to pass to the handler (keys and values must be strings)

Example configuration

This example configuration would cause the launcher to not leave the launcher window open after performing any actions (meaning you will not see any output it printed). Also, Battlefield 2 would be launched in windowed mode with C:\Games\Battlefield 2\bin\BF2.playbf2.exe being started in C:\Games\Battlefield 2.

With the hooks configured like this, the launcher will:

  1. set profile "0010" as the default profile for Battlefield 2 before launching the game
  2. purge the server history before launching the game
  3. purge the shader cache before launching the game
  4. purge the logo cache before launching the game

Debug logging is disabled by default, meaning that option does not change any default behaviour.

quiet_launch: true
debug_logging: false
games:
    bf2:
        executable_name: BF2.playbf2.exe
        executable_path: bin
        install_path: C:\Games\Battlefield 2
        args: ["+fullscreen", "0", "+szx", "1600", "+szy", "900"]
        hooks:
          - handler: set-default-profile
            when: pre-launch
            args:
              profile: "0010"
          - handler: purge-server-history
            when: pre-launch
          - handler: purge-shader-cache
            when: pre-launch
          - handler: purge-logo-cache
            when: pre-launch

You can also find the example configuration as a file: config.example.yaml.

Downloads

License

This is free software under the terms of the MIT license.

joinme.click-launcher's People

Contributors

cetteup avatar mawrbf2 avatar renovate[bot] avatar zefanjajobse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

joinme.click-launcher's Issues

Launching a game without specifying an IP address

As mentioned in Discord, would be cool to have a protocol handler that just allows starting the game. Should also consider any configured config.yaml settings.

i.e. bf2://launch would just end up opening the game.

BF2 does not launch if documents folder has been moved

Battlefield 2 current fails to launch if the Documents folder has been moved from it's default location.

Since only the documents if moved and not the entire user home dir, the path construction [homeDir]\Documents does not work in these cases.

  • investigate whether different environment variable always points to currently configured documents folder
  • if not, investigate lookup via registry HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

BF2 and BF1942 expansion packs can be launched with mods

Currently, bf2sf://127.0.0.1:16567?mod=bfp2 is considered a valid URL that will cause the launcher to BF2.exe with these flags:

+joinServer 127.0.0.1 +port 16567 +playerName [...]+playerPassword [...] +modPath mods/bfp2 +ignoreAsserts 1 +menu 1 +restart 1 +modPath mods/xpack +ignoreAsserts 1

The game will use the later flags, so it will start Special Forces, not the pirates mod. Expected behaviour would be to throw an error regarding an unsupported mod. Alternatively, stop tracking expansion packs (which are technically mods) as separate games.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update golangci/golangci-lint-action action to v6
  • chore(deps): update softprops/action-gh-release action to v2
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

asdf
.tool-versions
  • golang 1.19.6
github-actions
.github/workflows/ci.yaml
  • actions/setup-go v5
  • actions/checkout v3
  • golangci/golangci-lint-action v5
  • actions/setup-go v5
  • actions/checkout v3
  • actions/cache v3
.github/workflows/release.yaml
  • actions/setup-go v5
  • actions/checkout v3
  • actions/upload-artifact v4
  • actions/checkout v3
  • actions/download-artifact v4
  • actions/upload-artifact v4
  • actions/download-artifact v4
  • softprops/action-gh-release v1
gomod
go.mod
  • go 1.19
  • golang.org/x/sys v0.6.0
  • github.com/cetteup/conman v0.1.5
  • github.com/cetteup/filerepo v0.0.5
  • github.com/golang/mock v1.6.0
  • github.com/mitchellh/go-ps v1.0.0
  • github.com/rs/zerolog v1.29.0
  • github.com/stretchr/testify v1.8.2
  • gopkg.in/yaml.v3 v3.0.1

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.