Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev' into ir-1827-separate-physics-world-per-scene
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField committed Jul 21, 2024
2 parents de6973d + 8af3544 commit fb61683
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/examples/InstanceConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ export default function InstanceConnection() {
console.log('onNetworkDisconnect')
const instanceID = Object.keys(getState(LocationInstanceState).instances)[0]
const network = getState(NetworkState).networks[instanceID] as SocketWebRTCClientNetwork | Network
if ('primus' in network.transport) network.transport.primus.end()
if ('primus' in network) network.primus.end()
}

const onNetworkLostConnection = () => {
console.log('debug onNetworkLostConnection')
const instanceID = Object.keys(getState(LocationInstanceState).instances)[0]
const network = getState(NetworkState).networks[instanceID] as SocketWebRTCClientNetwork | Network
if ('heartbeat' in network.transport) clearInterval(network.transport.heartbeat)
if ('heartbeat' in network) clearInterval(network.heartbeat)
/** in 10 seconds, the server will end the connection to the client and remove it's peer */
}

Expand Down

0 comments on commit fb61683

Please sign in to comment.