add skinid to customdata fields

This commit is contained in:
olebeck 2023-03-11 16:05:26 +01:00
parent b73ef84c1f
commit 8b763cde79
3 changed files with 20 additions and 1 deletions

View File

@ -248,6 +248,10 @@ func (w *WorldState) Reset() {
w.chunks = make(map[protocol.ChunkPos]*chunk.Chunk)
w.WorldName = fmt.Sprintf("world-%d", w.worldCounter)
w.mapUI.Reset()
w.gui.Message(utils.SavingWorldName, utils.SavingWorldPayload{
Saving: false,
})
}
// SaveAndReset writes the world to a folder, resets all the chunks
@ -256,6 +260,11 @@ func (w *WorldState) SaveAndReset() {
w.Reset()
return
}
w.gui.Message(utils.SavingWorldName, utils.SavingWorldPayload{
Saving: true,
})
logrus.Infof(locale.Loc("saving_world", locale.Strmap{"Name": w.WorldName, "Count": len(w.chunks)}))
// open world
@ -477,7 +486,7 @@ func (w *WorldState) SaveAndReset() {
fmt.Println(err)
}
logrus.Info(locale.Loc("saved", locale.Strmap{"Name": filename}))
// os.RemoveAll(folder)
os.RemoveAll(folder)
w.Reset()
}

View File

@ -40,3 +40,9 @@ var UpdateMapName = "update_map"
type UpdateMapPayload struct {
ChunkCount int
}
var SavingWorldName = "saving_world"
type SavingWorldPayload struct {
Saving bool
}

View File

@ -93,11 +93,13 @@ type CustomClientData struct {
CapeFilename string
SkinFilename string
SkinGeometryFilename string
SkinID string
PlayFabID string
PersonaSkin bool
PremiumSkin bool
TrustedSkin bool
ArmSize string
SkinColour string
// misc
IsEditorMode bool
@ -117,11 +119,13 @@ func (p *ProxyContext) LoadCustomUserData(path string) error {
}
p.CustomClientData = &login.ClientData{
SkinID: customData.SkinID,
PlayFabID: customData.PlayFabID,
PersonaSkin: customData.PersonaSkin,
PremiumSkin: customData.PremiumSkin,
TrustedSkin: customData.TrustedSkin,
ArmSize: customData.ArmSize,
SkinColour: customData.SkinColour,
}
if customData.SkinFilename != "" {