-
Notifications
You must be signed in to change notification settings - Fork 71
Game Creator
The game creator consists only of a few classes. The service runs a worker manager daemon which periodically updates the games. The list of the games is exposed through the game API.
The data is managed by a thread-safe class called WorkerManagerData. The synchronization is done using a lock over the set of the games. The set of games will change during each periodic update. The games that are no more present in the set of games exposed by the API are getting removed. The updates are made in parallel by multiple threads, thus the need for synchronization.
Similarly to the worker manager in the game module, adding and removing avatars is implemented for both local and on Kubernetes. Each local game gets a different port to run on, while each Kubernetes game gets it's own replication controller that replicates a single pod. Each game instance gets exposed by the Kubernetes servers that gets created together with the replication controller.