1
0
forked from noxious/client

Replaced all event names with numbers for less bandwidth usage

This commit is contained in:
2025-02-11 23:13:15 +01:00
parent 5f2c7a09b1
commit dd1cc795de
26 changed files with 191 additions and 197 deletions

View File

@ -10,6 +10,7 @@
</template>
<script setup lang="ts">
import { SocketEvent } from '@/application/enums';
import Modal from '@/components/utilities/Modal.vue'
import { useGameStore } from '@/stores/gameStore'
import { onBeforeMount, onBeforeUnmount, onMounted, onUnmounted, watch } from 'vue'
@ -26,7 +27,7 @@ type Notification = {
}
function setupNotificationListener(connection: any) {
connection.on('notification', (data: Notification) => {
connection.on(SocketEvent.NOTIFICATION, (data: Notification) => {
gameStore.addNotification({
title: data.title,
message: data.message
@ -52,7 +53,7 @@ onMounted(() => {
onUnmounted(() => {
const connection = gameStore.connection
if (connection) {
connection.off('notification')
connection.off(SocketEvent.NOTIFICATION)
}
})
</script>