From 04778cfb4dcf8543479c11db381092ccd237b7f8 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 7 Nov 2023 11:47:01 +0300 Subject: feat: error check on 0 portal 0 tick record (#133) --- backend/handlers/record.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'backend/handlers') diff --git a/backend/handlers/record.go b/backend/handlers/record.go index 697cd40..5dff085 100644 --- a/backend/handlers/record.go +++ b/backend/handlers/record.go @@ -134,6 +134,12 @@ func CreateRecordWithDemo(c *gin.Context) { c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) return } + if hostDemoScoreCount == 0 && hostDemoScoreTime == 0 { + deleteFile(srv, file.Id) + CreateLog(user.(models.User).SteamID, LogTypeRecord, LogDescriptionCreateRecordProcessDemoFail, err.Error()) + c.JSON(http.StatusOK, models.ErrorResponse("Processing demo went wrong. Please contact a web admin and provide the demo in question.")) + return + } if i == 0 { hostDemoFileID = file.Id hostDemoUUID = uuid -- cgit v1.2.3