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

Fix Editor network Provisioning #7829

Merged
merged 1 commit into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { useEffect } from 'react'
import React, { useEffect } from 'react'

import {
LocationInstanceConnectionService,
useLocationInstanceConnectionState,
useWorldInstance
} from '@etherealengine/client-core/src/common/services/LocationInstanceConnectionService'
import { Engine } from '@etherealengine/engine/src/ecs/classes/Engine'
import { DataChannels } from '@etherealengine/client-core/src/components/World/ProducersAndConsumers'
import { PeerMedia } from '@etherealengine/client-core/src/media/PeerMedia'
import { useEngineState } from '@etherealengine/engine/src/ecs/classes/EngineState'
import { NetworkState } from '@etherealengine/engine/src/networking/NetworkState'
import { getMutableState, useHookstate } from '@etherealengine/hyperflux'

export const useEditorNetworkInstanceProvisioning = () => {
export const EditorNetworkInstanceProvisioning = () => {
const engineState = useEngineState()
const worldHostID = useHookstate(getMutableState(NetworkState).hostIds.world).value

Expand All @@ -31,4 +31,11 @@ export const useEditorNetworkInstanceProvisioning = () => {
currentLocationInstanceConnection?.connecting,
currentLocationInstanceConnection?.provisioned
])

return (
<>
<DataChannels />
<PeerMedia />
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
EditorActiveInstanceServiceReceptor,
useEditorActiveInstanceState
} from './EditorActiveInstanceService'
import { useEditorNetworkInstanceProvisioning } from './useEditorNetworkInstanceProvisioning'
import { EditorNetworkInstanceProvisioning } from './EditorNetworkInstanceProvisioning'

export const WorldInstanceConnection = () => {
const { t } = useTranslation()
Expand Down Expand Up @@ -60,8 +60,6 @@ export const WorldInstanceConnection = () => {
}
}, [])

useEditorNetworkInstanceProvisioning()

const onSelectInstance = (selectedInstance: string) => {
if (selectedInstance === 'None' || (worldNetworkHostId && selectedInstance !== worldNetworkHostId)) {
if (worldNetworkHostId) {
Expand Down Expand Up @@ -90,6 +88,7 @@ export const WorldInstanceConnection = () => {

return (
<div className={styles.toolbarInputGroup} id="transform-space">
<EditorNetworkInstanceProvisioning />
<InfoTooltip title="Active Instances">{getIcon()}</InfoTooltip>
<SelectInput
className={styles.selectInput}
Expand Down