# Function: onReconnect
▸ onReconnect(this
: void, handler
: ReconnectEventHandler): void
监听断线重连(触发条件:匹配模式下游戏开始之后重连,或者自定义房间模式下重连)
# 参数:
属性 | 类型 | 描述 |
---|---|---|
this | void | - |
handler | ReconnectEventHandler | 事件触发的回调方法 |
ReconnectEventHandler: MogsEventHandler‹ReconnectEvent›
ReconnectEvent
结构
属性 | 类型 | 描述 |
---|---|---|
gameStartTime? | Date | 游戏开始的时间 |
lockStepTokenInfo? | LockStepTokenInfo | 帧同步信息(当前游戏模式配置了帧同步房间才会返回) |
matchResult? | ReadonlyClone‹Room› | 当前的匹配结果(匹配模式下使用) |
room? | ReadonlyClone‹Room› | 自定义房间信息(自定义房间模式下使用) |
type | Reconnect | 事件类型,由具体的事件构造时提供 |
# 返回值:
void