View Full Version : CREST2 - a.k.a. CARS2 REST API

M. -VIPER- Morgan
29-03-2018, 11:00
Introducing CREST2 - also known as the CARS2 REST API

First of all I have to say thanks to Lars for this great app. I mailed with him and he wrote that he will no longer working on CREST, because of other priorities in his life. I can understand that completely.
Since I need CREST for a web-based app, I decided to check what I can do here.
Software development is not my daily business, more a hobby, but I have done my best to get it back to work.

This thread is a copy from Lars' thread in the developer forum (http://pcars2.wmdportal.com/showthread.php?22668-CREST2-a.k.a.-CARS2-REST-API). I updated it with the new info only.

Project type: Data server/API.

Project status: 0.0.5 released.

Project web site: http://www.cars-rest-api.com <- no longer updated, but still informative

Public repository: https://github.com/viper4gh/CREST2
old: https://github.com/NLxAROSA/CREST/tree/CREST2


This project provides a way for developers to have access to the data provided by pCars2 Shared Memory in a more portable and accessible format than a mapped memory file. It's a windows native command line application (written in C++ and a fair bit of plain old C) that will act as a local web/application server and serve the data via JSON over HTTP by accessing a URL. Any web browser or HTTP client will be able to access the data both locally and inside the local network, which facilitates easy add-on development in any language (e.g. JavaScript, Java, C, C++, C#, etc. etc.) and platform (e.g. web browser, iOS, Android, Windows Phone or other) with a vast array of client REST libraries at your disposal.

It's basically the same as the original CREST (http://forum.projectcarsgame.com/showthread.php?30696-CREST-a-k-a-Cars-REST-API), which can be found at the same site and GitHub location (CREST is the master branch, CREST2 is the CREST2 branch).


None yet.

Sample JSON

Click here (http://www.cars-rest-api.com/files/crest2.json) (old)

Current build:

Download available at this location (https://drive.google.com/drive/folders/1zx12hGJttkTa0aG1jIO9AZ28VM7cDj-J).

Installation instructions

1. Download the source code from the Github repository and build/run it in Visual Studio (check the README for instructions).

- OR -

1. Download the application from the download link at this location (https://drive.google.com/drive/folders/1zx12hGJttkTa0aG1jIO9AZ28VM7cDj-J).
2. Start the application by double-clicking it.
3. Windows will complain about security (coming from an unknown/unverified source) both when downloading and starting the application. Please allow/unblock the application in order to allow it to start. Windows Firewall will also ask for permission to access the local network. Please allow it access for proper functioning.
4. If Windows complains about missing DLLs (e.g. MSVCR120.DLL or similar), please download and install the Visual C++ Redistributable Packages for Visual Studio 2017 from https://www.visualstudio.com/de/downloads/ (scroll down to "Other Tools and Frameworks", vcredist_x86.exe), then start again.
5. Console will show a notification about the server being up and running and display port and URL information.

Connecting to Project CARS 2

1. Start Project CARS 2.
2. Enable Shared Memory "Project CARS2" mode in the settings
3. Open up a browser (Chrome works best) and go to http://localhost:8180/crest2/v1/api
4. Profit! F5/Refresh until you drop!

Known issues:

Issues are listed in GitHub: https://github.com/viper4gh/CREST2/issues.
Feel free to add bugs you may find, or feature requests, etc.
But as I described above this is more a hobby, so please don't expect too much.

Download (https://drive.google.com/drive/folders/1zx12hGJttkTa0aG1jIO9AZ28VM7cDj-J)

Lars Rosenquist
31-03-2018, 19:08
Since I don't have time to work on this myself, it's awesome to see this being continued by another open source developer. One of the reasons I love open source: anyone can fork and continue/do their own thing if they want. :)

28-04-2018, 20:14
Thanks, Viper! This API made it a lot easier for me to build a custom dashboard!

02-10-2018, 21:03
Thanks Viper for picking this up. Very much appreciated.