This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
# ACUDPClient

[![Build Status](https://travis-ci.org/joaoubaldo/acudpclient.svg?branch=master)](https://travis-ci.org/joaoubaldo/acudpclient)

ACUDPClient is a Python module that can be used to communicate with an Assetto Corsa dedicated server.
Using its UDP protocol, real time telemetry, lap timings and session information is pushed to the client.
A few actions, like sending/broadcasting messages are also available.


## Installation

```bash
$ python setup.py install
```

or

```bash
$ pip install acudpclient
```

(virtualenv is recommended)


## Testing
```bash
$ nosetests
```

## Usage

The client should be initialized like this:
```python
from acudpclient.client import ACUDPClient

client = ACUDPClient(port=10000, remote_port=10001, host='127.0.0.1')
client.listen()
```

* `remote_port` and `host` are used to send data to the AC server
* `listen()` will bind the server socket to `port`.

Server events can be handled directly or by event subscribers. In
both cases, `get_next_event()` method must be invoked in the
application's main loop.

When handling events directly, a call to `get_next_event()`
might return `None`, meaning there's no event available at that
point (the internal `ACUDPClient` socket is non-blocking).

When creating a subscriber class, specific events can be handled by creating
methods with the following naming scheme `on_<event_type>(self, event)`
where `event_type` is any of the types found in
`acudpclient.protocol.ACUDPConst` class (see Usage).

Events passed to `on_<event_type>(self, event)` are dictionaries containing
different keys depending on the event's type. Refer to `acudpclient.client import ACUDPClient`
to see which keys are available per event type.


## Examples

Handle events directly:
```python
from acudpclient.client import ACUDPClient

client = ACUDPClient(port=10000, remote_port=10001)
client.listen()

client.get_session_info()

while True:
event = client.get_next_event(call_subscribers=False)
print event
```


Handle events with a subscriber:
```python
from acudpclient.client import ACUDPClient

class ACEventHandler(object):
def on_ACSP_LAP_COMPLETED(self, event):
print event

def on_ACSP_NEW_SESSION(self, event):
print event

def on_ACSP_NEW_CONNECTION(self, event):
print event


handler = ACEventHandler()
client = ACUDPClient(port=10000, remote_port=10001)
client.listen()
client.subscribe(handler)

while True:
client.get_next_event()
```
Release History

Release History

1.0.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
acudpclient-1.0.0.tar.gz (8.9 kB) Copy SHA256 Checksum SHA256 Source Jul 15, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting