Global

Members


<constant> arbitration

Parse an arbitration for its key
Source:

<constant> between

Validate that b is between a and c
Source:

data

Get the latest worldstate data from this cache
Source:

data

Set the current data, aslso parses and emits data
Source:

<constant> groupBy

Group an array by a field value
Source:

<constant> lastUpdated :Object

Map of last updated dates/times
Type:
  • Object
Source:

twitter

Set the current twitter data for the worldstate
Source:

Methods


emit(id, packet)

Emit an event with given id
Parameters:
Name Type Description
id string Id of the event to emit
packet Object Data packet to emit
Source:

fromNow(d [, now])

Returns the number of milliseconds between now and a given date
Parameters:
Name Type Argument Description
d string The date from which the current time will be subtracted
now function <optional>
A function that returns the current UNIX time in milliseconds
Source:
Returns:
Type
number

get( [language])

get a specific worldstate version
Parameters:
Name Type Argument Default Description
language string <optional>
'en' Locale of the worldsttate
Source:
Throws:
when the platform or locale aren't tracked and aren't updated
Type
Error
Returns:
Worldstate corresponding to provided data
Type
Object

<async> getData()

Get the current data or a promise with the current data
Source:
Returns:
either the current data if it's not updating, or the promise returning the new data
Type
Promise.<Object> | Object

<async> getParseableData()

Get data able to be parsed from twitter.
Source:
Returns:
Tweets
Type
Promise.<Array.<Object>>

initCycleStart(deps)

Set up current cycle start if it's not been initiated
Parameters:
Name Type Description
deps Deps dependencies for processing
Source:

onError(error)

Handle errors that arise while fetching data from twitter
Parameters:
Name Type Description
error Error twitter error
Source:

parseEvents(worldstate, platform [, language])

Parse new worldstate events
Parameters:
Name Type Argument Default Description
worldstate Object worldstate to find packets from
platform string platform the worldstate corresponds to
language string <optional>
'en' language of the worldstate (defaults to 'en')
Source:

<async> setUpRawEmitters()

Set up emitting raw worldstate data
Source:

setupParsedEvents()

Set up listeners for the parsed worldstate updates
Source:

<async> update()

Force the cache to update
Source:
Returns:
the currently updating promise.
Type
Promise

Type Definitions


CycleLike

Type:
  • Object
Properties:
Name Type Description
state string
key string
activation Date
Source:

Deps

Type:
  • Object
Properties:
Name Type Description
key string event key being parsed
platform string platform the event is on
language string language the event is in
cycleStart Date start of the current cycle
data Object | Array data to parse
Source:

ExternalMission

External mission data retrieved from https://10o.io/kuvalog.json
Type:
  • Object
Properties:
Name Type Description
activation Date start time
expiry Date end timer
node string formatted node name with planet
enemy string Enemy on tile
type string Mission type of node
archwing boolean whether or not the tile requires archwing
sharkwing boolean whether or not the tile requires sumbersible archwing
Source: