UltraStar-Deluxe / Play

Free and open source singing game with song editor for desktop, mobile, and smart TV

Home Page:https://ultrastar-play.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Navigate main game using the companion app

achimmihca opened this issue · comments

Actual behaviour

The companion app can not be used to navigate the main game. One has to use a keyboard/mouse or gamepad in addition to a microphone

Expected behaviour

The companion app could add a screen with buttons left/right/up/down and return/escape to navigate the main game.
This would allow to select songs and singing into the mic using the same device.

This can be implemented relative easily

  • add HTTP endpoints for the navigation
  • if one of the endpoints receives a request then simulate the corresponding keyboard key press from code

I think it makes sense to configure a "master-device". Only this is able to do commands on the main app. So a bit chaos could be prevented when more companion apps are used.

In general the first connected app should be the master app. But you should be able to define another device to be the master. Only the main app and the master companion app should be allowed to do that.

What do you think?

Good point. Some sort of permissions are needed.

I plan to add permissions for

  • the main game navigation (this issue)
  • editing player profiles (#176)
  • adding songs to the song queue (#247)

It should be possible to add permissions from the main game. By default, no extra permissions are set.

I'm a really big fan of auto generated REST-API-Documentation. In Java I use the spring-openapi package. (Unfortunately spring doesn't exist in the C# world). I found this for a C# environment:
https://www.syncfusion.com/blogs/post/automatically-generate-api-docs-for-asp-net-core.aspx
https://learn.microsoft.com/en-us/aspnet/core/tutorials/web-api-help-pages-using-swagger?view=aspnetcore-7.0

The outcome would something like this:
https://petstore.swagger.io/

The big advantage is not only the nice design and overview of the api. But the ability to test your api out of the generated html.

Is this a way we can walk or how is it usually made in c# / unity?

I also think that only a generated documentation for an API makes sense because otherwise documentation tends to be outdated quickly.

However, at the moment I am using a plain C# HttpListener in a custom Unity package because I did not find existing solutions for Unity.

Adding generated documentation is not a prio at the moment but I will look into swagger when I find time. I consider this a task for another time.