Documentation ¶
Overview ¶
Hiscore package implements the communication between a Gopher2600 high-score server and the local client. It is a proof-of-concept and is not yet fully defined.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Preferences ¶ added in v0.3.1
type Preferences struct { AuthToken prefs.String Server prefs.String // contains filtered or unexported fields }
func (*Preferences) Load ¶ added in v0.3.1
func (p *Preferences) Load() error
Load hiscore preferences from disk.
func (*Preferences) Save ¶ added in v0.3.1
func (p *Preferences) Save() error
Save current hiscore preferences to disk.
func (*Preferences) String ¶ added in v0.3.1
func (p *Preferences) String() string
type Session ¶
type Session struct { Prefs *Preferences // contains filtered or unexported fields }
Session represents a gaming session with the hi-score server. A session is started (with StartSession()) when a game starts, and concludes (with EndSession() when the game ends by uploading the game stats. Instances of the Session type can be used more than once.
func NewSession ¶
NewSession is the preferred method of initialisation of the Session type.
func (*Session) EndSession ¶
EndSession notifies the the HiScore server that a game has finished, with details of the game session (time spent, score, etc.)