{"id":26103309,"url":"https://github.com/topfreegames/maestro-client","last_synced_at":"2025-04-12T17:23:03.881Z","repository":{"id":53670471,"uuid":"87852545","full_name":"topfreegames/maestro-client","owner":"topfreegames","description":"maestro-client is maestro's framework that should be included in game rooms","archived":false,"fork":false,"pushed_at":"2024-12-03T19:31:44.000Z","size":5781,"stargazers_count":8,"open_issues_count":4,"forks_count":4,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-12T17:22:46.894Z","etag":null,"topics":["cpp","game","game-development","game-room","maestro","unity"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/topfreegames.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-10T20:03:49.000Z","updated_at":"2023-05-19T21:58:36.000Z","dependencies_parsed_at":"2024-12-03T20:35:54.147Z","dependency_job_id":null,"html_url":"https://github.com/topfreegames/maestro-client","commit_stats":{"total_commits":82,"total_committers":9,"mean_commits":9.11111111111111,"dds":0.6463414634146342,"last_synced_commit":"991ce9c4bd68db7903344a2142a410b2906b2a31"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfreegames%2Fmaestro-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfreegames%2Fmaestro-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfreegames%2Fmaestro-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topfreegames%2Fmaestro-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/topfreegames","download_url":"https://codeload.github.com/topfreegames/maestro-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248602736,"owners_count":21131684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","game","game-development","game-room","maestro","unity"],"created_at":"2025-03-09T20:06:13.179Z","updated_at":"2025-04-12T17:23:03.839Z","avatar_url":"https://github.com/topfreegames.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Maestro Client\n\n_maestro-client_ is [maestro's](https://github.com/topfreegames/maestro) framework that should be included in game rooms.\n\n## Dependencies\n\n* C++11 or newer for building\n* [CMake](https://cmake.org)\n* [Conan](https://conan.io/)\n* [Boost](http://www.boost.org/)\n* [restclient-cpp](https://github.com/mrtazz/restclient-cpp) (already included in the project)\n* [Docker](https://www.docker.com/)\n\n## Installation\n\n1. Install CMake\n\n```sh\n# macOS\nbrew install cmake\n\n# Linux with apt\nsudo apt install cmake\n```\n\n2. Install Conan\n\n    You'll need [pip](https://pypi.org/project/pip/) - Python package manager. If you're using Python \u003e= v3, you can use `pip3` which installed automatically.\n\n```sh\npip3 install conan\n# or \npip install conan\n```\n\n3. Download [Boost v1.63.0](https://www.boost.org/users/history/version_1_63_0.html)\n\n    * For Unix systems, extract the Boost zip to `/usr/local/boost_1_63_0`.\n    * Add `BOOST_ROOT` environment variable into your terminal configuration file (`.bashrc`, `.zchrc`...):\n\n    ```sh\n    export BOOST_ROOT=\"/usr/local/boost_1_63_0\"\n    ```\n\n4. Install Conan dependencies\n\n```sh\nmake install\n# or\nconan install . -if _build/conan --update\n```\n\n5. And we're done! To build for all targets, run:\n\n```sh\nmake build-all\n```\n\n## Building\n\nYou can generate a project using CMake. The library itself depends on Boost format and restclient-cpp, which depends on libcurl. In order to make the build process easier, the lib includes a precompiled restclient-cpp lib (for MacOS and Linux) in the repository.\n\nBy passing the variable `CMAKE_PREFIX_PATH`, you can tell CMake where the library is located. For example, building a shared library for MacOS can be done with the following command:\n\n```bash\ncmake -H. -B_builds/mac                              \\ # output build artifacts to _builds/mac\n      -DCMAKE_BUILD_TYPE=Release                     \\ # release build\n      -DCMAKE_PREFIX_PATH=../deps/restclient-cpp/mac \\ # restclient-cpp location in relation to the build folder\n\ncmake --build _builds/mac # build the project\n```\n\nThe previous command will try to find Boost and libcurl on your system. In order to build the library without shared dependencies (outside of things like `libc++`) you can install curl using `conan`. The process should be something like the following:\n\n```bash\n# install dependencies in the _builds/mac folder\nconan install . -if _builds/mac\n\ncmake -H. -B_builds/mac -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=../deps/restclient-cpp/mac\ncmake --build _builds/mac\n```\n\nYou can then check this using `otool` on MacOS or `ldd` if built for Linux:\n\n```bash\notool -L _builds/mac/lib/libmaestro.dylib\n\n# Outputs\n_builds/mac/lib/libmaestro.dylib:\n        libmaestro.dylib (compatibility version 0.0.0, current version 0.0.0)\n        /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)\n        /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 58286.200.222)\n        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)\n        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)\n        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1555.10.0)\n\n```\n\nThe binaries should then be located at `lib/libmaestro-client.dylib` and `bin/example` in the build folder.\n\nThe process for building on Linux is the same as the previous one, but you have to point to the correct `restclient-cpp`, changing the path:\n\n```bash\n# Building for linux (the conan step is optional)\nconan install . -if _builds/linux\n\ncmake -H. -B_builds/linux -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=../deps/restclient-cpp/linux\ncmake --build _builds/linux\n```\n\n### Docker image to build for Linux\n\nThere's also a docker image available to build the lib and the room-example for linux if you are running OS X for example or simply don't want to install the dependencies to compile or haven't got it to work, use it like that:\n\n```sh\ndocker run -v $(pwd):/app-src -it quay.io/tfgco/maestro-example-builder:v2.0.0\n\n## inside the container\nconan install . -if _builds/linux\ncmake -H. -B_builds/linux -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=../deps/restclient-cpp/linux\ncmake --build _builds/linux\n```\n\nBuilding the image for the builder:\n\n```sh\ndocker build -f Dockerfile-builder -t maestro-example-builder .\n```\n\nexit from the container and, as before, if everything went well then, the ouput files should be at at `_builds/linux/lib/libmaestro-client.a` and `_builds/linux/bin/example` but will only work on linux.\n\n## Integrating Maestro in your game room\n\n### Unity instructions\n\n* Include the files in folder maestro-unity into your Assets folder\n* Initialize maestro like: `MaestroClient.Initialize(\"http://localhost:5000\");` Change localhost:5000 for a real maestro api url\n* You will have to keep calling the following methods to report the room's status to maestro:\n  \n| Method            | Description |\n| ----------------- | ----------- |\n| RoomReady()       | Every time the room is ready to receive new players, e.g. on the init or when a match has just ended |\n| RoomOccupied()    | When a match is happenning on this room |\n| RoomTerminated()  | When a room is to die (your room must die gracefully, you must catch `SIGKILL` and `SIGTERM` status and only let the room die when `Maestro::RoomTerminated` is called) |\n| RoomTerminatind() | This should be the first method you call when the room is to die, it's to be called when a gracefull shutdown will occur |\n\n* You should also call `Ping()` method periodically, so that maestro knows that your room server is alive. Call it for example every 30 seconds after the first RoomReady (on room initialization)\n\n### C++ instructions\n\n* Same as unity, using the C++ sources inside cpplib directly or compiling the shared library with the instructions above.\n\n## Release Map\n\n* ### Milestone 1\n\n* [ ] maestro-client\n  * [ ] docs\n  * [x] fake http server\n  * [x] configuration (maestro url / ping interval)\n  * [x] http client\n  * [x] polling to retrieve (host / port)\n  * [ ] deal with connection errors\n  * [x] catch sigterm/sigkill and handle graceful shutdown\n  * [x] unity support\n  * [ ] tests\n  * [x] error handling\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopfreegames%2Fmaestro-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftopfreegames%2Fmaestro-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopfreegames%2Fmaestro-client/lists"}