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

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField committed Jul 19, 2024
1 parent 09e10cf commit 8af3544
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 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
22 changes: 0 additions & 22 deletions tests/avatars/AvatarIntegrationTests.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
import { Engine, destroyEngine } from '@etherealengine/ecs/src/Engine'
import { loadDRACODecoderNode } from '@etherealengine/engine/src/assets/loaders/gltf/NodeDracoLoader'
import { overrideFileLoaderLoad } from '@etherealengine/engine/tests/util/loadGLTFAssetNode'
import { getMutableState } from '@etherealengine/hyperflux'
import { createMockNetwork } from '@etherealengine/network/tests/createMockNetwork'
import { EngineState } from '@etherealengine/spatial/src/EngineState'
import { createEngine } from '@etherealengine/spatial/src/initializeEngine'
import { Physics } from '@etherealengine/spatial/src/physics/classes/Physics'
import appRootPath from 'app-root-path'
import fs from 'fs'
import path from 'path'

import { NetworkState } from '@etherealengine/network'
import { PhysicsState } from '@etherealengine/spatial/src/physics/state/PhysicsState'
import packageJson from '../../package.json'

import '@etherealengine/engine/src/EngineModule'
Expand Down Expand Up @@ -48,7 +39,6 @@ describe.skip('avatarFunctions Integration', async () => {
// before(async () => {
// await loadDRACODecoderNode()
// })

// beforeEach(async () => {
// createEngine()
// createMockNetwork()
Expand All @@ -57,11 +47,9 @@ describe.skip('avatarFunctions Integration', async () => {
// await Physics.load()
// getMutableState(PhysicsState).physicsWorld.set(Physics.createWorld())
// })

// afterEach(() => {
// return destroyEngine()
// })

// describe('loadAvatarForEntity', () => {
// const assetPaths = fetchAvatarList()
// let i = 1
Expand All @@ -77,35 +65,25 @@ describe.skip('avatarFunctions Integration', async () => {
// entityUUID: userId as string as EntityUUID
// })
// )

// applyIncomingActions()

// await act(() => receiveActions(EntityNetworkState))

// const entity = UUIDComponent.entitiesByUUID[userId as any as EntityUUID]

// spawnAvatarReceptor(userId as string as EntityUUID)

// const avatar = getComponent(entity, AvatarComponent)
// // make sure this is set later on
// avatar.avatarHeight = 0
// avatar.avatarHalfHeight = 0

// // run the logic
// const model = (await loadAvatarModelAsset(modelURL)) as any
// setupAvatarForUser(entity, model)

// // do assertions
// const avatarComponent = getComponent(entity, AvatarComponent)

// assert(avatarComponent.model!.children.length)
// assert(avatarComponent.avatarHeight > 0)
// assert(avatarComponent.avatarHalfHeight > 0)

// const { rig } = getComponent(entity, AvatarRigComponent)
// assert(rig)
// assert(rig.hips.node)

// // TODO: this currently isn't working, the update method doesnt show up in the VRM object
// // assert.equal(hasComponent(entity, UpdatableComponent), asset.split('.').pop() === 'vrm')
// })
Expand Down

0 comments on commit 8af3544

Please sign in to comment.