Fix roomID correct

This commit is contained in:
giongto35 2019-12-12 02:30:14 +08:00
parent 7dbe61c328
commit e2d2436ceb
2 changed files with 3 additions and 1 deletions

View file

@ -140,6 +140,8 @@ func (o *Server) WS(w http.ResponseWriter, r *http.Request) {
// if there is no zone param, we can pic
userZone := r.URL.Query().Get("zone")
log.Printf("Get Room %s Zone %s From URL %v", roomID, userZone, r.URL)
if roomID != "" {
log.Printf("Detected roomID %v from URL", roomID)
if workerID, ok := o.roomToWorker[roomID]; ok {

View file

@ -12,7 +12,7 @@ const socket = (() => {
let curPacketId = '';
const init = (roomId, zone) => {
const paramString = new URLSearchParams({roomId: roomId, zone: zone})
const paramString = new URLSearchParams({room_id: roomId, zone: zone})
conn = new WebSocket(`ws://${location.host}/ws?${paramString.toString()}`);