{ "info": { "author": "Joao Coutinho", "author_email": "me@joaoubaldo.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python" ], "description": "# ACUDPClient\n\n[![Build Status](https://travis-ci.org/joaoubaldo/acudpclient.svg?branch=master)](https://travis-ci.org/joaoubaldo/acudpclient)\n\nACUDPClient is a Python module that can be used to communicate with an Assetto Corsa dedicated server.\nUsing its UDP protocol, real time telemetry, lap timings and session information is pushed to the client.\nA few actions, like sending/broadcasting messages are also available.\n\n\n## Installation\n\n```bash\n$ python setup.py install\n```\n\nor\n\n```bash\n$ pip install acudpclient\n```\n\n(virtualenv is recommended)\n\n\n## Testing\n```bash\n$ nosetests\n```\n\n### Capturing real data for testing purposes\n\n1. Start the ACServer with UDP active.\n\n2. Capture the data using `tcpdump`:\n```bash\n$ tcpdump -w /tmp/ac_out.pcap -s0 -i lo -n udp dst port 10000\n```\n\n3. Extract all udp payload from the pcap file:\n```bash\n$ tshark -r /tmp/ac_out.pcap -T fields -e data | tr -d '\\n' | perl -pe 's/([0-9a-f]{2})/chr hex $1/gie' > /tmp/ac_out\n```\n\n4. `/tmp/ac_out` contains binary data sent by ACServer.\n\n\n## Usage\n\nThe client should be initialized like this:\n```python\nfrom acudpclient.client import ACUDPClient\n\nclient = ACUDPClient(port=10000, remote_port=10001, host='127.0.0.1')\nclient.listen()\n```\n\n* `remote_port` and `host` are used to send data to the AC server\n* `listen()` will bind the server socket to `port`.\n\nServer events can be handled directly or by event subscribers. In\nboth cases, `get_next_event()` method must be invoked in the\napplication's main loop.\n\nWhen handling events directly, a call to `get_next_event()`\nmight return `None`, meaning there's no event available at that\npoint (the internal `ACUDPClient` socket is non-blocking).\n\nWhen creating a subscriber class, specific events can be handled by creating\nmethods with the following naming scheme `on_(self, event)`\nwhere `event_type` is any of the types found in\n`acudpclient.protocol.ACUDPConst` class (see Usage).\n\nEvents passed to `on_(self, event)` are dictionaries containing\ndifferent keys depending on the event's type. Refer to `acudpclient.client import ACUDPClient`\nto see which keys are available per event type.\n\n\n## Examples\n\nHandle events directly:\n```python\nfrom acudpclient.client import ACUDPClient\n\nclient = ACUDPClient(port=10000, remote_port=10001)\nclient.listen()\n\nclient.get_session_info()\n\nwhile True:\n event = client.get_next_event(call_subscribers=False)\n print event\n```\n\n\nHandle events with a subscriber:\n```python\nfrom acudpclient.client import ACUDPClient\n\nclass ACEventHandler(object):\n def on_ACSP_LAP_COMPLETED(self, event):\n print event\n\n def on_ACSP_NEW_SESSION(self, event):\n print event\n\n def on_ACSP_NEW_CONNECTION(self, event):\n print event\n\n\nhandler = ACEventHandler()\nclient = ACUDPClient(port=10000, remote_port=10001)\nclient.listen()\nclient.subscribe(handler)\n\nwhile True:\n client.get_next_event()\n```\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://b.joaoubaldo.com", "keywords": "assetto-corsa dedicated-server client udp", "license": "", "maintainer": "", "maintainer_email": "", "name": "acudpclient", "package_url": "https://pypi.org/project/acudpclient/", "platform": "", "project_url": "https://pypi.org/project/acudpclient/", "project_urls": { "Homepage": "https://b.joaoubaldo.com" }, "release_url": "https://pypi.org/project/acudpclient/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "Assetto Corsa UDP Client", "version": "1.1.0" }, "last_serial": 3233283, "releases": { "0.9.0": [ { "comment_text": "", "digests": { "md5": "3157ee415dda80f37f9af34ebd0d0f2c", "sha256": "5e06ab26e0f8cd115250f7b644f5da45dc1d0c40a58e09c6f6a53be7d07d1462" }, "downloads": -1, "filename": "acudpclient-0.9.0.tar.gz", "has_sig": false, "md5_digest": "3157ee415dda80f37f9af34ebd0d0f2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4168, "upload_time": "2016-06-14T14:21:06", "url": "https://files.pythonhosted.org/packages/65/bd/38da15d6c59534e441aad81da33d6747d5b0e7744097605ef754c750ad02/acudpclient-0.9.0.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "38fd6c5736efa950d90441693d5b88dd", "sha256": "754e735df85741c5ea4ee5cf0e9e7bfc09a97ae9e5bc56187138f80b483a4302" }, "downloads": -1, "filename": "acudpclient-0.9.3.tar.gz", "has_sig": false, "md5_digest": "38fd6c5736efa950d90441693d5b88dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4349, "upload_time": "2016-06-14T22:45:51", "url": "https://files.pythonhosted.org/packages/74/6d/46339504285e8f1d89fab4ac9a2c75f0024f10a6a264df634d0fac68105e/acudpclient-0.9.3.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "b1dba0566b90b97e6fa727b90c254333", "sha256": "e3636e8826c9a0b7ff28c14840dc35687a90128d7515fe898817056ac36e76ac" }, "downloads": -1, "filename": "acudpclient-0.9.4.tar.gz", "has_sig": false, "md5_digest": "b1dba0566b90b97e6fa727b90c254333", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4343, "upload_time": "2016-06-14T23:22:04", "url": "https://files.pythonhosted.org/packages/54/12/c53f2d3cf29f69ed7930448196ec4f527e4e1c324ac763af6e43309b6bfc/acudpclient-0.9.4.tar.gz" } ], "0.9.5": [ { "comment_text": "", "digests": { "md5": "f30e9c088d4b08d9fe4b2003ab794c66", "sha256": "caa4e47f5e848c41a31a34994bb40d630fd2d16853b95caa2276b69e62920b84" }, "downloads": -1, "filename": "acudpclient-0.9.5.tar.gz", "has_sig": false, "md5_digest": "f30e9c088d4b08d9fe4b2003ab794c66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4678, "upload_time": "2016-06-14T23:33:26", "url": "https://files.pythonhosted.org/packages/e4/42/1766737e12a7d78855db464801210531a3b3754c78c26550f4474aad8c30/acudpclient-0.9.5.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "92889ee0a77ccdee62e2ee779d7b8a87", "sha256": "8d8917dc616acc763fe06665e7e9cfb752feaab7ec52a9e88d56bb8b209b1460" }, "downloads": -1, "filename": "acudpclient-1.0.0.tar.gz", "has_sig": false, "md5_digest": "92889ee0a77ccdee62e2ee779d7b8a87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8920, "upload_time": "2016-07-15T16:52:32", "url": "https://files.pythonhosted.org/packages/2d/a7/98200dfdf5d3768eccfc56ad73f52037c02bc7325fdd208f8dd7bf262b21/acudpclient-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "3e85d3c136e763532c86213986ef12a9", "sha256": "3e51cedf13685f1c5d2dc86b0800be7716215c339c4d55ec74ebbd40f92d1a47" }, "downloads": -1, "filename": "acudpclient-1.1.0.tar.gz", "has_sig": false, "md5_digest": "3e85d3c136e763532c86213986ef12a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9049, "upload_time": "2017-10-07T21:41:02", "url": "https://files.pythonhosted.org/packages/ae/f3/ec5ba444dc10eb6a6851c6a0e9bfb215985ec6f99938b3effb887b41da69/acudpclient-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3e85d3c136e763532c86213986ef12a9", "sha256": "3e51cedf13685f1c5d2dc86b0800be7716215c339c4d55ec74ebbd40f92d1a47" }, "downloads": -1, "filename": "acudpclient-1.1.0.tar.gz", "has_sig": false, "md5_digest": "3e85d3c136e763532c86213986ef12a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9049, "upload_time": "2017-10-07T21:41:02", "url": "https://files.pythonhosted.org/packages/ae/f3/ec5ba444dc10eb6a6851c6a0e9bfb215985ec6f99938b3effb887b41da69/acudpclient-1.1.0.tar.gz" } ] }