gpgs.multiplayer.realtime.setListeners()

Type Function
Return value none
Revision Release 2024.3703
Keywords Google Play Games Services, game network, gpgs, multiplayer, real-time, setListeners
See also gpgs.multiplayer.realtime
gpgs.multiplayer
gpgs.*

Overview

Registers listeners to intercept incoming messages for the multiplayer room. This is useful for tracking the status of peers, the room, and messages.

Gotchas

Only one listener of each type may be active at a time. Calling this method while another listener of the same type is registered will replace the original listener with the new one.

Syntax

gpgs.multiplayer.realtime.setListeners( params )
params (required)

Table. Contains parameters for the call — see the next section for details.

Parameter Reference

The params table contains parameters for the call.

message (optional)

Listener. Listener function which receives a message event.

peer (optional)

Listener. Listener function which receives a peer event.

room (optional)

Listener. Listener function which receives a room event.