Skip to content

Commit

Permalink
serialize game version in manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
stelzo committed Nov 16, 2024
1 parent 0f13aa6 commit 37d8cb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 6 additions & 3 deletions ankabuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package ankabuffer

import (
"fmt"
"github.com/dofusdude/ankabuffer/AnkamaGames"
"strconv"

"github.com/dofusdude/ankabuffer/AnkamaGames"
)

type Chunk struct {
Expand Down Expand Up @@ -35,7 +36,8 @@ type Fragment struct {
}

type Manifest struct {
Fragments map[string]Fragment `json:"fragments"`
GameVersion string `json:"game_version"`
Fragments map[string]Fragment `json:"fragments"`
}

type iHashFile interface {
Expand All @@ -51,9 +53,10 @@ func getHash[T iHashFile](file T) string {
return hash
}

func ParseManifest(data []byte) *Manifest {
func ParseManifest(data []byte, gameVersion string) *Manifest {
flatbManifest := AnkamaGames.GetRootAsManifest(data, 0)
manifest := Manifest{}
manifest.GameVersion = gameVersion
manifest.Fragments = make(map[string]Fragment)

bundleLookup := make(map[string]Bundle)
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
github.com/google/flatbuffers v22.10.26+incompatible h1:z1QiaMyPu1x3Z6xf2u1dsLj1ZxicdGSeaLpCuIsQNZM=
github.com/google/flatbuffers v22.10.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/flatbuffers v23.5.26+incompatible h1:M9dgRyhJemaM4Sw8+66GHBu8ioaQmyPLg1b8VwK5WJg=
github.com/google/flatbuffers v23.5.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=

0 comments on commit 37d8cb2

Please sign in to comment.