aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/game/hub.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-18 01:26:25 +0900
committernsfisis <nsfisis@gmail.com>2024-08-18 01:46:02 +0900
commita9b1520b81f272dc3b52fc8172fe0d0b04d576e4 (patch)
tree74f594f2a62f8dcf73e345fc8b10917f3e0fa665 /backend/game/hub.go
parent909ef91eb46334fa59602c02ab85afc209382e61 (diff)
downloadiosdc-japan-2024-albatross-a9b1520b81f272dc3b52fc8172fe0d0b04d576e4.tar.gz
iosdc-japan-2024-albatross-a9b1520b81f272dc3b52fc8172fe0d0b04d576e4.tar.zst
iosdc-japan-2024-albatross-a9b1520b81f272dc3b52fc8172fe0d0b04d576e4.zip
refactor(backend): rename func name for consistency
Diffstat (limited to 'backend/game/hub.go')
-rw-r--r--backend/game/hub.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/backend/game/hub.go b/backend/game/hub.go
index 7c06e05..9e1194b 100644
--- a/backend/game/hub.go
+++ b/backend/game/hub.go
@@ -138,7 +138,7 @@ func (hub *gameHub) run() {
}
}
-func (hub *gameHub) sendExecResultMessage(playerID int, testcaseID nullable.Nullable[int], status string, stdout string, stderr string) {
+func (hub *gameHub) sendExecResult(playerID int, testcaseID nullable.Nullable[int], status string, stdout string, stderr string) {
hub.sendToPlayer(playerID, &playerMessageS2CExecResult{
Type: playerMessageTypeS2CExecResult,
Data: playerMessageS2CExecResultPayload{
@@ -218,7 +218,7 @@ func (hub *gameHub) processTaskResults() {
case *taskqueue.TaskResultCompileSwiftToWasm:
err := hub.processTaskResultCompileSwiftToWasm(taskResult)
if err != nil {
- hub.sendExecResultMessage(
+ hub.sendExecResult(
taskResult.TaskPayload.UserID(),
nullable.NewNullNullable[int](),
err.Status,
@@ -234,7 +234,7 @@ func (hub *gameHub) processTaskResults() {
case *taskqueue.TaskResultCompileWasmToNativeExecutable:
err := hub.processTaskResultCompileWasmToNativeExecutable(taskResult)
if err != nil {
- hub.sendExecResultMessage(
+ hub.sendExecResult(
taskResult.TaskPayload.UserID(),
nullable.NewNullNullable[int](),
err.Status,
@@ -247,7 +247,7 @@ func (hub *gameHub) processTaskResults() {
nullable.NewNullNullable[int](),
)
} else {
- hub.sendExecResultMessage(
+ hub.sendExecResult(
taskResult.TaskPayload.UserID(),
nullable.NewNullNullable[int](),
"success",
@@ -270,7 +270,7 @@ func (hub *gameHub) processTaskResults() {
Stderr: "",
})
if err != nil {
- hub.sendExecResultMessage(
+ hub.sendExecResult(
taskResult.TaskPayload.UserID(),
nullable.NewNullableWithValue(int(taskResult.TaskPayload.TestcaseID)),
"internal_error",
@@ -286,7 +286,7 @@ func (hub *gameHub) processTaskResults() {
continue
}
if err1 != nil {
- hub.sendExecResultMessage(
+ hub.sendExecResult(
taskResult.TaskPayload.UserID(),
nullable.NewNullableWithValue(int(taskResult.TaskPayload.TestcaseID)),
aggregatedStatus,
@@ -294,7 +294,7 @@ func (hub *gameHub) processTaskResults() {
err1.Stderr,
)
} else {
- hub.sendExecResultMessage(
+ hub.sendExecResult(
taskResult.TaskPayload.UserID(),
nullable.NewNullableWithValue(int(taskResult.TaskPayload.TestcaseID)),
"success",