Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.
Draft
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
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ ARG VITE_READY_PLAYER_ME_URL
ARG VITE_DISABLE_LOG
ARG VITE_AVATURN_URL
ARG VITE_AVATURN_API
ARG VITE_FEATHERS_STORE_KEY
ENV MYSQL_HOST=$MYSQL_HOST
ENV MYSQL_PORT=$MYSQL_PORT
ENV MYSQL_USER=$MYSQL_USER
Expand All @@ -85,6 +86,7 @@ ENV VITE_READY_PLAYER_ME_URL=$VITE_READY_PLAYER_ME_URL
ENV VITE_DISABLE_LOG=$VITE_DISABLE_LOG
ENV VITE_AVATURN_URL=$VITE_AVATURN_URL
ENV VITE_AVATURN_API=$VITE_AVATURN_API
ENV VITE_FEATHERS_STORE_KEY=$VITE_FEATHERS_STORE_KEY

ARG CACHE_DATE
RUN npx cross-env ts-node --swc scripts/check-db-exists.ts
Expand Down
5 changes: 1 addition & 4 deletions packages/client-core/src/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ export class API {
})
)

primus.on('reconnected', () => API.instance.client.reAuthenticate(true))

API.instance = new API()
API.instance.client = feathersClient as any
primus.on('reconnected', () => feathersClient.reAuthenticate(true))

Engine.instance.api = feathersClient
}
Expand Down
9 changes: 4 additions & 5 deletions packages/client-core/src/social/services/LocationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { Engine } from '@etherealengine/ecs/src/Engine'
import { defineState, getMutableState } from '@etherealengine/hyperflux'

import { locationBanPath, SceneID, UserID } from '@etherealengine/common/src/schema.type.module'
import { API } from '../../API'
import { NotificationService } from '../../common/services/NotificationService'

export const LocationSeed: LocationType = {
Expand Down Expand Up @@ -129,15 +128,15 @@ export const LocationService = {
getLocation: async (locationId: LocationID) => {
try {
LocationState.fetchingCurrentSocialLocation()
const location = await API.instance.client.service(locationPath).get(locationId)
const location = await Engine.instance.api.service(locationPath).get(locationId)
LocationState.socialLocationRetrieved(location)
} catch (err) {
NotificationService.dispatchNotify(err.message, { variant: 'error' })
}
},
getLocationByName: async (locationName: string) => {
LocationState.fetchingCurrentSocialLocation()
const locationResult = (await API.instance.client.service(locationPath).find({
const locationResult = (await Engine.instance.api.service(locationPath).find({
query: {
slugifiedName: locationName
}
Expand All @@ -155,7 +154,7 @@ export const LocationService = {
}
},
getLobby: async () => {
const lobbyResult = (await API.instance.client.service(locationPath).find({
const lobbyResult = (await Engine.instance.api.service(locationPath).find({
query: {
isLobby: true,
$limit: 1
Expand All @@ -170,7 +169,7 @@ export const LocationService = {
},
banUserFromLocation: async (userId: UserID, locationId: LocationID) => {
try {
await API.instance.client.service(locationBanPath).create({
await Engine.instance.api.service(locationBanPath).create({
userId: userId,
locationId: locationId
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import TextField from '@etherealengine/ui/src/primitives/mui/TextField'
import Typography from '@etherealengine/ui/src/primitives/mui/Typography'

import { SceneID } from '@etherealengine/common/src/schema.type.module'
import { API } from '../../../../API'
import { Engine } from '@etherealengine/ecs/src/Engine'
import { LocationSeed } from '../../../../social/services/LocationService'
import styles from '../index.module.scss'

Expand Down Expand Up @@ -69,7 +69,7 @@ const LocationMenu = (props: Props) => {
}, [])

const fetchLocations = (page: number, rows: number, search?: string) => {
API.instance.client
Engine.instance.api
.service(locationPath)
.find({
query: {
Expand Down
Loading