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

Commit 2f45ec8

Browse files
authored
Fix Editor network Provisioning (#7829)
## Summary editor provisioning now creates data channels and handles peer media ## References closes #_insert number here_ ## Checklist - [ ] If this PR is still a WIP, convert to a draft - [ ] When this PR is ready, mark it as "Ready for review" - [ ] [ensure all checks pass](https://github.com/etherealengine/etherealengine/wiki/Testing-&-Contributing) - [ ] Changes have been manually QA'd - [ ] Changes reviewed by at least 2 approved reviewer ## QA Steps _List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos._
1 parent 7b9d62d commit 2f45ec8

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

packages/editor/src/components/realtime/useEditorNetworkInstanceProvisioning.tsx renamed to packages/editor/src/components/realtime/EditorNetworkInstanceProvisioning.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { useEffect } from 'react'
1+
import React, { useEffect } from 'react'
22

33
import {
44
LocationInstanceConnectionService,
5-
useLocationInstanceConnectionState,
65
useWorldInstance
76
} from '@etherealengine/client-core/src/common/services/LocationInstanceConnectionService'
8-
import { Engine } from '@etherealengine/engine/src/ecs/classes/Engine'
7+
import { DataChannels } from '@etherealengine/client-core/src/components/World/ProducersAndConsumers'
8+
import { PeerMedia } from '@etherealengine/client-core/src/media/PeerMedia'
99
import { useEngineState } from '@etherealengine/engine/src/ecs/classes/EngineState'
1010
import { NetworkState } from '@etherealengine/engine/src/networking/NetworkState'
1111
import { getMutableState, useHookstate } from '@etherealengine/hyperflux'
1212

13-
export const useEditorNetworkInstanceProvisioning = () => {
13+
export const EditorNetworkInstanceProvisioning = () => {
1414
const engineState = useEngineState()
1515
const worldHostID = useHookstate(getMutableState(NetworkState).hostIds.world).value
1616

@@ -31,4 +31,11 @@ export const useEditorNetworkInstanceProvisioning = () => {
3131
currentLocationInstanceConnection?.connecting,
3232
currentLocationInstanceConnection?.provisioned
3333
])
34+
35+
return (
36+
<>
37+
<DataChannels />
38+
<PeerMedia />
39+
</>
40+
)
3441
}

β€Žpackages/editor/src/components/realtime/WorldInstanceConnection.tsxβ€Ž

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
EditorActiveInstanceServiceReceptor,
2626
useEditorActiveInstanceState
2727
} from './EditorActiveInstanceService'
28-
import { useEditorNetworkInstanceProvisioning } from './useEditorNetworkInstanceProvisioning'
28+
import { EditorNetworkInstanceProvisioning } from './EditorNetworkInstanceProvisioning'
2929

3030
export const WorldInstanceConnection = () => {
3131
const { t } = useTranslation()
@@ -60,8 +60,6 @@ export const WorldInstanceConnection = () => {
6060
}
6161
}, [])
6262

63-
useEditorNetworkInstanceProvisioning()
64-
6563
const onSelectInstance = (selectedInstance: string) => {
6664
if (selectedInstance === 'None' || (worldNetworkHostId && selectedInstance !== worldNetworkHostId)) {
6765
if (worldNetworkHostId) {
@@ -90,6 +88,7 @@ export const WorldInstanceConnection = () => {
9088

9189
return (
9290
<div className={styles.toolbarInputGroup} id="transform-space">
91+
<EditorNetworkInstanceProvisioning />
9392
<InfoTooltip title="Active Instances">{getIcon()}</InfoTooltip>
9493
<SelectInput
9594
className={styles.selectInput}

0 commit comments

Comments
Β (0)