Skip to content

beyond-all-reason/bar-lobby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BAR Lobby

BAR Lobby is a new WIP lobby for the RTS game Beyond All Reason. It hopes to boldly go where no Spring client has gone before, providing a more streamlined experience, with good visuals and UX being high priority. The ultimate goal of BAR Lobby is to replace all other lobbies when it comes to playing BAR. If a significant amount of people don't wish to use it because of reasons such as functionality or speed, then this project is going very wrong.

image

Project Status

BAR Lobby is a work-in-progress and actively developed project. We are currently working towards milestones defined in the wiki/Roadmap.

BAR Lobby is an important part of BAR's Steam Roadmap, and there is a lot of other work in other places that support this development. Please take a look at the infrastructure documentation for details on how BAR Lobby fits into the rest of the system.

Functionality and Goals

  • Provide functionality for everything related to BAR. Campaigns, Missions, Multiplayer, Replays etc
  • Simple and intutive codebase, lots of documenation for contributing
  • Steam integration, automatic account creation and login
  • Smooth, seemless, fully integrated downloads. Content should be preloaded when sensible
  • Communicate entirely via Teiserver's new protocol, Tachyon. No support for the legacy SpringLobbyProtocol
  • TLS only, no unencypted comms

Contributing

Please take a look at the contributing guide to learn how to help the project.

Development

Primary Tech Stack

Recommended Environment

It is highly recommended to use VSCode for development, as it provides full, built-in TypeScript support, as well as useful extensions such as ESLint and Vue - Official (previously Volar).

Requirements

We recommend tools management software like NVM or mise-en-place for installation of the correct node version.

Local Development

npm install
npm start

Project Structure

.
├──buildResources   # used by electron-builder
├──src
│  ├──main
│  │  ├──main.ts
│  │  └──...
│  ├──preload
│  │  ├──preload.ts
│  │  └──...
│  └──renderer      # with vue
│     ├──public     # (optional) publicDir for renderer
│     ├──index.ts
│     ├──index.html
│     └──...
├──electron-builder.config.ts
├──electron.vite.config.ts
├──package.json
└──...
  • Main process
    • Runs in a Node.js environment and has access to Node.js APIs
    • Anything requiring access to the operating system or Node.js APIs needs to live here
  • Preload script
    • Runs in a Node.js environment
    • Defines global objects that can be used in the renderer
    • Handles communication between the main and renderer processes
      • Uses Electron's ipcMain and ipcRenderer modules for inter-process communication (IPC).
  • Renderer process
    • Runs in a web environment and has no direct access to Node.js APIs

Build & Publish

  • electron-forge
    • Builds the app with a pre-configured Vite setup for Electron apps
    • This intentionally does not include electron or any other node_modules dependencies in the build
      • Dependencies get added to the package by electron-builder with ASAR
      • Note: apps that only have CJS exports need to be included in the build, e.g. glob-promise
  • electron-builder
    • Packages Electron app for distribution
      • Configured for Windows NSIS installer and Linux AppImage
    • Handles publishing updates
      • Auto-updates TBD

Commands

  • npm start
    • Runs electron-forge in development mode
    • renderer runs with Hot Module Replacement (HMR)
    • main and preload are directly bundled to .vite/build
  • npm run package
    • Runs electron-forge in production mode
    • renderer is bundled to .vite/renderer
    • main and preload are bundled to .vite/build
    • This should be run before any of the npm run build commands below.
  • npm run preview
    • Runs electron-forge in production mode, and runs electron
    • main, preload, and renderer are bundled to .vite/build
    • This is useful for validating the production build without packaging the app
  • npm run build:win
    • Runs npm run build and electron-builder, building for Windows
    • Outputs NSIS installer in dist
  • npm run buildall:win
    • Runs npm run package then runs npm run build:win.
  • npm run build:linux
    • Runs npm run build and electron-builder, building for Linux
    • Outputs AppImage executable in dist
  • npm run buildall:linux
    • Runs npm run package then runs npm run build:linux.
  • npm run build:unpack
    • Runs npm run build and electron-builder, building an unpackaged directory
    • Outputs the unpacked contents in dist
    • Useful for testing
  • npm run dev-cert (optional and only for Windows development)
    • Runs electron-builder to create a self-signed cert for Windows apps.
    • After selecting "None" in the pop-up, a cert file should be created called BAR Team.pfx
    • Then run npm run build:win:dev-cert to build a signed Windows installer
  • npm run generate-i18n-assets (run when modifying source translation files)
    • Generates transformed asset files for translations in src/renderer/assets/languages

Mutliplayer

You can start multiple separate instances by overriding the assets and/or state location using env variables:

BAR_STATE_PATH=state-2 npm start
BAR_ASSETS_PATH=assets-3 BAR_STATE_PATH=state-3 npm start

At time of writing, the production server (server4) isn't setup for the new client. You need to enable dev mode in the settings, and then, in the dev settings, choose server5 which is closer to the production server, or the dev server where you can create test accounts.

License

REUSE status

Please see the LICENSE.md file for details on the license of this project.