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

@pitwall/acc-node-wrapper

v0.1.9

Published

ACC SDK and ACC Shared Memory implementation for Node.js.

Downloads

17

Readme

acc-node-wrapper

Assetto Corsa Compitizione SDK and Shared Memory implementation for Node.js.

This package allows you to broadcast ACC data across your local network as well as interact with it on the host computer.

Mode Examples

Client/Server Mode

This mode allows you to set up a 'server' on the same machine that is running ACC and then pass the data onto different computers in your local network. If you don't want to process any data on the machine that is running ACC then pass in the forwardOnly option and processing will be skipped.

In this example the host machine would be passing on ALL of the game data to 192.168.178.43:9001 and that computer would be console.logging the data from the PHYSICS shared memory.

// host machine (server)
// should be a windows computer running ACC
import ACCNodeWrapper from "@pitwall/acc-node-wrapper";

const wrapper = new ACCNodeWrapper();

wrapper.initAsServer({
  name: "ACC",
  address: "localhost",
  password: "asd",
  cmdPassword: "",
  // these are the different addresses on your network to pass the data onto
  forwardAddresses: [{ address: "192.168.178.43", port: 9001 }],
});

wrapper.on("PHYSICS_EVENT", (data) => console.log(data));

wrapper.on("REALTIME_CAR_UPDATE", (data) => console.log(data));
// client machine
// in this example the local address of this computer would be 192.168.178.43

import ACCNodeWrapper from "@pitwall/acc-node-wrapper";

const wrapper = new ACCNodeWrapper();

wrapper.initAsClient(9001);

wrapper.on("PHYSICS_EVENT", (data) => console.log(data));

If you want to access both shared memory and broadcast API then this is the recommended way to do this. If you don't want to stream the data to the network just don't pass any network address in.

// host machine (server)
// should be a windows computer running ACC
import ACCNodeWrapper from "@pitwall/acc-node-wrapper";

const wrapper = new ACCNodeWrapper();

wrapper.initAsServer({
  name: "ACC",
  address: "localhost",
  password: "asd",
  cmdPassword: "",
});

wrapper.on("PHYSICS_EVENT", (data) => console.log(data));

wrapper.on("REALTIME_CAR_UPDATE", (data) => console.log(data));

Broadcast Mode

This code will work on any machine in your network but does not return any data from shared memory. If you want to run it on a computer not running ACC just change the address to the IP of the computer running ACC

import ACCNodeWrapper from "@pitwall/acc-node-wrapper";

const wrapper = new ACCNodeWrapper();

wrapper.initBroadcastSDK({
  name: "ACC",
  address: "localhost",
  password: "asd",
  cmdPassword: "",
  port: 9000,
});

wrapper.on("REALTIME_CAR_UPDATE", (data) => console.log(data));

Shared Memory Mode

// host machine (server)
// should be a windows computer running ACC
import ACCNodeWrapper from "@pitwall/acc-node-wrapper";

const wrapper = new ACCNodeWrapper();

wrapper.initSharedMemory({
  graphicsUpdateInt: 250,
  physicsUpdateInt: 250,
  staticUpdateInt: 250,
});

wrapper.on("STATIC_EVENT", (data) => console.log(data));

Special Thanks

FynniX This package is a fork from the original acc-node-wrapper It is 'rewritten' in typescript to allow for intellisense of returned data. It also is designed to not fail when installed on an OS other than windows, although it does not provide full functionality when not on windows with ACC installed on it.

It can also broadcast the results of the shared memory across the local network when running in client/server mode. The use case for this was when the computer running ACC was not also running a dashboard like in Pit Pi

License

Released under the MIT License.

Notes

This package is stable and can be used but I will be continuing to build out it's API. You can expect the main APIs not to change in future.