mirror of
https://github.com/Vale54321/schafkopf-bot.git
synced 2025-12-15 19:29:33 +01:00
edited stuff (#50)
This commit is contained in:
committed by
GitHub
parent
b8b89ee696
commit
2e5a42b6d3
@@ -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});
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user