aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


tools/data/export_gamedata/main.go (1186B)


      1 package main
      2 
      3 import (
      4 	"ao/server/gamedata"
      5 	"encoding/json"
      6 	"log"
      7 	"os"
      8 )
      9 
     10 func main() {
     11 	// Expose loaded definitions and provenance to extraction and audit scripts.
     12 	if err := json.NewEncoder(os.Stdout).Encode(struct {
     13 		NPCs               gamedata.NPCData
     14 		NPCNames           gamedata.NPCNameData
     15 		PopulationSources  []*gamedata.NPCPopulationSource
     16 		PopulationEvidence gamedata.NPCExtractionEvidence
     17 		Monsters           []gamedata.Monster
     18 		Items              gamedata.ItemCatalog
     19 		ItemEvidence       gamedata.ItemExtractionEvidence
     20 		MapCoordinates     gamedata.MapCoordinateData
     21 		TerrainEvidence    gamedata.TerrainExtractionEvidence
     22 		Playfields         map[uint32]gamedata.Playfield
     23 	}{
     24 		NPCs:               gamedata.NPCs,
     25 		NPCNames:           gamedata.NPCNames,
     26 		PopulationSources:  gamedata.PopulationSources,
     27 		PopulationEvidence: gamedata.PopulationEvidence,
     28 		Monsters:           gamedata.Monsters,
     29 		Items:              gamedata.Items,
     30 		ItemEvidence:       gamedata.Items.Evidence,
     31 		MapCoordinates:     gamedata.MapCoordinates,
     32 		TerrainEvidence:    gamedata.TerrainEvidence,
     33 		Playfields:         gamedata.Playfields,
     34 	}); err != nil {
     35 		log.Fatal(err)
     36 	}
     37 }