-
Notifications
You must be signed in to change notification settings - Fork 69
Events
The Client
class is an EventEmitter
that emits the following events
(mostly for debugging purposes):
Fires while building a RPC request envelope with subrequests.
Example requestData
structure:
{
request_id: 8145806132888207000,
requests: [
{
name: 'Get Inventory',
type: 4,
data: {
last_timestamp_ms: 0
}
}
]
}
Fires after building an RPC request envelope, just before it is encoded into a protobuf RequestEnvelope
.
Fires after receiving and successfully decoding an RPC request, just before the Promise is resolved.
Example responseData
structure:
{
status_code: 1,
request_id: '8145806132888207360',
responses: [
{
name: 'Get Inventory',
type: 4,
data: {
/* inventory data */
}
}
]
}
Fires after the initial RPC response (including the URL of the endpoint to use for all further requests) has been received and decoded.
Example responeData
structure:
{
status_code: 53,
request_id: '8145806132888207360',
api_url: 'pgorelease.nianticlabs.com/plfe/403'
}
Fires when a RPC ResponseEnvelope
has been received, just after it has been decoded.
Fires when the RequestEnvelope
structure could not be parsed (possibly due to erroneous .proto files).
Can be used to dump out the raw protobuf response and debug using protoc
.
Fires when one of the response messages received in an RPC response envelope could not be parsed (possibly
due to erroneous .proto files). Can be used to dump out the raw protobuf response and debug using protoc
.