GithubHelp home page GithubHelp logo

acsp's Introduction

ACSP - Assetto Corsa Server Protocol

Uses the UDP Plugin feature of Assetto Corsa v1.2+ to get realtime reports on car positions, collisions, lap times and more...

Install

npm install acsp

Usage

var ACSP = require('acsp');

var a = ACSP({
  host: 'localhost',
  port: 11000
});

// listen for car_info events
a.on('car_info', function(carinfo){
	console.log(carinfo);
});

// request car_info for car #0
a.getCarInfo(0);

// getCarInfo() also returns a Promise
a.getCarInfo(0).then(function(info){
	console.log(info); // {...}
})

Events

  • car_info sent in response to a .getCarInfo() call
  • new_session triggered when a new session starts
  • end_session triggered when a session ends (see note below)
  • collide_env triggered when a car collides with the environment
  • collide_car triggered when a car collides with another car
  • car_update triggered every x milliseconds after calling .enableRealtimeReport(x)
  • new_connection a new driver has connected
  • connection_closed a driver has disconnected
  • lap_completed a car has completed a lap

Note: ACServer must be able to write to the ./results path (relative to ACserver.exe) in order for ACSP to emit this event. This directory does not exist by default - so you will need to create it! (This is an Assetto Corsa bug)

Methods

  • .getCarInfo(car_id) request car_info for car_id
  • .enableRealtimeReport(ms) request realtime car updates every ms milliseconds
  • .sendChat(car_id, msg) send a chat message msg to driver car_id
  • .broadcastChat(msg) send a chat message msg to all connected drivers

acsp's People

Contributors

kipke avatar mikuso avatar

Watchers

 avatar

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.