giongto35 / cloud-game

Web-based Cloud Gaming service for Retro Game
https://www.youtube.com/watch?v=GUBrJGAxZZg
Apache License 2.0
2.32k stars 348 forks source link

Game not starting as expected. Tried in GCP (Debian and Ubuntu) servers #357

Closed sab-sv closed 2 years ago

sab-sv commented 2 years ago

I am working on a study project and going through multiple cloud-gaming open-source projects. While running this package in GCP (Debian and Ubuntu) the game is not starting. Instead, I get this error in the chrome console. Please find the chrome log below,

log.js?v=5:10 [input] keyboard has been initialized log.js?v=5:10 [input] joystick has been initialized log.js?v=5:10 [input] touch input has been initialized socket.js?v=4:35 [ws] connecting to ws://34.142.11.168:8000/ws?room_id=&zone= main.js:1 Uncaught ReferenceError: RUN_MODEIDLE is not defined at main.js:1 log.js?v=5:10 [ws] <- open connection log.js?v=5:10 [ws] -> setting ping interval to 2000ms log.js?v=5:10 [ping] <-> Object log.js?v=5:10 [rtcp] <- received stunturn from worker [{"urls":"stun:stun.l.google.com:19302"}] log.js?v=5:10 [rtcp] ice gathering log.js?v=5:10 [rtcp] <- iceConnectionState: checking log.js?v=5:10 [rtcp] user candidate: {"candidate":"candidate:2026329132 1 udp 2113937151 eff5477d-5d14-46b2-901a-06c8cf26e102.local 59686 typ host generation 0 ufrag goFB network-cost 999","sdpMid":"0","sdpMLineIndex":0} log.js?v=5:10 [rtcp] user candidate: {"candidate":"candidate:1594832 1 udp 2113939711 01739c43-6b9c-4403-9bf0-1dce7efc1680.local 59687 typ host generation 0 ufrag goFB network-cost 999","sdpMid":"0","sdpMLineIndex":0} log.js?v=5:10 [rtcp] user candidate: {"candidate":"candidate:842163049 1 udp 1677729535 37.228.233.207 34016 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag goFB network-cost 999","sdpMid":"0","sdpMLineIndex":0} log.js?v=5:10 [rtcp] ice gathering completed log.js?v=5:10 [rtcp] <- iceConnectionState: connected log.js?v=5:10 [rtcp] connected... localhost:9000/echo?=1638705412092:1 Failed to load resource: net::ERR_CONNECTION_REFUSED log.js?v=5:10 [control] game start controller.js?v=6:157 Uncaught TypeError: recording.isActive is not a function at startGame (controller.js?v=6:157) at Object.keyRelease (controller.js?v=6:332) at Object.onKeyRelease [as listener] (controller.js?v=6:217) at event.js?v=5:51 at Array.forEach () at Object.pub (event.js?v=5:50) at keyboard.js?v=5:114 at onKey (keyboard.js?v=5:99) at HTMLBodyElement. (keyboard.js?v=5:114) DevTools failed to load source map: Could not load content for chrome-extension://ebppbggemaebhjnimpgbklkpnokdbfle/common/browser-polyfill.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME

From my understanding, the game instructions are not being transferred to the cloud server at all. There are no log generated in the docker terminal after the below set of lines,

cloud-game-local | I1205 11:56:53.137270 10 webrtc.go:108] === StartClient === cloud-game-local | I1205 11:56:53.137891 10 webrtc.go:124] Add video track cloud-game-local | I1205 11:56:53.138486 10 webrtc.go:217] Created Offer cloud-game-local | I1205 11:56:53.138642 10 internalhandlers.go:61] Start peerconnection 270033ef-f24b-4c2c-bd3e-fafba07cd6fa cloud-game-local | I1205 11:56:53.138783 10 webrtc.go:178] OnIceCandidate: candidate:2878742611 1 udp 2130706431 127.0.0.1 8443 typ host cloud-game-local | I1205 11:56:53.138996 9 worker.go:62] Worker fc8f16cf-0edd-44b0-8e92-86296509fcf5] Received IceCandidate from worker -> relay to browser cloud-game-local | I1205 11:56:53.139109 9 browser.go:33] Browser 270033ef-f24b-4c2c-bd3e-fafba07cd6fa] Received SDP from worker -> sending back to browser cloud-game-local | I1205 11:56:53.140091 10 webrtc.go:178] OnIceCandidate: candidate:3177642692 1 udp 1694498815 34.142.11.168 39648 typ srflx raddr 0.0.0.0 rport 39648 cloud-game-local | I1205 11:56:53.140224 9 worker.go:62] Worker fc8f16cf-0edd-44b0-8e92-86296509fcf5] Received IceCandidate from worker -> relay to browser cloud-game-local | I1205 11:56:53.140249 9 worker.go:62] Worker fc8f16cf-0edd-44b0-8e92-86296509fcf5] Received IceCandidate from worker -> relay to browser cloud-game-local | I1205 11:56:53.287576 9 browser.go:33] Browser 270033ef-f24b-4c2c-bd3e-fafba07cd6fa] Received IceCandidate from browser -> relay to worker cloud-game-local | I1205 11:56:53.287603 9 browser.go:33] Browser 270033ef-f24b-4c2c-bd3e-fafba07cd6fa] Received browser answered SDP -> relay to worker cloud-game-local | I1205 11:56:53.287782 10 internalhandlers.go:74] Received answer SDP from browser cloud-game-local | I1205 11:56:53.287975 9 browser.go:33] Browser 270033ef-f24b-4c2c-bd3e-fafba07cd6fa] Received IceCandidate from browser -> relay to worker cloud-game-local | I1205 11:56:53.288135 10 internalhandlers.go:91] Received remote Ice Candidate from browser cloud-game-local | I1205 11:56:53.288182 10 webrtc.go:272] Decoded Ice: candidate:2026329132 1 udp 2113937151 eff5477d-5d14-46b2-901a-06c8cf26e102.local 59686 typ host generation 0 ufrag goFB network-cost 999 cloud-game-local | I1205 11:56:53.288204 10 webrtc.go:280] Add Ice Candidate: candidate:2026329132 1 udp 2113937151 eff5477d-5d14-46b2-901a-06c8cf26e102.local 59686 typ host generation 0 ufrag goFB network-cost 999 cloud-game-local | I1205 11:56:53.288223 10 internalhandlers.go:91] Received remote Ice Candidate from browser cloud-game-local | I1205 11:56:53.288295 10 webrtc.go:272] Decoded Ice: candidate:1594832 1 udp 2113939711 01739c43-6b9c-4403-9bf0-1dce7efc1680.local 59687 typ host generation 0 ufrag goFB network-cost 999 cloud-game-local | I1205 11:56:53.288317 10 webrtc.go:280] Add Ice Candidate: candidate:1594832 1 udp 2113939711 01739c43-6b9c-4403-9bf0-1dce7efc1680.local 59687 typ host generation 0 ufrag goFB network-cost 999 cloud-game-local | I1205 11:56:53.289180 10 webrtc.go:261] Set Remote Description cloud-game-local | I1205 11:56:53.289256 10 webrtc.go:162] ICE Connection State has changed: checking cloud-game-local | I1205 11:56:53.323051 9 browser.go:33] Browser 270033ef-f24b-4c2c-bd3e-fafba07cd6fa] Received IceCandidate from browser -> relay to worker cloud-game-local | I1205 11:56:53.323179 10 internalhandlers.go:91] Received remote Ice Candidate from browser cloud-game-local | I1205 11:56:53.323203 10 webrtc.go:272] Decoded Ice: candidate:842163049 1 udp 1677729535 37.228.233.207 34016 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag goFB network-cost 999 cloud-game-local | I1205 11:56:53.323235 10 webrtc.go:280] Add Ice Candidate: candidate:842163049 1 udp 1677729535 37.228.233.207 34016 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag goFB network-cost 999 cloud-game-local | I1205 11:56:54.102142 10 webrtc.go:162] ICE Connection State has changed: connected cloud-game-local | I1205 11:56:54.102176 10 webrtc.go:166] ConnectionStateConnected cloud-game-local | I1205 11:56:54.102181 10 webrtc.go:311] Start streaming cloud-game-local | I1205 11:56:54.764371 10 webrtc.go:146] Data channel 'game-input'-'824636959048' open.

I am using,

Distributor ID: Ubuntu Description: Ubuntu 18.04.6 LTS Release: 18.04 Codename: bionic Arch: x86_64

Please help me to solve this issue. Thanks in advance!

sergystepanov commented 2 years ago

@sab-sv, thank you for your report. The most likely cause of this is some stale browser cache. Could you try to clear client cache + site data? Please, refer to these instructions: cache, data.

sab-sv commented 2 years ago

Hi @sergystepanov thanks for your response. I have tried the workaround, and I am still facing the same issue. From the chrome developer console, I could see an exception. Please find the exception below,

Uncaught TypeError: recording.isActive is not a function at startGame (controller.js?v=6:157) at Object.keyRelease (controller.js?v=6:332) at Object.onKeyRelease [as listener] (controller.js?v=6:217) at event.js?v=5:51 at Array.forEach () at Object.pub (event.js?v=5:50) at keyboard.js?v=5:114 at onKey (keyboard.js?v=5:99) at HTMLBodyElement. (keyboard.js?v=5:114)

It says, 'recording.isActive is not a function' in 'controller.js line 157'. This exception occurs each time I try to select a game from the list.

sergystepanov commented 2 years ago

@sab-sv, sorry, my bad. Should be fixed now with the latest master push.

sab-sv commented 2 years ago

@sergystepanov it is working now, thanks for the fix and your time. Much appreciate it!