Coder Social home page Coder Social logo

screeps-steamless-client's Introduction

Screepers Steamless Client

Overview

The Screepers Steamless Client is a web proxy for the Screeps World game client. It allows you to run Screeps in your web browser and works with macOS, Linux and Windows setups.

Requirements

  • Node.js v20+
  • Screeps World (installed using Steam)

Installation

Option 1. Temporarily install and run the latest client app:

npx screepers-steamless-client

Option 2. Install globally and then run the client app:

npm install -g screepers-steamless-client
screepers-steamless-client

Usage

View the server list page at http://localhost:8080/. This address can be changed with the --host and --port arguments.

Different servers can be accessed from the server list page, or using the url format http://localhost:8080/(BACKEND_ADDRESS)/

The server list page adds subdomains to localhost urls to keep auth tokens in separate local storage for multi server support.

Steam OpenId support is required on your local server. Enable it with screepsmod-auth. For xxscreeps servers, it's enabled by default.

Arguments

All of the command line arguments are optional.

  • --package — Path to the Screeps package.nw file. Use this if the path isn't automatically detected.
  • --host — Changes the host address. (default: localhost)
  • --port — Changes the port. (default: 8080)
  • --backend — Set the backend url. When provided, the app will directly proxy this server and disable the server list page.
  • --internal_backend — Set the backend's internal url. Requires --backend to be set. When provided, the app will use this url to connect to the server while still using its --backend name externally.
  • --server_list — Path to a custom server list json config file.
  • --beautify — Formats .js files loaded in the client for debugging.
  • --debug — Display verbose errors for development.
  • -v , --version — Display the version number.
  • -h , --help — Display the help message.

Argument Examples

Screeps package.nw

If the Screeps package.nw is not automatically detected, you will need to set the path like this:

npx screepers-steamless-client --package ~/Screeps/package.nw

Backend proxy

Proxy a server directly (disables the server list page).

npx screepers-steamless-client --backend http://localhost:21025

Docker compose

Example usage with Jomik's screeps-server. You can add this client service into your existing docker-compose.yml:

# docker-compose.yml
version: '3'
services:
  # ... existing services ...

  client:
    image: node:20
    command: >
      sh -c 'npx screepers-steamless-client
      --package /screeps.nw
      --host 0.0.0.0
      --internal_backend http://screeps:21025
      --backend http://localhost:21025'
    volumes:
      - ${SCREEPS_NW_PATH:?"Missing screeps nw file"}:/screeps.nw
    ports:
      - 8080:8080
    restart: unless-stopped

Set up the env variable SCREEPS_NW_PATH with the correct path to your Screeps package.nw (for example on macOS):

# .env
SCREEPS_NW_PATH="~/Library/Application Support/Steam/steamapps/common/Screeps/package.nw"

Custom server list

Set the path to a custom server list json config file.

npx screepers-steamless-client --server_list ./custom_server_list.json

The custom server list json file should follow the same format as server_list.json. Each object in the json file should include a type, name, and url:

  • type — This is used to organize servers into sections.
  • name — This is the name of the server.
  • url — This is used to create a link to the server.
  • subdomain — This prefixes localhost urls for multi server support.

Development Scripts

  • npm start — Builds and starts the client app.
  • npm run build — Builds the client app to dist.
  • npm run dev — Builds and watches for changes (hot reloading).
  • npm run format — Formats the src using Prettier.
  • npm run lint — Lints the src using ESLint.

Tips

This client uses "guest mode" by default in xxscreeps, providing a read-only view of the server when not signed in. To sign in with your Steam account, select "Sign Out" first, then click the Steam icon to sign in and play as normal.

Safari Example

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.