Assetto Corsa Websockets Server
Project description
AC-WEBSOCKETS-SERVER
The ac-websockets-server is a python based server to control a local Assetto Corsa dedicated server via a websockets connection from a remote host.
Installation
You can install ac-websockets-server from PyPi:
pip install ac-websockets-server
The module is only supported in python3.
How to use
Websocket Commands
The client protocol consists of single line commands which receive a Google style JSON object response.
shutdown
The following ACWS related commands are supported:
shutdown nowshutdown the ACWS server
server
The following server related commands are supported:
server driversshows a summary of the active drivers on the serverserver entriesshows a summary of the entry_list.ini contentsserver infoshows a summary of the serverserver restartstops and starts the AC serverserver sessionsshows a summary of configured sessionsserver set session_name enable|disableenable or disable a sessionserver set session_name laps number_of_lapsset number of laps for a session (only valid for RACE)server set session_name time number_of_minsset number of mins for a sessionserver startstarts the AC serverserver stopstops the AC serverserver time number_of_minutessets the number of minutes - needs server restart to take effect
Excerts from the responses to these commands are shown below.
server drivers
# server drivers
{
"data": {
"drivers": {
"Mark Hannon": {
"name": "Mark Hannon",
"host": "192.168.1.1",
"port": 50834,
"car": "bmw_m3_e30",
"guid": "9993334455599",
"ballast": 0,
"msg": "joining"
},
"Boof Head": {
"name": "Boof Head",
"host": "192.168.2.1",
"port": 50834,
"car": "bmw_m3_e30",
"guid": "123456768",
"ballast": 0,
"msg": "joining"
},
"Crazy Guy": {
"name": "Crazy Guy",
"host": "192.168.3.1",
"port": 50834,
"car": "bmw_m3_e30",
"guid": "7777777777777",
"ballast": 0,
"msg": "joining"
}
}
}
}
server entries
# server entries
{
"data": {
"entries": {
"CAR_0": {
"car_id": "CAR_0",
"model": "dj_skipbarber_f2000",
"skin": "The9GAG",
"spectator_mode": "0",
"drivername": "",
"team": "",
"guid": "76561198102064903",
"ballast": "0",
"restrictor": "0"
}
server sessions
# server sessions
{
"Practice": {
"type": "Practice",
"laps": 0,
"time": 120,
"msg": ""
},
"Qualify": {
"type": "Qualify",
"laps": 0,
"time": "10",
"msg": ""
},
"Race": {
"type": "Race",
"laps": 20,
"time": 0,
"msg": ""
}
}
server start
# server start
{
"data": {
"msg": "Assetto Corsa server started"
}
}
# {
"data": {
"serverInfo": {
"version": "v1.15",
"timestamp": "2022-07-22 10:42:32.8776464 +1000 AEST m=+0.007426800",
"track": "rt_autodrom_most",
"cars": "[\"ks_mazda_mx5_cup\"]",
"msg": ""
}
}
}
grid
The following grid related commands are supported:
grid finishsets grid order based on latest race finishing ordergrid reversesets grid order based on latest race REVERSED ordergrid ordershows a summary of the current/updated grid ordergrid entriesshows a summary of the all slots for/from entry_list.inigrid savewrite the changes to the grid to the entry_list.ini file
Setting reverse grid and then writing the result are shown below:
# grid reverse
{
"data": {
"msg": "test/results/2020_12_20_20_58_RACE.json parse SUCCESS"
}
}
# grid finish
{
"data": {
"grid": {
"1": "Keith",
"2": ".SNRL.shille",
"3": "Wayne",
"4": "Russ S",
"5": "Mark Hannon",
"6": "RussG",
"7": "ab156"
}
}
}
# grid write
{
"data": {
"msg": "entry_list.ini file update SUCCESS"
}
}
lobby
The following lobby related commands are supported:
lobby infoshows the lobby infolobby restartre-registers to the lobby
tracker
The following tracker related commands are supported:
tracker startstarts the AC servertracker stopstops the AC servertracker restartstops and starts the AC server
All commands require stracker.ini to be stored in the cfg directory and stracker.exe in the server root.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ac_websocket_server-1.0.dev10.tar.gz.
File metadata
- Download URL: ac_websocket_server-1.0.dev10.tar.gz
- Upload date:
- Size: 57.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7337cae4476a743b341655096c5a0aa2df2c164a8e44b4f7fa6b527c98d33b46
|
|
| MD5 |
b1b106c0b5e59191d7fec88e6f39b4c4
|
|
| BLAKE2b-256 |
c1b0d5760be785843e13b6dcea8d016d02c9c248a5306e7fe39ec74697e7571e
|
File details
Details for the file ac_websocket_server-1.0.dev10-py3-none-any.whl.
File metadata
- Download URL: ac_websocket_server-1.0.dev10-py3-none-any.whl
- Upload date:
- Size: 80.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39927341902fbeaf1800861ee71d13c79b77ffb7e8b624447028bc0a2e6a0f06
|
|
| MD5 |
60afb73053c5a0d9e622922ba0f024f3
|
|
| BLAKE2b-256 |
9dd9470b26c61c469ddf790009ce85543064e4ea52ecf4aa71e9b4f42222534e
|