From d7213e03dae65924ca3731cd9824ba3e68ee620a Mon Sep 17 00:00:00 2001 From: eccentric Date: Mon, 6 Nov 2023 22:41:52 +0000 Subject: [PATCH] Fix Profile0 name; Start autoamtic daily storefront! --- person/fortnite.go | 1 + person/person.go | 12 +++++++----- person/snapshot.go | 10 ++++++---- store/store.go | 3 +++ 4 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 store/store.go diff --git a/person/fortnite.go b/person/fortnite.go index f440238..4e7a3e9 100644 --- a/person/fortnite.go +++ b/person/fortnite.go @@ -14,6 +14,7 @@ func NewFortnitePerson(displayName string, key string) { person.AthenaProfile.Items.AddItem(NewItem("AthenaGlider:DefaultGlider", 1)) person.AthenaProfile.Items.AddItem(NewItem("AthenaDance:EID_DanceMoves", 1)) person.CommonCoreProfile.Items.AddItem(NewItem("Currency:MtxPurchased", 0)) + person.Profile0Profile.Items.AddItem(NewItem("Currency:MtxPurchased", 0)) // for season 2 and bellow person.AthenaProfile.Attributes.AddAttribute(NewAttribute("mfa_reward_claimed", true)) person.AthenaProfile.Attributes.AddAttribute(NewAttribute("rested_xp_overflow", 0)) diff --git a/person/person.go b/person/person.go index e19c771..4103909 100644 --- a/person/person.go +++ b/person/person.go @@ -14,7 +14,7 @@ type Person struct { AthenaProfile *Profile CommonCoreProfile *Profile CommonPublicProfile *Profile - Profile0 *Profile + Profile0Profile *Profile } type Option struct { @@ -30,7 +30,7 @@ func NewPerson() *Person { AthenaProfile: NewProfile("athena"), CommonCoreProfile: NewProfile("common_core"), CommonPublicProfile: NewProfile("common_public"), - Profile0: NewProfile("profile0"), + Profile0Profile: NewProfile("profile0"), } } @@ -105,7 +105,7 @@ func findHelper(databasePerson *storage.DB_Person) *Person { AthenaProfile: athenaProfile, CommonCoreProfile: commonCoreProfile, CommonPublicProfile: commonPublicProfile, - Profile0: profile0, + Profile0Profile: profile0, } cache.Store(person.ID, &CacheEntry{ @@ -148,7 +148,7 @@ func (p *Person) GetProfileFromType(profileType string) *Profile { case "common_public": return p.CommonPublicProfile case "profile0": - return p.Profile0 + return p.Profile0Profile } return nil @@ -171,7 +171,7 @@ func (p *Person) ToDatabase() *storage.DB_Person { "common_core": p.CommonCoreProfile, "athena": p.AthenaProfile, "common_public": p.CommonPublicProfile, - "profile0": p.Profile0, + "profile0": p.Profile0Profile, } for profileType, profile := range profilesToConvert { @@ -231,5 +231,7 @@ func (p *Person) Snapshot() *PersonSnapshot { DisplayName: p.DisplayName, AthenaProfile: *p.AthenaProfile.Snapshot(), CommonCoreProfile: *p.CommonCoreProfile.Snapshot(), + CommonPublicProfile: *p.CommonPublicProfile.Snapshot(), + Profile0Profile: *p.Profile0Profile.Snapshot(), } } \ No newline at end of file diff --git a/person/snapshot.go b/person/snapshot.go index 5538c17..67387d5 100644 --- a/person/snapshot.go +++ b/person/snapshot.go @@ -1,10 +1,12 @@ package person type PersonSnapshot struct { - ID string - DisplayName string - AthenaProfile ProfileSnapshot - CommonCoreProfile ProfileSnapshot + ID string + DisplayName string + AthenaProfile ProfileSnapshot + CommonCoreProfile ProfileSnapshot + CommonPublicProfile ProfileSnapshot + Profile0Profile ProfileSnapshot } type ProfileSnapshot struct { diff --git a/store/store.go b/store/store.go new file mode 100644 index 0000000..2a73001 --- /dev/null +++ b/store/store.go @@ -0,0 +1,3 @@ +package store + +type Storefront interface{} \ No newline at end of file