eod commit

This commit is contained in:
2025-12-01 22:30:36 +01:00
parent 2372da942a
commit 8f7db6256b
9 changed files with 190 additions and 84 deletions

View File

@@ -2,6 +2,7 @@ package ws
import (
"encoding/json"
"homestead/homestead_gateway/util/cache"
"net/http"
"time"
@@ -46,7 +47,7 @@ func (wsg *WebsocketGateway) handlePush(w http.ResponseWriter, r *http.Request)
return
}
meta := connectionMetaData{connectionType: handshake.Type}
meta := cache.ConnectionMetaData{ConnectionType: handshake.Type}
switch handshake.Type {
case "mod":
@@ -58,7 +59,7 @@ func (wsg *WebsocketGateway) handlePush(w http.ResponseWriter, r *http.Request)
return
}
meta.id = mhs.ServerID
meta.ID = mhs.ServerID
if err = wsg.sendWebsocketResponse(conn, GatewayAck{Status: "connected", Type: "mod"}); err != nil {
return
@@ -78,7 +79,7 @@ func (wsg *WebsocketGateway) handlePush(w http.ResponseWriter, r *http.Request)
return
}
meta.id = bhs.BotID
meta.ID = bhs.BotID
if err = wsg.sendWebsocketResponse(conn, GatewayAck{Status: "connected", Type: "bot"}); err != nil {
return