npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homegames-core

v1.0.33

Published

Play games at home

Downloads

149

Readme

Homegames Core

Homegames core contains Homegames server stuff. The Homegames server is responsible for providing game sessions clients can connect to.

Setup

Note: You probably don't want to run homegames-core directly if you're just trying to play games. The best way to do that is via the executables available at homegames.io

Requirements:

  • Node.js >= 18
npm install
node index.js

By default, this will run a Homegames game server on port 7001. You can override this in your config.

Games

Built-in games are located in src/games. Downloaded community games are in different places depending on your operating system.

Windows: C:\Users\<username>\AppData\homegames\hg-games

MacOS: ${HOME}/Library/Application Support/homegames/hg-games

Linux: /path/to/home/.homegames/hg-games

Config

Homegames will look for a config.json file in the root project directory. If present, it will override defaults. Here's an example config.json:

{
    "LINK_ENABLED": true,
    "HOMENAMES_PORT": 7400,
    "HOME_PORT": 9801,
    "LOG_LEVEL": "INFO",
    "GAME_SERVER_PORT_RANGE_MIN": 8300,
    "GAME_SERVER_PORT_RANGE_MAX": 8400,
    "HTTPS_ENABLED": false,
    "BEZEL_SIZE_X": 9,
    "BEZEL_SIZE_Y": 9,
    "DOWNLOADED_GAME_DIRECTORY": "hg-games",
    "LOG_PATH": "homegames_log.txt",
    "PUBLIC_GAMES": false,
    "ERROR_REPORTING": true,
    "ERROR_REPORTING_ENDPOINT": "https://api.homegames.io/bugs",
    "START_PATH": "/Users/josephgarcia/weed-smoke-willie/index.js",
    "TESTS_ENABLED": true,
    "ERROR_REPORTING_ENDPOINT": "https://api.homegames.io/bugs"
}

Dashboard

By default, the Homegames core server will serve the Homegames dashboard on HOME_PORT. If you're developing a game locally and want to start it directly instead of navigating through the dashboard, set START_PATH in your config.json.

The dashboard is rendered like any game but has special knowledge about game sessions and players.

Game Session

A game session (src/GameSession.js) will run a Game on a given port. It handles all of the networking and input stuff as well as Homegames-specific logic like rendering the frame around a game and letting users update their names.

The game session is responsible for:

  • Instantiating a HomegamesRoot which is responsible for stuff like the Homegames frame
    • src/homegames_root
  • Creating a Squisher and notifying players when updates occur
    • The squisher comes from our game library - squishjs
    • It's responsible for serializing ("squishing") game state.
  • Managing player connections to the session

Homenames

Homenames is an HTTP API that runs alongside a Homegames core instance. It maintains an in-memory map of player IDs to player names and settings. This allows a client to say "hey I'm player ID x" and a game session can say "I know you, you're booty slayer and you want sound muted."