1
0
forked from noxious/client

Updated Dockerfile, renamed config key

This commit is contained in:
Dennis Postma 2025-02-07 01:14:57 +01:00
parent 6a52546a08
commit 6ba4c1b843
7 changed files with 12 additions and 12 deletions

View File

@ -1,5 +1,5 @@
VITE_NAME=Noxious
VITE_DEVELOPMENT=true
VITE_ENVIRONMENT=development
VITE_SERVER_ENDPOINT=http://localhost:4000
VITE_TILE_SIZE_WIDTH=64
VITE_TILE_SIZE_HEIGHT=32

View File

@ -9,17 +9,17 @@ COPY . .
ARG VITE_NAME=${VITE_NAME}
ENV VITE_NAME=${VITE_NAME}
ARG VITE_DEVELOPMENT=${VITE_DEVELOPMENT}
ENV VITE_DEVELOPMENT=${VITE_DEVELOPMENT}
ARG VITE_ENVIRONMENT=${VITE_ENVIRONMENT}
ENV VITE_ENVIRONMENT=${VITE_ENVIRONMENT}
ARG VITE_SERVER_ENDPOINT=${VITE_SERVER_ENDPOINT}
ENV VITE_SERVER_ENDPOINT=${VITE_SERVER_ENDPOINT}
ARG VITE_TILE_SIZE_X=${VITE_TILE_SIZE_X}
ENV VITE_TILE_SIZE_X=${VITE_TILE_SIZE_X}
ARG VITE_TILE_SIZE_WIDTH=${VITE_TILE_SIZE_WIDTH}
ENV VITE_TILE_SIZE_WIDTH=${VITE_TILE_SIZE_WIDTH}
ARG VITE_TILE_SIZE_Y=${VITE_TILE_SIZE_Y}
ENV VITE_TILE_SIZE_Y=${VITE_TILE_SIZE_Y}
ARG VITE_TILE_SIZE_HEIGHT=${VITE_TILE_SIZE_HEIGHT}
ENV VITE_TILE_SIZE_HEIGHT=${VITE_TILE_SIZE_HEIGHT}
# Build the application
RUN npm run build-ntc

View File

@ -1,6 +1,6 @@
export default {
name: import.meta.env.VITE_NAME,
development: import.meta.env.VITE_DEVELOPMENT === 'true',
environment: import.meta.env.VITE_ENVIRONMENT,
server_endpoint: import.meta.env.VITE_SERVER_ENDPOINT,
tile_size: {
width: Number(import.meta.env.VITE_TILE_SIZE_WIDTH),

View File

@ -49,7 +49,7 @@ const handleFileUpload = (e: Event) => {
if (!files) return
gameStore.connection?.emit('gm:mapObject:upload', files, (response: boolean) => {
if (!response) {
if (config.development) console.error('Failed to upload object')
if (config.environment === 'development') console.error('Failed to upload map object')
return
}

View File

@ -42,7 +42,7 @@ const elementToScroll = ref()
function newButtonClickHandler() {
gameStore.connection?.emit('gm:sprite:create', {}, (response: boolean) => {
if (!response) {
if (config.development) console.error('Failed to create new sprite')
if (config.environment === 'development') console.error('Failed to create new sprite')
return
}

View File

@ -49,7 +49,7 @@ const handleFileUpload = (e: Event) => {
if (!files) return
gameStore.connection?.emit('gm:tile:upload', files, (response: boolean) => {
if (!response) {
if (config.development) console.error('Failed to upload tile')
if (config.environment === 'development') console.error('Failed to upload tile')
return
}

View File

@ -74,7 +74,7 @@ export const useGameStore = defineStore('game', {
},
initConnection() {
this.connection = io(config.server_endpoint, {
secure: !config.development,
secure: !config.environment.includes('development'),
withCredentials: true,
transports: ['websocket'],
reconnectionAttempts: 5