mirror of
https://github.com/Vale54321/schafkopf-bot.git
synced 2025-12-18 20:49:38 +01:00
Message types and server2 (#46)
* fixed building issue * fixed building issue
This commit is contained in:
committed by
GitHub
parent
a0a1cfaa4a
commit
2cd8359518
@@ -1,21 +1,13 @@
|
||||
import {MessageType} from "../BackendMessage.ts";
|
||||
|
||||
interface JsonMessage {
|
||||
origin: string;
|
||||
message: any; // Adjust 'any' type as per your expected message structure
|
||||
}
|
||||
|
||||
export class BackendConnection {
|
||||
|
||||
|
||||
private readonly webSocket: WebSocket;
|
||||
private messageListeners: ((message: string) => void)[] = [];
|
||||
private backendUri: string;
|
||||
|
||||
|
||||
constructor(backendUri: string) {
|
||||
this.backendUri = backendUri;
|
||||
|
||||
this.webSocket = new WebSocket(backendUri);
|
||||
|
||||
// Registering event listener for message reception
|
||||
|
||||
Reference in New Issue
Block a user