0.1.4 • Published 10 years ago
acsp v0.1.4
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_infosent in response to a.getCarInfo()callnew_sessiontriggered when a new session startsend_sessiontriggered when a session ends (see note below)collide_envtriggered when a car collides with the environmentcollide_cartriggered when a car collides with another carcar_updatetriggered everyxmilliseconds after calling.enableRealtimeReport(x)new_connectiona new driver has connectedconnection_closeda driver has disconnectedlap_completeda 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 everymsmilliseconds.sendChat(car_id, msg)send a chat messagemsgto drivercar_id.broadcastChat(msg)send a chat messagemsgto all connected drivers
0.1.4
10 years ago
0.1.3
10 years ago
0.1.2
10 years ago
0.1.1
10 years ago
0.1.0
10 years ago
0.0.16
10 years ago
0.0.15
10 years ago
0.0.14
10 years ago
0.0.13
10 years ago
0.0.12
10 years ago
0.0.11
10 years ago
0.0.10
10 years ago
0.0.9
10 years ago
0.0.8
10 years ago
0.0.7
10 years ago
0.0.6
10 years ago
0.0.5
10 years ago
0.0.4
10 years ago
0.0.3
10 years ago
0.0.2
10 years ago
0.0.1
10 years ago
0.0.0
10 years ago