Add system data integrity check

pull/1/head
Flashfyre 2024-02-14 17:12:10 -05:00
parent 448eeeee4a
commit 9e38ccccbc
1 changed files with 9 additions and 4 deletions

View File

@ -120,6 +120,11 @@ func (s *Server) HandleSavedataUpdate(w http.ResponseWriter, r *http.Request) {
return
}
if system.TrainerId == 0 && system.SecretId == 0 {
http.Error(w, "invalid system data", http.StatusInternalServerError)
return
}
var gobBuffer bytes.Buffer
err = gob.NewEncoder(&gobBuffer).Encode(system)
if err != nil {