Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigate main game using the companion app #381

Open
achimmihca opened this issue Jan 30, 2023 · 4 comments
Open

Navigate main game using the companion app #381

achimmihca opened this issue Jan 30, 2023 · 4 comments

Comments

@achimmihca
Copy link
Collaborator

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
@supernevi
Copy link
Contributor

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?

@achimmihca
Copy link
Collaborator Author

Good point. Some sort of permissions are needed.

I plan to add permissions for

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

@supernevi
Copy link
Contributor

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?

@achimmihca
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants