This commit is contained in:
Chris Wanstrath 2025-10-02 13:06:30 -07:00
parent 30b76c5ff6
commit c381b90f39
2 changed files with 2 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import { send } from "./websocket"
import { setState } from "./state" import { setState } from "./state"
export async function dispatchMessage(ws: any, msg: Message) { export async function dispatchMessage(ws: any, msg: Message) {
console.log("<- receive", msg)
switch (msg.type) { switch (msg.type) {
case "input": case "input":
await inputMessage(ws, msg); break await inputMessage(ws, msg); break

View File

@ -6,6 +6,7 @@ import type { Message } from "./shared/types"
const wsConnections: any[] = [] const wsConnections: any[] = []
export function send(ws: any, msg: Message) { export function send(ws: any, msg: Message) {
console.log("-> send", msg)
ws.send(JSON.stringify(msg)) ws.send(JSON.stringify(msg))
} }