mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-01-23 10:35:44 +00:00
Fix roomID correct
This commit is contained in:
parent
7dbe61c328
commit
e2d2436ceb
2 changed files with 3 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
2
web/js/network/socket.js
vendored
2
web/js/network/socket.js
vendored
|
|
@ -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()}`);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue