aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/game
diff options
context:
space:
mode:
Diffstat (limited to 'backend/game')
-rw-r--r--backend/game/http.go4
-rw-r--r--backend/game/hub.go6
2 files changed, 5 insertions, 5 deletions
diff --git a/backend/game/http.go b/backend/game/http.go
index 18f6cda..f9036c5 100644
--- a/backend/game/http.go
+++ b/backend/game/http.go
@@ -27,7 +27,7 @@ func (h *sockHandler) HandleSockGolfPlay(c echo.Context) error {
}
// TODO: check user permission
- gameID, err := strconv.Atoi(c.Param("gameId"))
+ gameID, err := strconv.Atoi(c.Param("gameID"))
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, "Invalid game id")
}
@@ -48,7 +48,7 @@ func (h *sockHandler) HandleSockGolfWatch(c echo.Context) error {
return echo.NewHTTPError(http.StatusForbidden, "Permission denied")
}
- gameID, err := strconv.Atoi(c.Param("gameId"))
+ gameID, err := strconv.Atoi(c.Param("gameID"))
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, "Invalid game id")
}
diff --git a/backend/game/hub.go b/backend/game/hub.go
index e6981e8..c73009b 100644
--- a/backend/game/hub.go
+++ b/backend/game/hub.go
@@ -156,14 +156,14 @@ func (hub *gameHub) run() {
watcher.s2cMessages <- &watcherMessageS2CCode{
Type: watcherMessageTypeS2CCode,
Data: watcherMessageS2CCodePayload{
- PlayerId: message.client.playerID,
+ PlayerID: message.client.playerID,
Code: code,
},
}
watcher.s2cMessages <- &watcherMessageS2CExecResult{
Type: watcherMessageTypeS2CExecResult,
Data: watcherMessageS2CExecResultPayload{
- PlayerId: message.client.playerID,
+ PlayerID: message.client.playerID,
Score: nullable.NewNullableWithValue(score),
Stdout: "",
Stderr: "",
@@ -209,7 +209,7 @@ func (hub *gameHub) startGame() error {
Type: playerMessageTypeS2CPrepare,
Data: playerMessageS2CPreparePayload{
Problem: api.Problem{
- ProblemId: 1,
+ ProblemID: 1,
Title: "the answer",
Description: "print 42",
},