From f1f2a9a325d9b7c046fe61029fdcaacac386b42e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Fern=C3=A1ndez=20Aldana?= Date: Thu, 19 Dec 2024 18:41:58 +0100 Subject: [PATCH] fix: previous change of ordered map library caused an error to load signed assets json --- server/internal/models/resources.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/internal/models/resources.go b/server/internal/models/resources.go index c081570..bf94471 100644 --- a/server/internal/models/resources.go +++ b/server/internal/models/resources.go @@ -77,11 +77,10 @@ func (r *MainResources) initializeResponses(gameId string) { continue } if r.keyedFilenames.ContainsOne(name) { - var result = orderedmap.NewOrderedMap[string, any]() - err = json.Unmarshal(data, result) - if err == nil { - rawSignature, _ := result.Get("dataSignature") - serverSignature := rawSignature.(string) + re := regexp.MustCompile(`"dataSignature"\s*:\s*"(.*?)"`) + matches := re.FindStringSubmatch(string(data)) + if len(matches) == 1 { + serverSignature := matches[1] r.KeyedFiles[name] = data r.nameToSignature[name] = serverSignature }