Skip to content

Commit 00c369e

Browse files
committed
Add check so that you can't join lobby that doesn't exist.
1 parent 0dc0b43 commit 00c369e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ebiten-game/game/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,10 @@ func (g *game) startClient() {
410410
if err != nil {
411411
panic(err)
412412
}
413+
if response.StatusCode != http.StatusOK {
414+
g.writeLog("Failed to join lobby, probably doesn't exist.\n")
415+
return
416+
}
413417
var pData playerData
414418
err = json.NewDecoder(response.Body).Decode(&pData)
415419
if err != nil {

0 commit comments

Comments
 (0)