Documentation
¶
Overview ¶
Package wittycouch gets a person from "Play" to a game running on a PC with Sunshine: it works out what each device can really do, and falls back to the separately installed Moonlight app where a page can't play. The stream goes through relay and the separate WittyCouch Host. It contains no Moonlight code, which is GPL-3.0: see docs/GAME-RIGS.md.
Index ¶
Constants ¶
const ( AndroidPackage = "com.limelight" AndroidActivity = "com.limelight.ShortcutTrampoline" )
The Moonlight app on Android: an activity it exports for launcher shortcuts takes a PC and an app by these names.
Variables ¶
var ManifestJSON []byte
ManifestJSON is this module's manifest (docs/MODULES.md, "The manifest").
Functions ¶
func MoonlightArgs ¶
MoonlightArgs are the arguments that start a game with the desktop Moonlight app. Nil means this game's name can't be passed safely.
func PairArgs ¶
PairArgs are the arguments that make the desktop Moonlight app ask a PC to pair, with a PIN chosen in advance so it can be shown anywhere.
func SetupSteps ¶
SetupSteps is how a device pairs with a rig the first time, in words for that device.
Types ¶
type Credit ¶
type Credit struct {
Name string `json:"name"`
Role string `json:"role"`
License string `json:"license"`
Source string `json:"source"`
}
Credit says what a piece is, under what licence, and where its source is, for anywhere that shows licences. Being clear about this is part of using other people's work properly.
type Device ¶
type Device struct {
Client string `json:"client"` // browser, desktop (the desktop app), android (the Android app), apple (the Apple app)
OS string `json:"os"` // windows, mac, linux, chromeos, android, androidtv, firetv, ios, tvos, or anything else
}
Device is what a client says it is.
type Install ¶
type Install struct {
Name string `json:"name"`
URL string `json:"url"`
Note string `json:"note,omitempty"`
License string `json:"license"`
Source string `json:"source"`
}
Install says where this device gets the Moonlight app.
func InstallFor ¶
InstallFor says where to get Moonlight for an OS, from the Moonlight project's own download page or store listing. Nothing is bundled or re-hosted here. Nil means no client is known.
type Method ¶
type Method struct {
Kind string `json:"kind"` // client, command, intent, steps
Label string `json:"label"` // what a button says
OneClick bool `json:"oneClick"` // nothing more to do once it's set up
Note string `json:"note,omitempty"` // anything worth saying first
Args []string `json:"args,omitempty"` // command: arguments for the moonlight program
Text string `json:"text,omitempty"` // command: the same, as a line to copy
Package string `json:"package,omitempty"` // intent
Activity string `json:"activity,omitempty"` // intent
Extras Extras `json:"extras,omitempty"` // intent
Steps []string `json:"steps,omitempty"` // steps
}
Method is one way to play, best first.
func Plan ¶
Plan lists what really works on this device, best first. Playing in the page, through this server, comes first wherever a device can run it: clientNote is empty unless there's something to say first. Handing off to the Moonlight app is the fallback. What's listed here is checked against the table in docs/GAME-RIGS.md.
type Target ¶
type Target struct {
RigName string
Address string // what this device should use from where it is now; empty if nothing works from here
Port int // the base port, 0 for the default
UUID string
AppID int
AppName string
Away bool // the person isn't on the home network
}
Target is the rig and game to reach. The address is only filled in for people allowed to play this game, and Moonlight still needs its own pairing before it can do anything.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package api is WittyCouch's own HTTP API (module API 5): the routes WittyMediaServer passes to it at /api/modules/wittycouch/...
|
Package api is WittyCouch's own HTTP API (module API 5): the routes WittyMediaServer passes to it at /api/modules/wittycouch/... |
|
cmd
|
|
|
wittycouch-module
command
Command wittycouch-module is WittyCouch's service (module API 5): it answers WittyCouch's own routes, which the server passes on at /api/modules/wittycouch/..., the sources of its SDUI pages, and its lifecycle.
|
Command wittycouch-module is WittyCouch's service (module API 5): it answers WittyCouch's own routes, which the server passes on at /api/modules/wittycouch/..., the sources of its SDUI pages, and its lifecycle. |
|
Package gamestream speaks the protocol a Sunshine server offers to its clients: finding a PC, pairing with it, listing what it offers and starting it.
|
Package gamestream speaks the protocol a Sunshine server offers to its clients: finding a PC, pairing with it, listing what it offers and starting it. |
|
fake
Package fake is a stand-in for Sunshine, for tests.
|
Package fake is a stand-in for Sunshine, for tests. |
|
Package relay carries a game stream between the Moonlight host program and a browser.
|
Package relay carries a game stream between the Moonlight host program and a browser. |
|
fakehost
Package fakehost stands in for the Moonlight host program, in tests.
|
Package fakehost stands in for the Moonlight host program, in tests. |
|
Package store is WittyCouch's own database (module API 5): a SQLite file in the module's own folder (WITTYMODULE_DATA), with migrations WittyCouch owns.
|
Package store is WittyCouch's own database (module API 5): a SQLite file in the module's own folder (WITTYMODULE_DATA), with migrations WittyCouch owns. |
|
Package ui is this module's server-driven UI (module API 5; WittyMediaServer docs/SDUI-MODULES.md): the Game PCs pages every app draws, the Apple TV and Android TV apps among them, which have no web view for the module's web part.
|
Package ui is this module's server-driven UI (module API 5; WittyMediaServer docs/SDUI-MODULES.md): the Game PCs pages every app draws, the Apple TV and Android TV apps among them, which have no web view for the module's web part. |

