Fix minor issues with session data handling

This commit is contained in:
Flashfyre committed 2023-12-31 17:39:11 -05:00
1 parent c1098bb415
commit b64007a5f2
3 files changed
+9 -3

No files matched your search

+1
View File
@@ -1,2 +1,3 @@
pokerogue-server.exe
userdata/*
+8 -2
View File
@@ -1,6 +1,9 @@
package api
import "net/http"
import (
"encoding/gob"
"net/http"
)
type Server struct {
Debug bool
@@ -11,13 +14,16 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Headers", "*")
w.Header().Set("Access-Control-Allow-Methods", "*")
w.Header().Set("Access-Control-Allow-Origin", "*")
if r.Method == "OPTIONS" {
w.WriteHeader(http.StatusOK)
return
}
}
gob.Register([]interface{}{})
gob.Register(map[string]interface{}{})
switch r.URL.Path {
case "/account/info":
s.HandleAccountInfo(w, r)
-1
View File
@@ -46,7 +46,6 @@ type SessionSaveData struct {
GameMode GameMode `json:"gameMode"`
Party []PokemonData `json:"party"`
EnemyParty []PokemonData `json:"enemyParty"`
EnemyField []PokemonData `json:"enemyField"`
Modifiers []PersistentModifierData `json:"modifiers"`
EnemyModifiers []PersistentModifierData `json:"enemyModifiers"`
Arena ArenaData `json:"arena"`