Ever since bringing back the server for the OUYA gaming console, I thought that it would be nice if I could browse the games list on my PC.
Last week I had some spare time, and wrote an HTML generator that takes the static API and builds HTML for the discover store listings and game detail pages. Each took an evening, and now everyone is able to browse the OUYA discover store and look at the game details and download the .apk files that are stored at the Internet Archive.
Screenshots
DISCOVER main menu, OUYA vs. web:
"cweiske's picks" on the discover page, OUYA vs. web:
Antichromatic game details page, OUYA vs. web:
Push to my OUYA
Now that I was able to browse the images with my PC, I wanted the Push to my OUYA feature back. It was available on the original ouya.tv game details pages, and it worked like that:
- Log into your account on ouya.tv
- Click "Push to my OUYA" on a game page, which puts the game into the download queue.
- The OUYA checks the queue API every 5 minutes and installs the games in it.
- Once the game has been installed, it is removed from the queue
My static API does not have user accounts, but I figured that most people would browse the games list at home, and that their OUYA will also be on the same home network. With IPv4, both PC and OUYA will have the same public IP address, so that can be used as "user account". With IPv6, they will share the same 64-bit network prefix, so that one can be used as identifier as well.
So when you click "Push to my OUYA" on the website, the combination of your IP address/prefix and the game's package name will be stored in a tiny SQLite database. When the OUYA fetches the download queue, it will get the game UUID and install it.
To make the push feature work when stouyapi is installed in your local network, local IP addresses are mapped to a special "local" IP address.
I also added a limitation to 30 games per IP, and automatically delete entries older than 24 hours from the queue.
Other news
Thanks to Devin's work, all the .apk files are mirrored on our own server statics.ouya.world.
While downloading the games from the Internet Archive was prettly slow (1MiB/s), the new server allows 10-20MiB/s, depending on your location. Installing large games is a snap now.