edited stuff (#50)

This commit is contained in:
Valentin Heiserer
2024-04-23 23:27:01 +02:00
committed by GitHub
parent b8b89ee696
commit 2e5a42b6d3
8 changed files with 62 additions and 47 deletions

View File

@@ -29,12 +29,6 @@ function joinGame(): void {
}
function sendCard(cardInput: Card): void {
const index = botCards.value!.findIndex(card => card === cardInput);
// If card exists in the array, remove it
if (index !== -1) {
botCards.value!.splice(index, 1);
}
backendConnection.sendMessage(MessageType.PLAYER_CARD, {card: cardInput});
}

View File

@@ -6,7 +6,7 @@ import {BackendMessage, MessageType} from "../BackendMessage.ts";
const backendConnection = scg("BackendConnection");
const serverAddress = ref("http://10.6.9.57:8085/")
const serverAddress = ref("10.6.9.57:8085")
const isConnected = ref<boolean>(false);
const isPingInProgress = ref<boolean>(false);
const secondsRemaining = ref<number>(10);
@@ -30,7 +30,7 @@ async function checkConnection(): Promise<void> {
}
try {
// Try to fetch a resource from the internet
await fetch(serverAddress.value + "health", {mode: "no-cors"})
await fetch("http://" + serverAddress.value + "/health", {mode: "no-cors"})
// If successful, set isConnected to true
isConnected.value = true;
} catch (error) {