diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..6eebc1e --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,10 @@ +{ + "permissions": { + "allow": [ + "Bash(go run:*)", + "Bash(grep:*)" + ], + "deny": [], + "ask": [] + } +} \ No newline at end of file diff --git a/defs/gen/main.go b/defs/gen/main.go index 56602a0..0babc23 100644 --- a/defs/gen/main.go +++ b/defs/gen/main.go @@ -443,8 +443,14 @@ func (p *{{.Name}}) Serialize(dest []byte) uint32 { {{- else if eq (baseType .Type) "types.EquipmentItem"}} binary.LittleEndian.PutUint16(dest[offset:], p.{{.GoName}}[i].Type) offset += 2 - binary.LittleEndian.PutUint32(dest[offset:], p.{{.GoName}}[i].Color.ToUint32()) - offset += 4 + dest[offset] = p.{{.GoName}}[i].Color.R + dest[offset+1] = p.{{.GoName}}[i].Color.G + dest[offset+2] = p.{{.GoName}}[i].Color.B + offset += 3 + dest[offset] = p.{{.GoName}}[i].Highlight.R + dest[offset+1] = p.{{.GoName}}[i].Highlight.G + dest[offset+2] = p.{{.GoName}}[i].Highlight.B + offset += 3 {{- end}} } {{- else}} @@ -462,8 +468,10 @@ func (p *{{.Name}}) Serialize(dest []byte) uint32 { binary.LittleEndian.PutUint16(dest[offset:], uint16(p.{{.GoName}})) offset += 2 {{- else if eq .Type "types.Color"}} - binary.LittleEndian.PutUint32(dest[offset:], p.{{.GoName}}.ToUint32()) - offset += 4 + dest[offset] = p.{{.GoName}}.R + dest[offset+1] = p.{{.GoName}}.G + dest[offset+2] = p.{{.GoName}}.B + offset += 3 {{- else if or (eq .Type "int32") (eq .Type "uint32")}} binary.LittleEndian.PutUint32(dest[offset:], uint32(p.{{.GoName}})) offset += 4 @@ -495,7 +503,7 @@ func (p *{{.Name}}) Size() uint32 { {{- end}} {{- else if .IsArray}} {{- if eq (baseType .Type) "types.EquipmentItem"}} - size += {{.Size}} * 6 + size += {{.Size}} * 8 {{- else if eq (sizeOf (baseType .Type)) 1}} size += {{.Size}} {{- else}} @@ -543,8 +551,10 @@ func (p *{{.Name}}) Size() uint32 { binary.LittleEndian.PutUint32(dest[offset:], math.Float32bits(elem.{{.GoName}})) offset += 4 {{- else if eq .Type "types.Color"}} - binary.LittleEndian.PutUint32(dest[offset:], elem.{{.GoName}}.ToUint32()) - offset += 4 + dest[offset] = elem.{{.GoName}}.R + dest[offset+1] = elem.{{.GoName}}.G + dest[offset+2] = elem.{{.GoName}}.B + offset += 3 {{- else if eq .Type "uint32"}} binary.LittleEndian.PutUint32(dest[offset:], elem.{{.GoName}}) offset += 4 @@ -627,8 +637,10 @@ func (p *{{.Name}}) Size() uint32 { binary.LittleEndian.PutUint32(dest[offset:], math.Float32bits(nestedElem.{{.GoName}})) offset += 4 {{- else if eq .Type "types.Color"}} - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.{{.GoName}}.ToUint32()) - offset += 4 + dest[offset] = nestedElem.{{.GoName}}.R + dest[offset+1] = nestedElem.{{.GoName}}.G + dest[offset+2] = nestedElem.{{.GoName}}.B + offset += 3 {{- else if eq .Type "uint32"}} binary.LittleEndian.PutUint32(dest[offset:], nestedElem.{{.GoName}}) offset += 4 @@ -700,12 +712,14 @@ func sizeOf(typeName string) int { return 1 case "int16", "uint16": return 2 - case "int32", "uint32", "float32", "types.Color": + case "types.Color": + return 3 // RGB: 3 bytes + case "int32", "uint32", "float32": return 4 case "int64", "uint64", "float64": return 8 case "types.EquipmentItem": - return 6 + return 8 // 2 bytes type + 3 bytes color + 3 bytes highlight default: return 0 } diff --git a/defs/generated/common.go b/defs/generated/common.go index a40329e..dd15995 100644 --- a/defs/generated/common.go +++ b/defs/generated/common.go @@ -1591,24 +1591,34 @@ func (p *CreateCharacterV562) Serialize(dest []byte) uint32 { offset += uint32(len(p.RaceFile)) // Write SkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor.R + dest[offset+1] = p.SkinColor.G + dest[offset+2] = p.SkinColor.B + offset += 3 // Write SkinColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor2.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor2.R + dest[offset+1] = p.SkinColor2.G + dest[offset+2] = p.SkinColor2.B + offset += 3 // Write EyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.EyeColor.ToUint32()) - offset += 4 + dest[offset] = p.EyeColor.R + dest[offset+1] = p.EyeColor.G + dest[offset+2] = p.EyeColor.B + offset += 3 // Write HairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor1.ToUint32()) - offset += 4 + dest[offset] = p.HairColor1.R + dest[offset+1] = p.HairColor1.G + dest[offset+2] = p.HairColor1.B + offset += 3 // Write HairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor2.ToUint32()) - offset += 4 + dest[offset] = p.HairColor2.R + dest[offset+1] = p.HairColor2.G + dest[offset+2] = p.HairColor2.B + offset += 3 // Write Unknown8 array for i := 0; i < 26; i++ { @@ -1623,12 +1633,16 @@ func (p *CreateCharacterV562) Serialize(dest []byte) uint32 { offset += uint32(len(p.HairFile)) // Write HairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeColor.R + dest[offset+1] = p.HairTypeColor.G + dest[offset+2] = p.HairTypeColor.B + offset += 3 // Write HairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeHighlightColor.R + dest[offset+1] = p.HairTypeHighlightColor.G + dest[offset+2] = p.HairTypeHighlightColor.B + offset += 3 // Write FaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.FaceFile))) @@ -1637,12 +1651,16 @@ func (p *CreateCharacterV562) Serialize(dest []byte) uint32 { offset += uint32(len(p.FaceFile)) // Write HairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceColor.R + dest[offset+1] = p.HairFaceColor.G + dest[offset+2] = p.HairFaceColor.B + offset += 3 // Write HairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceHighlightColor.R + dest[offset+1] = p.HairFaceHighlightColor.G + dest[offset+2] = p.HairFaceHighlightColor.B + offset += 3 // Write WingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.WingFile))) @@ -1651,12 +1669,16 @@ func (p *CreateCharacterV562) Serialize(dest []byte) uint32 { offset += uint32(len(p.WingFile)) // Write WingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor1.ToUint32()) - offset += 4 + dest[offset] = p.WingColor1.R + dest[offset+1] = p.WingColor1.G + dest[offset+2] = p.WingColor1.B + offset += 3 // Write WingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor2.ToUint32()) - offset += 4 + dest[offset] = p.WingColor2.R + dest[offset+1] = p.WingColor2.G + dest[offset+2] = p.WingColor2.B + offset += 3 // Write ChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.ChestFile))) @@ -1665,12 +1687,16 @@ func (p *CreateCharacterV562) Serialize(dest []byte) uint32 { offset += uint32(len(p.ChestFile)) // Write ShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.ShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.ShirtColor.R + dest[offset+1] = p.ShirtColor.G + dest[offset+2] = p.ShirtColor.B + offset += 3 // Write UnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownChestColor.R + dest[offset+1] = p.UnknownChestColor.G + dest[offset+2] = p.UnknownChestColor.B + offset += 3 // Write LegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.LegsFile))) @@ -1679,16 +1705,22 @@ func (p *CreateCharacterV562) Serialize(dest []byte) uint32 { offset += uint32(len(p.LegsFile)) // Write PantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.PantsColor.ToUint32()) - offset += 4 + dest[offset] = p.PantsColor.R + dest[offset+1] = p.PantsColor.G + dest[offset+2] = p.PantsColor.B + offset += 3 // Write UnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownLegsColor.R + dest[offset+1] = p.UnknownLegsColor.G + dest[offset+2] = p.UnknownLegsColor.B + offset += 3 // Write Unknown9 - binary.LittleEndian.PutUint32(dest[offset:], p.Unknown9.ToUint32()) - offset += 4 + dest[offset] = p.Unknown9.R + dest[offset+1] = p.Unknown9.G + dest[offset+2] = p.Unknown9.B + offset += 3 // Write Eyes2 array for i := 0; i < 3; i++ { @@ -1751,24 +1783,34 @@ func (p *CreateCharacterV562) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaRaceFile)) // Write SogaSkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaSkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaSkinColor.R + dest[offset+1] = p.SogaSkinColor.G + dest[offset+2] = p.SogaSkinColor.B + offset += 3 // Write SogaEyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaEyeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaEyeColor.R + dest[offset+1] = p.SogaEyeColor.G + dest[offset+2] = p.SogaEyeColor.B + offset += 3 // Write SogaHairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor1.R + dest[offset+1] = p.SogaHairColor1.G + dest[offset+2] = p.SogaHairColor1.B + offset += 3 // Write SogaHairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor2.R + dest[offset+1] = p.SogaHairColor2.G + dest[offset+2] = p.SogaHairColor2.B + offset += 3 // Write SogaHairHighlight - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairHighlight.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairHighlight.R + dest[offset+1] = p.SogaHairHighlight.G + dest[offset+2] = p.SogaHairHighlight.B + offset += 3 // Write SogaUnknown11 array for i := 0; i < 26; i++ { @@ -1783,12 +1825,16 @@ func (p *CreateCharacterV562) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaHairFile)) // Write SogaHairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeColor.R + dest[offset+1] = p.SogaHairTypeColor.G + dest[offset+2] = p.SogaHairTypeColor.B + offset += 3 // Write SogaHairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeHighlightColor.R + dest[offset+1] = p.SogaHairTypeHighlightColor.G + dest[offset+2] = p.SogaHairTypeHighlightColor.B + offset += 3 // Write SogaFaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaFaceFile))) @@ -1797,12 +1843,16 @@ func (p *CreateCharacterV562) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaFaceFile)) // Write SogaHairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceColor.R + dest[offset+1] = p.SogaHairFaceColor.G + dest[offset+2] = p.SogaHairFaceColor.B + offset += 3 // Write SogaHairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceHighlightColor.R + dest[offset+1] = p.SogaHairFaceHighlightColor.G + dest[offset+2] = p.SogaHairFaceHighlightColor.B + offset += 3 // Write SogaWingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaWingFile))) @@ -1811,12 +1861,16 @@ func (p *CreateCharacterV562) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaWingFile)) // Write SogaWingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor1.R + dest[offset+1] = p.SogaWingColor1.G + dest[offset+2] = p.SogaWingColor1.B + offset += 3 // Write SogaWingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor2.R + dest[offset+1] = p.SogaWingColor2.G + dest[offset+2] = p.SogaWingColor2.B + offset += 3 // Write SogaChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaChestFile))) @@ -1825,12 +1879,16 @@ func (p *CreateCharacterV562) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaChestFile)) // Write SogaShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaShirtColor.R + dest[offset+1] = p.SogaShirtColor.G + dest[offset+2] = p.SogaShirtColor.B + offset += 3 // Write SogaUnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownChestColor.R + dest[offset+1] = p.SogaUnknownChestColor.G + dest[offset+2] = p.SogaUnknownChestColor.B + offset += 3 // Write SogaLegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaLegsFile))) @@ -1839,16 +1897,22 @@ func (p *CreateCharacterV562) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaLegsFile)) // Write SogaPantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaPantsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaPantsColor.R + dest[offset+1] = p.SogaPantsColor.G + dest[offset+2] = p.SogaPantsColor.B + offset += 3 // Write SogaUnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownLegsColor.R + dest[offset+1] = p.SogaUnknownLegsColor.G + dest[offset+2] = p.SogaUnknownLegsColor.B + offset += 3 // Write SogaUnknown12 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknown12.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknown12.R + dest[offset+1] = p.SogaUnknown12.G + dest[offset+2] = p.SogaUnknown12.B + offset += 3 // Write SogaEyes2 array for i := 0; i < 3; i++ { @@ -1935,49 +1999,49 @@ func (p *CreateCharacterV562) Size() uint32 { size += 2 + uint32(len(p.RaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 26 size += 2 + uint32(len(p.HairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.FaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.WingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.ChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.LegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 @@ -2001,49 +2065,49 @@ func (p *CreateCharacterV562) Size() uint32 { size += 2 + uint32(len(p.SogaRaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 26 size += 2 + uint32(len(p.SogaHairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaFaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaWingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaLegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 @@ -2215,28 +2279,40 @@ func (p *CreateCharacterV869) Serialize(dest []byte) uint32 { offset += uint32(len(p.RaceFile)) // Write SkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor.R + dest[offset+1] = p.SkinColor.G + dest[offset+2] = p.SkinColor.B + offset += 3 // Write SkinColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor2.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor2.R + dest[offset+1] = p.SkinColor2.G + dest[offset+2] = p.SkinColor2.B + offset += 3 // Write EyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.EyeColor.ToUint32()) - offset += 4 + dest[offset] = p.EyeColor.R + dest[offset+1] = p.EyeColor.G + dest[offset+2] = p.EyeColor.B + offset += 3 // Write HairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor1.ToUint32()) - offset += 4 + dest[offset] = p.HairColor1.R + dest[offset+1] = p.HairColor1.G + dest[offset+2] = p.HairColor1.B + offset += 3 // Write HairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor2.ToUint32()) - offset += 4 + dest[offset] = p.HairColor2.R + dest[offset+1] = p.HairColor2.G + dest[offset+2] = p.HairColor2.B + offset += 3 // Write HairHighlight - binary.LittleEndian.PutUint32(dest[offset:], p.HairHighlight.ToUint32()) - offset += 4 + dest[offset] = p.HairHighlight.R + dest[offset+1] = p.HairHighlight.G + dest[offset+2] = p.HairHighlight.B + offset += 3 // Write Unknown8 array for i := 0; i < 26; i++ { @@ -2251,12 +2327,16 @@ func (p *CreateCharacterV869) Serialize(dest []byte) uint32 { offset += uint32(len(p.HairFile)) // Write HairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeColor.R + dest[offset+1] = p.HairTypeColor.G + dest[offset+2] = p.HairTypeColor.B + offset += 3 // Write HairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeHighlightColor.R + dest[offset+1] = p.HairTypeHighlightColor.G + dest[offset+2] = p.HairTypeHighlightColor.B + offset += 3 // Write FaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.FaceFile))) @@ -2265,12 +2345,16 @@ func (p *CreateCharacterV869) Serialize(dest []byte) uint32 { offset += uint32(len(p.FaceFile)) // Write HairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceColor.R + dest[offset+1] = p.HairFaceColor.G + dest[offset+2] = p.HairFaceColor.B + offset += 3 // Write HairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceHighlightColor.R + dest[offset+1] = p.HairFaceHighlightColor.G + dest[offset+2] = p.HairFaceHighlightColor.B + offset += 3 // Write WingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.WingFile))) @@ -2279,12 +2363,16 @@ func (p *CreateCharacterV869) Serialize(dest []byte) uint32 { offset += uint32(len(p.WingFile)) // Write WingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor1.ToUint32()) - offset += 4 + dest[offset] = p.WingColor1.R + dest[offset+1] = p.WingColor1.G + dest[offset+2] = p.WingColor1.B + offset += 3 // Write WingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor2.ToUint32()) - offset += 4 + dest[offset] = p.WingColor2.R + dest[offset+1] = p.WingColor2.G + dest[offset+2] = p.WingColor2.B + offset += 3 // Write ChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.ChestFile))) @@ -2293,12 +2381,16 @@ func (p *CreateCharacterV869) Serialize(dest []byte) uint32 { offset += uint32(len(p.ChestFile)) // Write ShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.ShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.ShirtColor.R + dest[offset+1] = p.ShirtColor.G + dest[offset+2] = p.ShirtColor.B + offset += 3 // Write UnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownChestColor.R + dest[offset+1] = p.UnknownChestColor.G + dest[offset+2] = p.UnknownChestColor.B + offset += 3 // Write LegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.LegsFile))) @@ -2307,16 +2399,22 @@ func (p *CreateCharacterV869) Serialize(dest []byte) uint32 { offset += uint32(len(p.LegsFile)) // Write PantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.PantsColor.ToUint32()) - offset += 4 + dest[offset] = p.PantsColor.R + dest[offset+1] = p.PantsColor.G + dest[offset+2] = p.PantsColor.B + offset += 3 // Write UnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownLegsColor.R + dest[offset+1] = p.UnknownLegsColor.G + dest[offset+2] = p.UnknownLegsColor.B + offset += 3 // Write Unknown9 - binary.LittleEndian.PutUint32(dest[offset:], p.Unknown9.ToUint32()) - offset += 4 + dest[offset] = p.Unknown9.R + dest[offset+1] = p.Unknown9.G + dest[offset+2] = p.Unknown9.B + offset += 3 // Write Eyes2 array for i := 0; i < 3; i++ { @@ -2379,28 +2477,40 @@ func (p *CreateCharacterV869) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaRaceFile)) // Write SogaSkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaSkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaSkinColor.R + dest[offset+1] = p.SogaSkinColor.G + dest[offset+2] = p.SogaSkinColor.B + offset += 3 // Write SogaEyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaEyeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaEyeColor.R + dest[offset+1] = p.SogaEyeColor.G + dest[offset+2] = p.SogaEyeColor.B + offset += 3 // Write SogaHairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor1.R + dest[offset+1] = p.SogaHairColor1.G + dest[offset+2] = p.SogaHairColor1.B + offset += 3 // Write SogaHairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor2.R + dest[offset+1] = p.SogaHairColor2.G + dest[offset+2] = p.SogaHairColor2.B + offset += 3 // Write SogaHairHighlight - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairHighlight.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairHighlight.R + dest[offset+1] = p.SogaHairHighlight.G + dest[offset+2] = p.SogaHairHighlight.B + offset += 3 // Write SogaUnknownColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownColor1.R + dest[offset+1] = p.SogaUnknownColor1.G + dest[offset+2] = p.SogaUnknownColor1.B + offset += 3 // Write SogaUnknown11 array for i := 0; i < 26; i++ { @@ -2415,12 +2525,16 @@ func (p *CreateCharacterV869) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaHairFile)) // Write SogaHairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeColor.R + dest[offset+1] = p.SogaHairTypeColor.G + dest[offset+2] = p.SogaHairTypeColor.B + offset += 3 // Write SogaHairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeHighlightColor.R + dest[offset+1] = p.SogaHairTypeHighlightColor.G + dest[offset+2] = p.SogaHairTypeHighlightColor.B + offset += 3 // Write SogaFaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaFaceFile))) @@ -2429,12 +2543,16 @@ func (p *CreateCharacterV869) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaFaceFile)) // Write SogaHairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceColor.R + dest[offset+1] = p.SogaHairFaceColor.G + dest[offset+2] = p.SogaHairFaceColor.B + offset += 3 // Write SogaHairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceHighlightColor.R + dest[offset+1] = p.SogaHairFaceHighlightColor.G + dest[offset+2] = p.SogaHairFaceHighlightColor.B + offset += 3 // Write SogaWingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaWingFile))) @@ -2443,12 +2561,16 @@ func (p *CreateCharacterV869) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaWingFile)) // Write SogaWingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor1.R + dest[offset+1] = p.SogaWingColor1.G + dest[offset+2] = p.SogaWingColor1.B + offset += 3 // Write SogaWingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor2.R + dest[offset+1] = p.SogaWingColor2.G + dest[offset+2] = p.SogaWingColor2.B + offset += 3 // Write SogaChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaChestFile))) @@ -2457,12 +2579,16 @@ func (p *CreateCharacterV869) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaChestFile)) // Write SogaShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaShirtColor.R + dest[offset+1] = p.SogaShirtColor.G + dest[offset+2] = p.SogaShirtColor.B + offset += 3 // Write SogaUnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownChestColor.R + dest[offset+1] = p.SogaUnknownChestColor.G + dest[offset+2] = p.SogaUnknownChestColor.B + offset += 3 // Write SogaLegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaLegsFile))) @@ -2471,16 +2597,22 @@ func (p *CreateCharacterV869) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaLegsFile)) // Write SogaPantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaPantsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaPantsColor.R + dest[offset+1] = p.SogaPantsColor.G + dest[offset+2] = p.SogaPantsColor.B + offset += 3 // Write SogaUnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownLegsColor.R + dest[offset+1] = p.SogaUnknownLegsColor.G + dest[offset+2] = p.SogaUnknownLegsColor.B + offset += 3 // Write SogaUnknown12 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknown12.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknown12.R + dest[offset+1] = p.SogaUnknown12.G + dest[offset+2] = p.SogaUnknown12.B + offset += 3 // Write SogaEyes2 array for i := 0; i < 3; i++ { @@ -2567,51 +2699,51 @@ func (p *CreateCharacterV869) Size() uint32 { size += 2 + uint32(len(p.RaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 26 size += 2 + uint32(len(p.HairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.FaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.WingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.ChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.LegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 @@ -2635,51 +2767,51 @@ func (p *CreateCharacterV869) Size() uint32 { size += 2 + uint32(len(p.SogaRaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 26 size += 2 + uint32(len(p.SogaHairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaFaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaWingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaLegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 @@ -2851,28 +2983,40 @@ func (p *CreateCharacterV1096) Serialize(dest []byte) uint32 { offset += uint32(len(p.RaceFile)) // Write SkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor.R + dest[offset+1] = p.SkinColor.G + dest[offset+2] = p.SkinColor.B + offset += 3 // Write SkinColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor2.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor2.R + dest[offset+1] = p.SkinColor2.G + dest[offset+2] = p.SkinColor2.B + offset += 3 // Write EyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.EyeColor.ToUint32()) - offset += 4 + dest[offset] = p.EyeColor.R + dest[offset+1] = p.EyeColor.G + dest[offset+2] = p.EyeColor.B + offset += 3 // Write HairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor1.ToUint32()) - offset += 4 + dest[offset] = p.HairColor1.R + dest[offset+1] = p.HairColor1.G + dest[offset+2] = p.HairColor1.B + offset += 3 // Write HairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor2.ToUint32()) - offset += 4 + dest[offset] = p.HairColor2.R + dest[offset+1] = p.HairColor2.G + dest[offset+2] = p.HairColor2.B + offset += 3 // Write HairHighlight - binary.LittleEndian.PutUint32(dest[offset:], p.HairHighlight.ToUint32()) - offset += 4 + dest[offset] = p.HairHighlight.R + dest[offset+1] = p.HairHighlight.G + dest[offset+2] = p.HairHighlight.B + offset += 3 // Write Unknown8 array for i := 0; i < 26; i++ { @@ -2887,12 +3031,16 @@ func (p *CreateCharacterV1096) Serialize(dest []byte) uint32 { offset += uint32(len(p.HairFile)) // Write HairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeColor.R + dest[offset+1] = p.HairTypeColor.G + dest[offset+2] = p.HairTypeColor.B + offset += 3 // Write HairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeHighlightColor.R + dest[offset+1] = p.HairTypeHighlightColor.G + dest[offset+2] = p.HairTypeHighlightColor.B + offset += 3 // Write FaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.FaceFile))) @@ -2901,12 +3049,16 @@ func (p *CreateCharacterV1096) Serialize(dest []byte) uint32 { offset += uint32(len(p.FaceFile)) // Write HairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceColor.R + dest[offset+1] = p.HairFaceColor.G + dest[offset+2] = p.HairFaceColor.B + offset += 3 // Write HairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceHighlightColor.R + dest[offset+1] = p.HairFaceHighlightColor.G + dest[offset+2] = p.HairFaceHighlightColor.B + offset += 3 // Write WingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.WingFile))) @@ -2915,12 +3067,16 @@ func (p *CreateCharacterV1096) Serialize(dest []byte) uint32 { offset += uint32(len(p.WingFile)) // Write WingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor1.ToUint32()) - offset += 4 + dest[offset] = p.WingColor1.R + dest[offset+1] = p.WingColor1.G + dest[offset+2] = p.WingColor1.B + offset += 3 // Write WingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor2.ToUint32()) - offset += 4 + dest[offset] = p.WingColor2.R + dest[offset+1] = p.WingColor2.G + dest[offset+2] = p.WingColor2.B + offset += 3 // Write ChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.ChestFile))) @@ -2929,12 +3085,16 @@ func (p *CreateCharacterV1096) Serialize(dest []byte) uint32 { offset += uint32(len(p.ChestFile)) // Write ShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.ShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.ShirtColor.R + dest[offset+1] = p.ShirtColor.G + dest[offset+2] = p.ShirtColor.B + offset += 3 // Write UnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownChestColor.R + dest[offset+1] = p.UnknownChestColor.G + dest[offset+2] = p.UnknownChestColor.B + offset += 3 // Write LegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.LegsFile))) @@ -2943,16 +3103,22 @@ func (p *CreateCharacterV1096) Serialize(dest []byte) uint32 { offset += uint32(len(p.LegsFile)) // Write PantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.PantsColor.ToUint32()) - offset += 4 + dest[offset] = p.PantsColor.R + dest[offset+1] = p.PantsColor.G + dest[offset+2] = p.PantsColor.B + offset += 3 // Write UnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownLegsColor.R + dest[offset+1] = p.UnknownLegsColor.G + dest[offset+2] = p.UnknownLegsColor.B + offset += 3 // Write Unknown9 - binary.LittleEndian.PutUint32(dest[offset:], p.Unknown9.ToUint32()) - offset += 4 + dest[offset] = p.Unknown9.R + dest[offset+1] = p.Unknown9.G + dest[offset+2] = p.Unknown9.B + offset += 3 // Write Eyes2 array for i := 0; i < 3; i++ { @@ -3015,28 +3181,40 @@ func (p *CreateCharacterV1096) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaRaceFile)) // Write SogaSkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaSkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaSkinColor.R + dest[offset+1] = p.SogaSkinColor.G + dest[offset+2] = p.SogaSkinColor.B + offset += 3 // Write SogaEyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaEyeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaEyeColor.R + dest[offset+1] = p.SogaEyeColor.G + dest[offset+2] = p.SogaEyeColor.B + offset += 3 // Write SogaHairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor1.R + dest[offset+1] = p.SogaHairColor1.G + dest[offset+2] = p.SogaHairColor1.B + offset += 3 // Write SogaHairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor2.R + dest[offset+1] = p.SogaHairColor2.G + dest[offset+2] = p.SogaHairColor2.B + offset += 3 // Write SogaHairHighlight - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairHighlight.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairHighlight.R + dest[offset+1] = p.SogaHairHighlight.G + dest[offset+2] = p.SogaHairHighlight.B + offset += 3 // Write SogaUnknownColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownColor.R + dest[offset+1] = p.SogaUnknownColor.G + dest[offset+2] = p.SogaUnknownColor.B + offset += 3 // Write SogaUnknown11 array for i := 0; i < 26; i++ { @@ -3051,12 +3229,16 @@ func (p *CreateCharacterV1096) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaHairFile)) // Write SogaHairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeColor.R + dest[offset+1] = p.SogaHairTypeColor.G + dest[offset+2] = p.SogaHairTypeColor.B + offset += 3 // Write SogaHairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeHighlightColor.R + dest[offset+1] = p.SogaHairTypeHighlightColor.G + dest[offset+2] = p.SogaHairTypeHighlightColor.B + offset += 3 // Write SogaFaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaFaceFile))) @@ -3065,12 +3247,16 @@ func (p *CreateCharacterV1096) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaFaceFile)) // Write SogaHairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceColor.R + dest[offset+1] = p.SogaHairFaceColor.G + dest[offset+2] = p.SogaHairFaceColor.B + offset += 3 // Write SogaHairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceHighlightColor.R + dest[offset+1] = p.SogaHairFaceHighlightColor.G + dest[offset+2] = p.SogaHairFaceHighlightColor.B + offset += 3 // Write SogaWingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaWingFile))) @@ -3079,12 +3265,16 @@ func (p *CreateCharacterV1096) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaWingFile)) // Write SogaWingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor1.R + dest[offset+1] = p.SogaWingColor1.G + dest[offset+2] = p.SogaWingColor1.B + offset += 3 // Write SogaWingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor2.R + dest[offset+1] = p.SogaWingColor2.G + dest[offset+2] = p.SogaWingColor2.B + offset += 3 // Write SogaChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaChestFile))) @@ -3093,12 +3283,16 @@ func (p *CreateCharacterV1096) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaChestFile)) // Write SogaShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaShirtColor.R + dest[offset+1] = p.SogaShirtColor.G + dest[offset+2] = p.SogaShirtColor.B + offset += 3 // Write SogaUnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownChestColor.R + dest[offset+1] = p.SogaUnknownChestColor.G + dest[offset+2] = p.SogaUnknownChestColor.B + offset += 3 // Write SogaLegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaLegsFile))) @@ -3107,16 +3301,22 @@ func (p *CreateCharacterV1096) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaLegsFile)) // Write SogaPantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaPantsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaPantsColor.R + dest[offset+1] = p.SogaPantsColor.G + dest[offset+2] = p.SogaPantsColor.B + offset += 3 // Write SogaUnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownLegsColor.R + dest[offset+1] = p.SogaUnknownLegsColor.G + dest[offset+2] = p.SogaUnknownLegsColor.B + offset += 3 // Write SogaUnknown12 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknown12.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknown12.R + dest[offset+1] = p.SogaUnknown12.G + dest[offset+2] = p.SogaUnknown12.B + offset += 3 // Write SogaEyes2 array for i := 0; i < 3; i++ { @@ -3203,51 +3403,51 @@ func (p *CreateCharacterV1096) Size() uint32 { size += 2 + uint32(len(p.RaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 26 size += 2 + uint32(len(p.HairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.FaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.WingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.ChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.LegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 @@ -3271,51 +3471,51 @@ func (p *CreateCharacterV1096) Size() uint32 { size += 2 + uint32(len(p.SogaRaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 26 size += 2 + uint32(len(p.SogaHairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaFaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaWingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaLegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 @@ -3492,28 +3692,40 @@ func (p *CreateCharacterV57080) Serialize(dest []byte) uint32 { offset += uint32(len(p.RaceFile)) // Write SkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor.R + dest[offset+1] = p.SkinColor.G + dest[offset+2] = p.SkinColor.B + offset += 3 // Write EyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.EyeColor.ToUint32()) - offset += 4 + dest[offset] = p.EyeColor.R + dest[offset+1] = p.EyeColor.G + dest[offset+2] = p.EyeColor.B + offset += 3 // Write UnknownSkinColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownSkinColor2.ToUint32()) - offset += 4 + dest[offset] = p.UnknownSkinColor2.R + dest[offset+1] = p.UnknownSkinColor2.G + dest[offset+2] = p.UnknownSkinColor2.B + offset += 3 // Write HairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor1.ToUint32()) - offset += 4 + dest[offset] = p.HairColor1.R + dest[offset+1] = p.HairColor1.G + dest[offset+2] = p.HairColor1.B + offset += 3 // Write HairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor2.ToUint32()) - offset += 4 + dest[offset] = p.HairColor2.R + dest[offset+1] = p.HairColor2.G + dest[offset+2] = p.HairColor2.B + offset += 3 // Write HairHighlight - binary.LittleEndian.PutUint32(dest[offset:], p.HairHighlight.ToUint32()) - offset += 4 + dest[offset] = p.HairHighlight.R + dest[offset+1] = p.HairHighlight.G + dest[offset+2] = p.HairHighlight.B + offset += 3 // Write Unknown8 array for i := 0; i < 26; i++ { @@ -3528,12 +3740,16 @@ func (p *CreateCharacterV57080) Serialize(dest []byte) uint32 { offset += uint32(len(p.HairFile)) // Write HairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeColor.R + dest[offset+1] = p.HairTypeColor.G + dest[offset+2] = p.HairTypeColor.B + offset += 3 // Write HairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeHighlightColor.R + dest[offset+1] = p.HairTypeHighlightColor.G + dest[offset+2] = p.HairTypeHighlightColor.B + offset += 3 // Write FaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.FaceFile))) @@ -3542,12 +3758,16 @@ func (p *CreateCharacterV57080) Serialize(dest []byte) uint32 { offset += uint32(len(p.FaceFile)) // Write HairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceColor.R + dest[offset+1] = p.HairFaceColor.G + dest[offset+2] = p.HairFaceColor.B + offset += 3 // Write HairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceHighlightColor.R + dest[offset+1] = p.HairFaceHighlightColor.G + dest[offset+2] = p.HairFaceHighlightColor.B + offset += 3 // Write WingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.WingFile))) @@ -3556,12 +3776,16 @@ func (p *CreateCharacterV57080) Serialize(dest []byte) uint32 { offset += uint32(len(p.WingFile)) // Write WingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor1.ToUint32()) - offset += 4 + dest[offset] = p.WingColor1.R + dest[offset+1] = p.WingColor1.G + dest[offset+2] = p.WingColor1.B + offset += 3 // Write WingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor2.ToUint32()) - offset += 4 + dest[offset] = p.WingColor2.R + dest[offset+1] = p.WingColor2.G + dest[offset+2] = p.WingColor2.B + offset += 3 // Write ChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.ChestFile))) @@ -3570,12 +3794,16 @@ func (p *CreateCharacterV57080) Serialize(dest []byte) uint32 { offset += uint32(len(p.ChestFile)) // Write ShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.ShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.ShirtColor.R + dest[offset+1] = p.ShirtColor.G + dest[offset+2] = p.ShirtColor.B + offset += 3 // Write UnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownChestColor.R + dest[offset+1] = p.UnknownChestColor.G + dest[offset+2] = p.UnknownChestColor.B + offset += 3 // Write LegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.LegsFile))) @@ -3584,16 +3812,22 @@ func (p *CreateCharacterV57080) Serialize(dest []byte) uint32 { offset += uint32(len(p.LegsFile)) // Write PantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.PantsColor.ToUint32()) - offset += 4 + dest[offset] = p.PantsColor.R + dest[offset+1] = p.PantsColor.G + dest[offset+2] = p.PantsColor.B + offset += 3 // Write UnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownLegsColor.R + dest[offset+1] = p.UnknownLegsColor.G + dest[offset+2] = p.UnknownLegsColor.B + offset += 3 // Write Unknown9 - binary.LittleEndian.PutUint32(dest[offset:], p.Unknown9.ToUint32()) - offset += 4 + dest[offset] = p.Unknown9.R + dest[offset+1] = p.Unknown9.G + dest[offset+2] = p.Unknown9.B + offset += 3 // Write Eyes2 array for i := 0; i < 3; i++ { @@ -3656,28 +3890,40 @@ func (p *CreateCharacterV57080) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaRaceFile)) // Write SogaSkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaSkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaSkinColor.R + dest[offset+1] = p.SogaSkinColor.G + dest[offset+2] = p.SogaSkinColor.B + offset += 3 // Write SogaEyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaEyeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaEyeColor.R + dest[offset+1] = p.SogaEyeColor.G + dest[offset+2] = p.SogaEyeColor.B + offset += 3 // Write SogaHairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor1.R + dest[offset+1] = p.SogaHairColor1.G + dest[offset+2] = p.SogaHairColor1.B + offset += 3 // Write SogaHairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor2.R + dest[offset+1] = p.SogaHairColor2.G + dest[offset+2] = p.SogaHairColor2.B + offset += 3 // Write SogaHairHighlight - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairHighlight.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairHighlight.R + dest[offset+1] = p.SogaHairHighlight.G + dest[offset+2] = p.SogaHairHighlight.B + offset += 3 // Write SogaUnknownColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownColor.R + dest[offset+1] = p.SogaUnknownColor.G + dest[offset+2] = p.SogaUnknownColor.B + offset += 3 // Write SogaUnknown11 array for i := 0; i < 26; i++ { @@ -3692,12 +3938,16 @@ func (p *CreateCharacterV57080) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaHairFile)) // Write SogaHairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeColor.R + dest[offset+1] = p.SogaHairTypeColor.G + dest[offset+2] = p.SogaHairTypeColor.B + offset += 3 // Write SogaHairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeHighlightColor.R + dest[offset+1] = p.SogaHairTypeHighlightColor.G + dest[offset+2] = p.SogaHairTypeHighlightColor.B + offset += 3 // Write SogaFaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaFaceFile))) @@ -3706,12 +3956,16 @@ func (p *CreateCharacterV57080) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaFaceFile)) // Write SogaHairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceColor.R + dest[offset+1] = p.SogaHairFaceColor.G + dest[offset+2] = p.SogaHairFaceColor.B + offset += 3 // Write SogaHairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceHighlightColor.R + dest[offset+1] = p.SogaHairFaceHighlightColor.G + dest[offset+2] = p.SogaHairFaceHighlightColor.B + offset += 3 // Write SogaWingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaWingFile))) @@ -3720,12 +3974,16 @@ func (p *CreateCharacterV57080) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaWingFile)) // Write SogaWingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor1.R + dest[offset+1] = p.SogaWingColor1.G + dest[offset+2] = p.SogaWingColor1.B + offset += 3 // Write SogaWingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor2.R + dest[offset+1] = p.SogaWingColor2.G + dest[offset+2] = p.SogaWingColor2.B + offset += 3 // Write SogaChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaChestFile))) @@ -3734,12 +3992,16 @@ func (p *CreateCharacterV57080) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaChestFile)) // Write SogaShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaShirtColor.R + dest[offset+1] = p.SogaShirtColor.G + dest[offset+2] = p.SogaShirtColor.B + offset += 3 // Write SogaUnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownChestColor.R + dest[offset+1] = p.SogaUnknownChestColor.G + dest[offset+2] = p.SogaUnknownChestColor.B + offset += 3 // Write SogaLegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaLegsFile))) @@ -3748,16 +4010,22 @@ func (p *CreateCharacterV57080) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaLegsFile)) // Write SogaPantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaPantsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaPantsColor.R + dest[offset+1] = p.SogaPantsColor.G + dest[offset+2] = p.SogaPantsColor.B + offset += 3 // Write SogaUnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownLegsColor.R + dest[offset+1] = p.SogaUnknownLegsColor.G + dest[offset+2] = p.SogaUnknownLegsColor.B + offset += 3 // Write SogaUnknown12 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknown12.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknown12.R + dest[offset+1] = p.SogaUnknown12.G + dest[offset+2] = p.SogaUnknown12.B + offset += 3 // Write SogaEyes2 array for i := 0; i < 3; i++ { @@ -3846,51 +4114,51 @@ func (p *CreateCharacterV57080) Size() uint32 { size += 2 + uint32(len(p.RaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 26 size += 2 + uint32(len(p.HairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.FaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.WingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.ChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.LegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 @@ -3914,51 +4182,51 @@ func (p *CreateCharacterV57080) Size() uint32 { size += 2 + uint32(len(p.SogaRaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 26 size += 2 + uint32(len(p.SogaHairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaFaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaWingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaLegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 @@ -4135,28 +4403,40 @@ func (p *CreateCharacterV60085) Serialize(dest []byte) uint32 { offset += uint32(len(p.RaceFile)) // Write SkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor.R + dest[offset+1] = p.SkinColor.G + dest[offset+2] = p.SkinColor.B + offset += 3 // Write EyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.EyeColor.ToUint32()) - offset += 4 + dest[offset] = p.EyeColor.R + dest[offset+1] = p.EyeColor.G + dest[offset+2] = p.EyeColor.B + offset += 3 // Write UnknownSkinColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownSkinColor2.ToUint32()) - offset += 4 + dest[offset] = p.UnknownSkinColor2.R + dest[offset+1] = p.UnknownSkinColor2.G + dest[offset+2] = p.UnknownSkinColor2.B + offset += 3 // Write HairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor1.ToUint32()) - offset += 4 + dest[offset] = p.HairColor1.R + dest[offset+1] = p.HairColor1.G + dest[offset+2] = p.HairColor1.B + offset += 3 // Write HairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor2.ToUint32()) - offset += 4 + dest[offset] = p.HairColor2.R + dest[offset+1] = p.HairColor2.G + dest[offset+2] = p.HairColor2.B + offset += 3 // Write HairHighlight - binary.LittleEndian.PutUint32(dest[offset:], p.HairHighlight.ToUint32()) - offset += 4 + dest[offset] = p.HairHighlight.R + dest[offset+1] = p.HairHighlight.G + dest[offset+2] = p.HairHighlight.B + offset += 3 // Write Unknown8 array for i := 0; i < 26; i++ { @@ -4171,12 +4451,16 @@ func (p *CreateCharacterV60085) Serialize(dest []byte) uint32 { offset += uint32(len(p.HairFile)) // Write HairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeColor.R + dest[offset+1] = p.HairTypeColor.G + dest[offset+2] = p.HairTypeColor.B + offset += 3 // Write HairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeHighlightColor.R + dest[offset+1] = p.HairTypeHighlightColor.G + dest[offset+2] = p.HairTypeHighlightColor.B + offset += 3 // Write FaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.FaceFile))) @@ -4185,12 +4469,16 @@ func (p *CreateCharacterV60085) Serialize(dest []byte) uint32 { offset += uint32(len(p.FaceFile)) // Write HairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceColor.R + dest[offset+1] = p.HairFaceColor.G + dest[offset+2] = p.HairFaceColor.B + offset += 3 // Write HairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceHighlightColor.R + dest[offset+1] = p.HairFaceHighlightColor.G + dest[offset+2] = p.HairFaceHighlightColor.B + offset += 3 // Write WingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.WingFile))) @@ -4199,12 +4487,16 @@ func (p *CreateCharacterV60085) Serialize(dest []byte) uint32 { offset += uint32(len(p.WingFile)) // Write WingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor1.ToUint32()) - offset += 4 + dest[offset] = p.WingColor1.R + dest[offset+1] = p.WingColor1.G + dest[offset+2] = p.WingColor1.B + offset += 3 // Write WingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor2.ToUint32()) - offset += 4 + dest[offset] = p.WingColor2.R + dest[offset+1] = p.WingColor2.G + dest[offset+2] = p.WingColor2.B + offset += 3 // Write ChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.ChestFile))) @@ -4213,12 +4505,16 @@ func (p *CreateCharacterV60085) Serialize(dest []byte) uint32 { offset += uint32(len(p.ChestFile)) // Write ShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.ShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.ShirtColor.R + dest[offset+1] = p.ShirtColor.G + dest[offset+2] = p.ShirtColor.B + offset += 3 // Write UnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownChestColor.R + dest[offset+1] = p.UnknownChestColor.G + dest[offset+2] = p.UnknownChestColor.B + offset += 3 // Write LegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.LegsFile))) @@ -4227,16 +4523,22 @@ func (p *CreateCharacterV60085) Serialize(dest []byte) uint32 { offset += uint32(len(p.LegsFile)) // Write PantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.PantsColor.ToUint32()) - offset += 4 + dest[offset] = p.PantsColor.R + dest[offset+1] = p.PantsColor.G + dest[offset+2] = p.PantsColor.B + offset += 3 // Write UnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownLegsColor.R + dest[offset+1] = p.UnknownLegsColor.G + dest[offset+2] = p.UnknownLegsColor.B + offset += 3 // Write Unknown9 - binary.LittleEndian.PutUint32(dest[offset:], p.Unknown9.ToUint32()) - offset += 4 + dest[offset] = p.Unknown9.R + dest[offset+1] = p.Unknown9.G + dest[offset+2] = p.Unknown9.B + offset += 3 // Write Eyes2 array for i := 0; i < 3; i++ { @@ -4299,28 +4601,40 @@ func (p *CreateCharacterV60085) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaRaceFile)) // Write SogaSkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaSkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaSkinColor.R + dest[offset+1] = p.SogaSkinColor.G + dest[offset+2] = p.SogaSkinColor.B + offset += 3 // Write SogaEyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaEyeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaEyeColor.R + dest[offset+1] = p.SogaEyeColor.G + dest[offset+2] = p.SogaEyeColor.B + offset += 3 // Write SogaHairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor1.R + dest[offset+1] = p.SogaHairColor1.G + dest[offset+2] = p.SogaHairColor1.B + offset += 3 // Write SogaHairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor2.R + dest[offset+1] = p.SogaHairColor2.G + dest[offset+2] = p.SogaHairColor2.B + offset += 3 // Write SogaHairHighlight - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairHighlight.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairHighlight.R + dest[offset+1] = p.SogaHairHighlight.G + dest[offset+2] = p.SogaHairHighlight.B + offset += 3 // Write SogaUnknownColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownColor.R + dest[offset+1] = p.SogaUnknownColor.G + dest[offset+2] = p.SogaUnknownColor.B + offset += 3 // Write SogaUnknown11 array for i := 0; i < 26; i++ { @@ -4335,12 +4649,16 @@ func (p *CreateCharacterV60085) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaHairFile)) // Write SogaHairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeColor.R + dest[offset+1] = p.SogaHairTypeColor.G + dest[offset+2] = p.SogaHairTypeColor.B + offset += 3 // Write SogaHairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeHighlightColor.R + dest[offset+1] = p.SogaHairTypeHighlightColor.G + dest[offset+2] = p.SogaHairTypeHighlightColor.B + offset += 3 // Write SogaFaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaFaceFile))) @@ -4349,12 +4667,16 @@ func (p *CreateCharacterV60085) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaFaceFile)) // Write SogaHairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceColor.R + dest[offset+1] = p.SogaHairFaceColor.G + dest[offset+2] = p.SogaHairFaceColor.B + offset += 3 // Write SogaHairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceHighlightColor.R + dest[offset+1] = p.SogaHairFaceHighlightColor.G + dest[offset+2] = p.SogaHairFaceHighlightColor.B + offset += 3 // Write SogaWingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaWingFile))) @@ -4363,12 +4685,16 @@ func (p *CreateCharacterV60085) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaWingFile)) // Write SogaWingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor1.R + dest[offset+1] = p.SogaWingColor1.G + dest[offset+2] = p.SogaWingColor1.B + offset += 3 // Write SogaWingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor2.R + dest[offset+1] = p.SogaWingColor2.G + dest[offset+2] = p.SogaWingColor2.B + offset += 3 // Write SogaChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaChestFile))) @@ -4377,12 +4703,16 @@ func (p *CreateCharacterV60085) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaChestFile)) // Write SogaShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaShirtColor.R + dest[offset+1] = p.SogaShirtColor.G + dest[offset+2] = p.SogaShirtColor.B + offset += 3 // Write SogaUnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownChestColor.R + dest[offset+1] = p.SogaUnknownChestColor.G + dest[offset+2] = p.SogaUnknownChestColor.B + offset += 3 // Write SogaLegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaLegsFile))) @@ -4391,16 +4721,22 @@ func (p *CreateCharacterV60085) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaLegsFile)) // Write SogaPantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaPantsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaPantsColor.R + dest[offset+1] = p.SogaPantsColor.G + dest[offset+2] = p.SogaPantsColor.B + offset += 3 // Write SogaUnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownLegsColor.R + dest[offset+1] = p.SogaUnknownLegsColor.G + dest[offset+2] = p.SogaUnknownLegsColor.B + offset += 3 // Write SogaUnknown12 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknown12.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknown12.R + dest[offset+1] = p.SogaUnknown12.G + dest[offset+2] = p.SogaUnknown12.B + offset += 3 // Write SogaEyes2 array for i := 0; i < 3; i++ { @@ -4489,51 +4825,51 @@ func (p *CreateCharacterV60085) Size() uint32 { size += 2 + uint32(len(p.RaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 26 size += 2 + uint32(len(p.HairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.FaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.WingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.ChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.LegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 @@ -4557,51 +4893,51 @@ func (p *CreateCharacterV60085) Size() uint32 { size += 2 + uint32(len(p.SogaRaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 26 size += 2 + uint32(len(p.SogaHairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaFaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaWingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaLegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 @@ -4772,24 +5108,34 @@ func (p *CreateCharacterV64659) Serialize(dest []byte) uint32 { offset += uint32(len(p.RaceFile)) // Write SkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor.R + dest[offset+1] = p.SkinColor.G + dest[offset+2] = p.SkinColor.B + offset += 3 // Write SkinColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor2.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor2.R + dest[offset+1] = p.SkinColor2.G + dest[offset+2] = p.SkinColor2.B + offset += 3 // Write EyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.EyeColor.ToUint32()) - offset += 4 + dest[offset] = p.EyeColor.R + dest[offset+1] = p.EyeColor.G + dest[offset+2] = p.EyeColor.B + offset += 3 // Write HairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor1.ToUint32()) - offset += 4 + dest[offset] = p.HairColor1.R + dest[offset+1] = p.HairColor1.G + dest[offset+2] = p.HairColor1.B + offset += 3 // Write HairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor2.ToUint32()) - offset += 4 + dest[offset] = p.HairColor2.R + dest[offset+1] = p.HairColor2.G + dest[offset+2] = p.HairColor2.B + offset += 3 // Write Unknown8 array for i := 0; i < 38; i++ { @@ -4804,12 +5150,16 @@ func (p *CreateCharacterV64659) Serialize(dest []byte) uint32 { offset += uint32(len(p.HairFile)) // Write HairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeColor.R + dest[offset+1] = p.HairTypeColor.G + dest[offset+2] = p.HairTypeColor.B + offset += 3 // Write HairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeHighlightColor.R + dest[offset+1] = p.HairTypeHighlightColor.G + dest[offset+2] = p.HairTypeHighlightColor.B + offset += 3 // Write FaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.FaceFile))) @@ -4818,12 +5168,16 @@ func (p *CreateCharacterV64659) Serialize(dest []byte) uint32 { offset += uint32(len(p.FaceFile)) // Write HairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceColor.R + dest[offset+1] = p.HairFaceColor.G + dest[offset+2] = p.HairFaceColor.B + offset += 3 // Write HairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceHighlightColor.R + dest[offset+1] = p.HairFaceHighlightColor.G + dest[offset+2] = p.HairFaceHighlightColor.B + offset += 3 // Write WingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.WingFile))) @@ -4832,12 +5186,16 @@ func (p *CreateCharacterV64659) Serialize(dest []byte) uint32 { offset += uint32(len(p.WingFile)) // Write WingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor1.ToUint32()) - offset += 4 + dest[offset] = p.WingColor1.R + dest[offset+1] = p.WingColor1.G + dest[offset+2] = p.WingColor1.B + offset += 3 // Write WingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor2.ToUint32()) - offset += 4 + dest[offset] = p.WingColor2.R + dest[offset+1] = p.WingColor2.G + dest[offset+2] = p.WingColor2.B + offset += 3 // Write ChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.ChestFile))) @@ -4846,12 +5204,16 @@ func (p *CreateCharacterV64659) Serialize(dest []byte) uint32 { offset += uint32(len(p.ChestFile)) // Write ShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.ShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.ShirtColor.R + dest[offset+1] = p.ShirtColor.G + dest[offset+2] = p.ShirtColor.B + offset += 3 // Write UnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownChestColor.R + dest[offset+1] = p.UnknownChestColor.G + dest[offset+2] = p.UnknownChestColor.B + offset += 3 // Write LegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.LegsFile))) @@ -4860,16 +5222,22 @@ func (p *CreateCharacterV64659) Serialize(dest []byte) uint32 { offset += uint32(len(p.LegsFile)) // Write PantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.PantsColor.ToUint32()) - offset += 4 + dest[offset] = p.PantsColor.R + dest[offset+1] = p.PantsColor.G + dest[offset+2] = p.PantsColor.B + offset += 3 // Write UnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownLegsColor.R + dest[offset+1] = p.UnknownLegsColor.G + dest[offset+2] = p.UnknownLegsColor.B + offset += 3 // Write Unknown9 - binary.LittleEndian.PutUint32(dest[offset:], p.Unknown9.ToUint32()) - offset += 4 + dest[offset] = p.Unknown9.R + dest[offset+1] = p.Unknown9.G + dest[offset+2] = p.Unknown9.B + offset += 3 // Write Eyes2 array for i := 0; i < 3; i++ { @@ -4932,24 +5300,34 @@ func (p *CreateCharacterV64659) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaRaceFile)) // Write SogaSkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaSkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaSkinColor.R + dest[offset+1] = p.SogaSkinColor.G + dest[offset+2] = p.SogaSkinColor.B + offset += 3 // Write SogaEyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaEyeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaEyeColor.R + dest[offset+1] = p.SogaEyeColor.G + dest[offset+2] = p.SogaEyeColor.B + offset += 3 // Write SogaHairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor1.R + dest[offset+1] = p.SogaHairColor1.G + dest[offset+2] = p.SogaHairColor1.B + offset += 3 // Write SogaHairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor2.R + dest[offset+1] = p.SogaHairColor2.G + dest[offset+2] = p.SogaHairColor2.B + offset += 3 // Write SogaHairHighlight - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairHighlight.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairHighlight.R + dest[offset+1] = p.SogaHairHighlight.G + dest[offset+2] = p.SogaHairHighlight.B + offset += 3 // Write SogaUnknown11 array for i := 0; i < 38; i++ { @@ -4964,12 +5342,16 @@ func (p *CreateCharacterV64659) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaHairFile)) // Write SogaHairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeColor.R + dest[offset+1] = p.SogaHairTypeColor.G + dest[offset+2] = p.SogaHairTypeColor.B + offset += 3 // Write SogaHairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeHighlightColor.R + dest[offset+1] = p.SogaHairTypeHighlightColor.G + dest[offset+2] = p.SogaHairTypeHighlightColor.B + offset += 3 // Write SogaFaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaFaceFile))) @@ -4978,12 +5360,16 @@ func (p *CreateCharacterV64659) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaFaceFile)) // Write SogaHairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceColor.R + dest[offset+1] = p.SogaHairFaceColor.G + dest[offset+2] = p.SogaHairFaceColor.B + offset += 3 // Write SogaHairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceHighlightColor.R + dest[offset+1] = p.SogaHairFaceHighlightColor.G + dest[offset+2] = p.SogaHairFaceHighlightColor.B + offset += 3 // Write SogaWingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaWingFile))) @@ -4992,12 +5378,16 @@ func (p *CreateCharacterV64659) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaWingFile)) // Write SogaWingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor1.R + dest[offset+1] = p.SogaWingColor1.G + dest[offset+2] = p.SogaWingColor1.B + offset += 3 // Write SogaWingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor2.R + dest[offset+1] = p.SogaWingColor2.G + dest[offset+2] = p.SogaWingColor2.B + offset += 3 // Write SogaChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaChestFile))) @@ -5006,12 +5396,16 @@ func (p *CreateCharacterV64659) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaChestFile)) // Write SogaShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaShirtColor.R + dest[offset+1] = p.SogaShirtColor.G + dest[offset+2] = p.SogaShirtColor.B + offset += 3 // Write SogaUnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownChestColor.R + dest[offset+1] = p.SogaUnknownChestColor.G + dest[offset+2] = p.SogaUnknownChestColor.B + offset += 3 // Write SogaLegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaLegsFile))) @@ -5020,16 +5414,22 @@ func (p *CreateCharacterV64659) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaLegsFile)) // Write SogaPantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaPantsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaPantsColor.R + dest[offset+1] = p.SogaPantsColor.G + dest[offset+2] = p.SogaPantsColor.B + offset += 3 // Write SogaUnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownLegsColor.R + dest[offset+1] = p.SogaUnknownLegsColor.G + dest[offset+2] = p.SogaUnknownLegsColor.B + offset += 3 // Write SogaUnknown12 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknown12.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknown12.R + dest[offset+1] = p.SogaUnknown12.G + dest[offset+2] = p.SogaUnknown12.B + offset += 3 // Write SogaEyes2 array for i := 0; i < 3; i++ { @@ -5122,49 +5522,49 @@ func (p *CreateCharacterV64659) Size() uint32 { size += 2 + uint32(len(p.RaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 38 size += 2 + uint32(len(p.HairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.FaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.WingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.ChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.LegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 @@ -5188,49 +5588,49 @@ func (p *CreateCharacterV64659) Size() uint32 { size += 2 + uint32(len(p.SogaRaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 38 size += 2 + uint32(len(p.SogaHairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaFaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaWingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaLegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 @@ -5403,24 +5803,34 @@ func (p *CreateCharacterV65534) Serialize(dest []byte) uint32 { offset += uint32(len(p.RaceFile)) // Write SkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor.R + dest[offset+1] = p.SkinColor.G + dest[offset+2] = p.SkinColor.B + offset += 3 // Write SkinColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor2.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor2.R + dest[offset+1] = p.SkinColor2.G + dest[offset+2] = p.SkinColor2.B + offset += 3 // Write EyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.EyeColor.ToUint32()) - offset += 4 + dest[offset] = p.EyeColor.R + dest[offset+1] = p.EyeColor.G + dest[offset+2] = p.EyeColor.B + offset += 3 // Write HairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor1.ToUint32()) - offset += 4 + dest[offset] = p.HairColor1.R + dest[offset+1] = p.HairColor1.G + dest[offset+2] = p.HairColor1.B + offset += 3 // Write HairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor2.ToUint32()) - offset += 4 + dest[offset] = p.HairColor2.R + dest[offset+1] = p.HairColor2.G + dest[offset+2] = p.HairColor2.B + offset += 3 // Write Unknown8 array for i := 0; i < 38; i++ { @@ -5435,12 +5845,16 @@ func (p *CreateCharacterV65534) Serialize(dest []byte) uint32 { offset += uint32(len(p.HairFile)) // Write HairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeColor.R + dest[offset+1] = p.HairTypeColor.G + dest[offset+2] = p.HairTypeColor.B + offset += 3 // Write HairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeHighlightColor.R + dest[offset+1] = p.HairTypeHighlightColor.G + dest[offset+2] = p.HairTypeHighlightColor.B + offset += 3 // Write FaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.FaceFile))) @@ -5449,12 +5863,16 @@ func (p *CreateCharacterV65534) Serialize(dest []byte) uint32 { offset += uint32(len(p.FaceFile)) // Write HairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceColor.R + dest[offset+1] = p.HairFaceColor.G + dest[offset+2] = p.HairFaceColor.B + offset += 3 // Write HairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceHighlightColor.R + dest[offset+1] = p.HairFaceHighlightColor.G + dest[offset+2] = p.HairFaceHighlightColor.B + offset += 3 // Write WingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.WingFile))) @@ -5463,12 +5881,16 @@ func (p *CreateCharacterV65534) Serialize(dest []byte) uint32 { offset += uint32(len(p.WingFile)) // Write WingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor1.ToUint32()) - offset += 4 + dest[offset] = p.WingColor1.R + dest[offset+1] = p.WingColor1.G + dest[offset+2] = p.WingColor1.B + offset += 3 // Write WingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor2.ToUint32()) - offset += 4 + dest[offset] = p.WingColor2.R + dest[offset+1] = p.WingColor2.G + dest[offset+2] = p.WingColor2.B + offset += 3 // Write ChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.ChestFile))) @@ -5477,12 +5899,16 @@ func (p *CreateCharacterV65534) Serialize(dest []byte) uint32 { offset += uint32(len(p.ChestFile)) // Write ShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.ShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.ShirtColor.R + dest[offset+1] = p.ShirtColor.G + dest[offset+2] = p.ShirtColor.B + offset += 3 // Write UnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownChestColor.R + dest[offset+1] = p.UnknownChestColor.G + dest[offset+2] = p.UnknownChestColor.B + offset += 3 // Write LegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.LegsFile))) @@ -5491,16 +5917,22 @@ func (p *CreateCharacterV65534) Serialize(dest []byte) uint32 { offset += uint32(len(p.LegsFile)) // Write PantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.PantsColor.ToUint32()) - offset += 4 + dest[offset] = p.PantsColor.R + dest[offset+1] = p.PantsColor.G + dest[offset+2] = p.PantsColor.B + offset += 3 // Write UnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownLegsColor.R + dest[offset+1] = p.UnknownLegsColor.G + dest[offset+2] = p.UnknownLegsColor.B + offset += 3 // Write Unknown9 - binary.LittleEndian.PutUint32(dest[offset:], p.Unknown9.ToUint32()) - offset += 4 + dest[offset] = p.Unknown9.R + dest[offset+1] = p.Unknown9.G + dest[offset+2] = p.Unknown9.B + offset += 3 // Write Eyes2 array for i := 0; i < 3; i++ { @@ -5563,24 +5995,34 @@ func (p *CreateCharacterV65534) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaRaceFile)) // Write SogaSkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaSkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaSkinColor.R + dest[offset+1] = p.SogaSkinColor.G + dest[offset+2] = p.SogaSkinColor.B + offset += 3 // Write SogaEyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaEyeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaEyeColor.R + dest[offset+1] = p.SogaEyeColor.G + dest[offset+2] = p.SogaEyeColor.B + offset += 3 // Write SogaHairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor1.R + dest[offset+1] = p.SogaHairColor1.G + dest[offset+2] = p.SogaHairColor1.B + offset += 3 // Write SogaHairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor2.R + dest[offset+1] = p.SogaHairColor2.G + dest[offset+2] = p.SogaHairColor2.B + offset += 3 // Write SogaHairHighlight - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairHighlight.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairHighlight.R + dest[offset+1] = p.SogaHairHighlight.G + dest[offset+2] = p.SogaHairHighlight.B + offset += 3 // Write SogaUnknown11 array for i := 0; i < 38; i++ { @@ -5595,12 +6037,16 @@ func (p *CreateCharacterV65534) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaHairFile)) // Write SogaHairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeColor.R + dest[offset+1] = p.SogaHairTypeColor.G + dest[offset+2] = p.SogaHairTypeColor.B + offset += 3 // Write SogaHairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeHighlightColor.R + dest[offset+1] = p.SogaHairTypeHighlightColor.G + dest[offset+2] = p.SogaHairTypeHighlightColor.B + offset += 3 // Write SogaFaceFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaFaceFile))) @@ -5609,12 +6055,16 @@ func (p *CreateCharacterV65534) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaFaceFile)) // Write SogaHairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceColor.R + dest[offset+1] = p.SogaHairFaceColor.G + dest[offset+2] = p.SogaHairFaceColor.B + offset += 3 // Write SogaHairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceHighlightColor.R + dest[offset+1] = p.SogaHairFaceHighlightColor.G + dest[offset+2] = p.SogaHairFaceHighlightColor.B + offset += 3 // Write SogaWingFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaWingFile))) @@ -5623,12 +6073,16 @@ func (p *CreateCharacterV65534) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaWingFile)) // Write SogaWingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor1.R + dest[offset+1] = p.SogaWingColor1.G + dest[offset+2] = p.SogaWingColor1.B + offset += 3 // Write SogaWingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaWingColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaWingColor2.R + dest[offset+1] = p.SogaWingColor2.G + dest[offset+2] = p.SogaWingColor2.B + offset += 3 // Write SogaChestFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaChestFile))) @@ -5637,12 +6091,16 @@ func (p *CreateCharacterV65534) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaChestFile)) // Write SogaShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaShirtColor.R + dest[offset+1] = p.SogaShirtColor.G + dest[offset+2] = p.SogaShirtColor.B + offset += 3 // Write SogaUnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownChestColor.R + dest[offset+1] = p.SogaUnknownChestColor.G + dest[offset+2] = p.SogaUnknownChestColor.B + offset += 3 // Write SogaLegsFile as 16-bit length-prefixed string binary.LittleEndian.PutUint16(dest[offset:], uint16(len(p.SogaLegsFile))) @@ -5651,16 +6109,22 @@ func (p *CreateCharacterV65534) Serialize(dest []byte) uint32 { offset += uint32(len(p.SogaLegsFile)) // Write SogaPantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaPantsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaPantsColor.R + dest[offset+1] = p.SogaPantsColor.G + dest[offset+2] = p.SogaPantsColor.B + offset += 3 // Write SogaUnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknownLegsColor.R + dest[offset+1] = p.SogaUnknownLegsColor.G + dest[offset+2] = p.SogaUnknownLegsColor.B + offset += 3 // Write SogaUnknown12 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaUnknown12.ToUint32()) - offset += 4 + dest[offset] = p.SogaUnknown12.R + dest[offset+1] = p.SogaUnknown12.G + dest[offset+2] = p.SogaUnknown12.B + offset += 3 // Write SogaEyes2 array for i := 0; i < 3; i++ { @@ -5753,49 +6217,49 @@ func (p *CreateCharacterV65534) Size() uint32 { size += 2 + uint32(len(p.RaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 38 size += 2 + uint32(len(p.HairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.FaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.WingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.ChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.LegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 @@ -5819,49 +6283,49 @@ func (p *CreateCharacterV65534) Size() uint32 { size += 2 + uint32(len(p.SogaRaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 38 size += 2 + uint32(len(p.SogaHairFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaFaceFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaWingFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaChestFile)) - size += 4 + size += 3 - size += 4 + size += 3 size += 2 + uint32(len(p.SogaLegsFile)) - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 * 4 diff --git a/defs/generated/login.go b/defs/generated/login.go index 8c68607..6b022ac 100644 --- a/defs/generated/login.go +++ b/defs/generated/login.go @@ -1605,8 +1605,14 @@ func (p *CharSelectProfile) Serialize(dest []byte) uint32 { for i := 0; i < 21; i++ { binary.LittleEndian.PutUint16(dest[offset:], p.Equip[i].Type) offset += 2 - binary.LittleEndian.PutUint32(dest[offset:], p.Equip[i].Color.ToUint32()) - offset += 4 + dest[offset] = p.Equip[i].Color.R + dest[offset+1] = p.Equip[i].Color.G + dest[offset+2] = p.Equip[i].Color.B + offset += 3 + dest[offset] = p.Equip[i].Highlight.R + dest[offset+1] = p.Equip[i].Highlight.G + dest[offset+2] = p.Equip[i].Highlight.B + offset += 3 } // Write HairType @@ -1812,7 +1818,7 @@ func (p *CharSelectProfile) Size() uint32 { size += 3 - size += 21 * 6 + size += 21 * 8 size += 2 @@ -2024,8 +2030,14 @@ func (p *CharSelectProfileV373) Serialize(dest []byte) uint32 { for i := 0; i < 21; i++ { binary.LittleEndian.PutUint16(dest[offset:], p.Equip[i].Type) offset += 2 - binary.LittleEndian.PutUint32(dest[offset:], p.Equip[i].Color.ToUint32()) - offset += 4 + dest[offset] = p.Equip[i].Color.R + dest[offset+1] = p.Equip[i].Color.G + dest[offset+2] = p.Equip[i].Color.B + offset += 3 + dest[offset] = p.Equip[i].Highlight.R + dest[offset+1] = p.Equip[i].Highlight.G + dest[offset+2] = p.Equip[i].Highlight.B + offset += 3 } // Write HairType @@ -2231,7 +2243,7 @@ func (p *CharSelectProfileV373) Size() uint32 { size += 3 - size += 21 * 6 + size += 21 * 8 size += 2 @@ -2474,8 +2486,14 @@ func (p *CharSelectProfileV546) Serialize(dest []byte) uint32 { for i := 0; i < 23; i++ { binary.LittleEndian.PutUint16(dest[offset:], p.Equip[i].Type) offset += 2 - binary.LittleEndian.PutUint32(dest[offset:], p.Equip[i].Color.ToUint32()) - offset += 4 + dest[offset] = p.Equip[i].Color.R + dest[offset+1] = p.Equip[i].Color.G + dest[offset+2] = p.Equip[i].Color.B + offset += 3 + dest[offset] = p.Equip[i].Highlight.R + dest[offset+1] = p.Equip[i].Highlight.G + dest[offset+2] = p.Equip[i].Highlight.B + offset += 3 } // Write HairType @@ -2643,12 +2661,16 @@ func (p *CharSelectProfileV546) Serialize(dest []byte) uint32 { offset += 2 // Write SogaSkinColorx - binary.LittleEndian.PutUint32(dest[offset:], p.SogaSkinColorx.ToUint32()) - offset += 4 + dest[offset] = p.SogaSkinColorx.R + dest[offset+1] = p.SogaSkinColorx.G + dest[offset+2] = p.SogaSkinColorx.B + offset += 3 // Write SogaEyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaEyeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaEyeColor.R + dest[offset+1] = p.SogaEyeColor.G + dest[offset+2] = p.SogaEyeColor.B + offset += 3 // Write Unknown12 array for i := 0; i < 3; i++ { @@ -2699,44 +2721,58 @@ func (p *CharSelectProfileV546) Serialize(dest []byte) uint32 { } // Write SogaHairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor1.R + dest[offset+1] = p.SogaHairColor1.G + dest[offset+2] = p.SogaHairColor1.B + offset += 3 // Write SogaChestType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.SogaChestType)) offset += 2 // Write SogaHairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor2.R + dest[offset+1] = p.SogaHairColor2.G + dest[offset+2] = p.SogaHairColor2.B + offset += 3 // Write SogaHairColor3 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor3.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor3.R + dest[offset+1] = p.SogaHairColor3.G + dest[offset+2] = p.SogaHairColor3.B + offset += 3 // Write SogaHairType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.SogaHairType)) offset += 2 // Write SogaHairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeColor.R + dest[offset+1] = p.SogaHairTypeColor.G + dest[offset+2] = p.SogaHairTypeColor.B + offset += 3 // Write SogaHairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeHighlightColor.R + dest[offset+1] = p.SogaHairTypeHighlightColor.G + dest[offset+2] = p.SogaHairTypeHighlightColor.B + offset += 3 // Write SogaHairFaceType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.SogaHairFaceType)) offset += 2 // Write SogaHairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceColor.R + dest[offset+1] = p.SogaHairFaceColor.G + dest[offset+2] = p.SogaHairFaceColor.B + offset += 3 // Write SogaHairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceHighlightColor.R + dest[offset+1] = p.SogaHairFaceHighlightColor.G + dest[offset+2] = p.SogaHairFaceHighlightColor.B + offset += 3 return offset } @@ -2787,7 +2823,7 @@ func (p *CharSelectProfileV546) Size() uint32 { size += 3 - size += 23 * 6 + size += 23 * 8 size += 2 @@ -2849,9 +2885,9 @@ func (p *CharSelectProfileV546) Size() uint32 { size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 @@ -2869,25 +2905,25 @@ func (p *CharSelectProfileV546) Size() uint32 { size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 return size } @@ -3067,19 +3103,29 @@ func (p *CharSelectProfileV562) Serialize(dest []byte) uint32 { offset += 2 // Write SkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor.R + dest[offset+1] = p.SkinColor.G + dest[offset+2] = p.SkinColor.B + offset += 3 // Write EyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.EyeColor.ToUint32()) - offset += 4 + dest[offset] = p.EyeColor.R + dest[offset+1] = p.EyeColor.G + dest[offset+2] = p.EyeColor.B + offset += 3 // Write Equip array for i := 0; i < 25; i++ { binary.LittleEndian.PutUint16(dest[offset:], p.Equip[i].Type) offset += 2 - binary.LittleEndian.PutUint32(dest[offset:], p.Equip[i].Color.ToUint32()) - offset += 4 + dest[offset] = p.Equip[i].Color.R + dest[offset+1] = p.Equip[i].Color.G + dest[offset+2] = p.Equip[i].Color.B + offset += 3 + dest[offset] = p.Equip[i].Highlight.R + dest[offset+1] = p.Equip[i].Highlight.G + dest[offset+2] = p.Equip[i].Highlight.B + offset += 3 } // Write HairType @@ -3087,52 +3133,70 @@ func (p *CharSelectProfileV562) Serialize(dest []byte) uint32 { offset += 2 // Write HairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeColor.R + dest[offset+1] = p.HairTypeColor.G + dest[offset+2] = p.HairTypeColor.B + offset += 3 // Write HairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeHighlightColor.R + dest[offset+1] = p.HairTypeHighlightColor.G + dest[offset+2] = p.HairTypeHighlightColor.B + offset += 3 // Write HairFaceType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.HairFaceType)) offset += 2 // Write HairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceColor.R + dest[offset+1] = p.HairFaceColor.G + dest[offset+2] = p.HairFaceColor.B + offset += 3 // Write HairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceHighlightColor.R + dest[offset+1] = p.HairFaceHighlightColor.G + dest[offset+2] = p.HairFaceHighlightColor.B + offset += 3 // Write ChestType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.ChestType)) offset += 2 // Write ShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.ShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.ShirtColor.R + dest[offset+1] = p.ShirtColor.G + dest[offset+2] = p.ShirtColor.B + offset += 3 // Write UnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownChestColor.R + dest[offset+1] = p.UnknownChestColor.G + dest[offset+2] = p.UnknownChestColor.B + offset += 3 // Write LegsType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.LegsType)) offset += 2 // Write PantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.PantsColor.ToUint32()) - offset += 4 + dest[offset] = p.PantsColor.R + dest[offset+1] = p.PantsColor.G + dest[offset+2] = p.PantsColor.B + offset += 3 // Write UnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownLegsColor.R + dest[offset+1] = p.UnknownLegsColor.G + dest[offset+2] = p.UnknownLegsColor.B + offset += 3 // Write Unknown9 - binary.LittleEndian.PutUint32(dest[offset:], p.Unknown9.ToUint32()) - offset += 4 + dest[offset] = p.Unknown9.R + dest[offset+1] = p.Unknown9.G + dest[offset+2] = p.Unknown9.B + offset += 3 // Write EyeType array for i := 0; i < 3; i++ { @@ -3187,12 +3251,16 @@ func (p *CharSelectProfileV562) Serialize(dest []byte) uint32 { } // Write HairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor1.ToUint32()) - offset += 4 + dest[offset] = p.HairColor1.R + dest[offset+1] = p.HairColor1.G + dest[offset+2] = p.HairColor1.B + offset += 3 // Write HairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor2.ToUint32()) - offset += 4 + dest[offset] = p.HairColor2.R + dest[offset+1] = p.HairColor2.G + dest[offset+2] = p.HairColor2.B + offset += 3 // Write Unknown11 array for i := 0; i < 13; i++ { @@ -3263,37 +3331,37 @@ func (p *CharSelectProfileV562) Size() uint32 { size += 2 - size += 4 + size += 3 - size += 4 + size += 3 - size += 25 * 6 + size += 25 * 8 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 @@ -3313,9 +3381,9 @@ func (p *CharSelectProfileV562) Size() uint32 { size += 9 - size += 4 + size += 3 - size += 4 + size += 3 size += 13 @@ -3533,19 +3601,29 @@ func (p *CharSelectProfileV887) Serialize(dest []byte) uint32 { offset += 2 // Write SkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor.R + dest[offset+1] = p.SkinColor.G + dest[offset+2] = p.SkinColor.B + offset += 3 // Write EyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.EyeColor.ToUint32()) - offset += 4 + dest[offset] = p.EyeColor.R + dest[offset+1] = p.EyeColor.G + dest[offset+2] = p.EyeColor.B + offset += 3 // Write Equip array for i := 0; i < 25; i++ { binary.LittleEndian.PutUint16(dest[offset:], p.Equip[i].Type) offset += 2 - binary.LittleEndian.PutUint32(dest[offset:], p.Equip[i].Color.ToUint32()) - offset += 4 + dest[offset] = p.Equip[i].Color.R + dest[offset+1] = p.Equip[i].Color.G + dest[offset+2] = p.Equip[i].Color.B + offset += 3 + dest[offset] = p.Equip[i].Highlight.R + dest[offset+1] = p.Equip[i].Highlight.G + dest[offset+2] = p.Equip[i].Highlight.B + offset += 3 } // Write HairType @@ -3553,64 +3631,86 @@ func (p *CharSelectProfileV887) Serialize(dest []byte) uint32 { offset += 2 // Write HairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeColor.R + dest[offset+1] = p.HairTypeColor.G + dest[offset+2] = p.HairTypeColor.B + offset += 3 // Write HairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeHighlightColor.R + dest[offset+1] = p.HairTypeHighlightColor.G + dest[offset+2] = p.HairTypeHighlightColor.B + offset += 3 // Write HairFaceType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.HairFaceType)) offset += 2 // Write HairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceColor.R + dest[offset+1] = p.HairFaceColor.G + dest[offset+2] = p.HairFaceColor.B + offset += 3 // Write HairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceHighlightColor.R + dest[offset+1] = p.HairFaceHighlightColor.G + dest[offset+2] = p.HairFaceHighlightColor.B + offset += 3 // Write WingType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.WingType)) offset += 2 // Write WingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor1.ToUint32()) - offset += 4 + dest[offset] = p.WingColor1.R + dest[offset+1] = p.WingColor1.G + dest[offset+2] = p.WingColor1.B + offset += 3 // Write WingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor2.ToUint32()) - offset += 4 + dest[offset] = p.WingColor2.R + dest[offset+1] = p.WingColor2.G + dest[offset+2] = p.WingColor2.B + offset += 3 // Write ChestType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.ChestType)) offset += 2 // Write ShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.ShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.ShirtColor.R + dest[offset+1] = p.ShirtColor.G + dest[offset+2] = p.ShirtColor.B + offset += 3 // Write UnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownChestColor.R + dest[offset+1] = p.UnknownChestColor.G + dest[offset+2] = p.UnknownChestColor.B + offset += 3 // Write LegsType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.LegsType)) offset += 2 // Write PantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.PantsColor.ToUint32()) - offset += 4 + dest[offset] = p.PantsColor.R + dest[offset+1] = p.PantsColor.G + dest[offset+2] = p.PantsColor.B + offset += 3 // Write UnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownLegsColor.R + dest[offset+1] = p.UnknownLegsColor.G + dest[offset+2] = p.UnknownLegsColor.B + offset += 3 // Write Unknown9 - binary.LittleEndian.PutUint32(dest[offset:], p.Unknown9.ToUint32()) - offset += 4 + dest[offset] = p.Unknown9.R + dest[offset+1] = p.Unknown9.G + dest[offset+2] = p.Unknown9.B + offset += 3 // Write EyeType array for i := 0; i < 3; i++ { @@ -3665,12 +3765,16 @@ func (p *CharSelectProfileV887) Serialize(dest []byte) uint32 { } // Write HairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor1.ToUint32()) - offset += 4 + dest[offset] = p.HairColor1.R + dest[offset+1] = p.HairColor1.G + dest[offset+2] = p.HairColor1.B + offset += 3 // Write HairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor2.ToUint32()) - offset += 4 + dest[offset] = p.HairColor2.R + dest[offset+1] = p.HairColor2.G + dest[offset+2] = p.HairColor2.B + offset += 3 // Write Unknown11 array for i := 0; i < 13; i++ { @@ -3683,12 +3787,16 @@ func (p *CharSelectProfileV887) Serialize(dest []byte) uint32 { offset += 2 // Write SogaSkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaSkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaSkinColor.R + dest[offset+1] = p.SogaSkinColor.G + dest[offset+2] = p.SogaSkinColor.B + offset += 3 // Write SogaEyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaEyeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaEyeColor.R + dest[offset+1] = p.SogaEyeColor.G + dest[offset+2] = p.SogaEyeColor.B + offset += 3 // Write Unknown12 array for i := 0; i < 3; i++ { @@ -3743,40 +3851,54 @@ func (p *CharSelectProfileV887) Serialize(dest []byte) uint32 { offset += 2 // Write SogaHairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor1.R + dest[offset+1] = p.SogaHairColor1.G + dest[offset+2] = p.SogaHairColor1.B + offset += 3 // Write SogaHairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor2.R + dest[offset+1] = p.SogaHairColor2.G + dest[offset+2] = p.SogaHairColor2.B + offset += 3 // Write Unknown14 - binary.LittleEndian.PutUint32(dest[offset:], p.Unknown14.ToUint32()) - offset += 4 + dest[offset] = p.Unknown14.R + dest[offset+1] = p.Unknown14.G + dest[offset+2] = p.Unknown14.B + offset += 3 // Write SogaHairType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.SogaHairType)) offset += 2 // Write SogaHairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeColor.R + dest[offset+1] = p.SogaHairTypeColor.G + dest[offset+2] = p.SogaHairTypeColor.B + offset += 3 // Write SogaHairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeHighlightColor.R + dest[offset+1] = p.SogaHairTypeHighlightColor.G + dest[offset+2] = p.SogaHairTypeHighlightColor.B + offset += 3 // Write SogaHairFaceType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.SogaHairFaceType)) offset += 2 // Write SogaHairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceColor.R + dest[offset+1] = p.SogaHairFaceColor.G + dest[offset+2] = p.SogaHairFaceColor.B + offset += 3 // Write SogaHairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceHighlightColor.R + dest[offset+1] = p.SogaHairFaceHighlightColor.G + dest[offset+2] = p.SogaHairFaceHighlightColor.B + offset += 3 // Write Unknown15 array for i := 0; i < 7; i++ { @@ -3845,43 +3967,43 @@ func (p *CharSelectProfileV887) Size() uint32 { size += 2 - size += 4 + size += 3 - size += 4 + size += 3 - size += 25 * 6 + size += 25 * 8 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 @@ -3901,17 +4023,17 @@ func (p *CharSelectProfileV887) Size() uint32 { size += 9 - size += 4 + size += 3 - size += 4 + size += 3 size += 13 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 @@ -3931,23 +4053,23 @@ func (p *CharSelectProfileV887) Size() uint32 { size += 2 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 7 @@ -4163,19 +4285,29 @@ func (p *CharSelectProfileV60085) Serialize(dest []byte) uint32 { offset += 2 // Write SkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SkinColor.R + dest[offset+1] = p.SkinColor.G + dest[offset+2] = p.SkinColor.B + offset += 3 // Write EyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.EyeColor.ToUint32()) - offset += 4 + dest[offset] = p.EyeColor.R + dest[offset+1] = p.EyeColor.G + dest[offset+2] = p.EyeColor.B + offset += 3 // Write Equip array for i := 0; i < 25; i++ { binary.LittleEndian.PutUint16(dest[offset:], p.Equip[i].Type) offset += 2 - binary.LittleEndian.PutUint32(dest[offset:], p.Equip[i].Color.ToUint32()) - offset += 4 + dest[offset] = p.Equip[i].Color.R + dest[offset+1] = p.Equip[i].Color.G + dest[offset+2] = p.Equip[i].Color.B + offset += 3 + dest[offset] = p.Equip[i].Highlight.R + dest[offset+1] = p.Equip[i].Highlight.G + dest[offset+2] = p.Equip[i].Highlight.B + offset += 3 } // Write HairType @@ -4183,64 +4315,86 @@ func (p *CharSelectProfileV60085) Serialize(dest []byte) uint32 { offset += 2 // Write HairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeColor.R + dest[offset+1] = p.HairTypeColor.G + dest[offset+2] = p.HairTypeColor.B + offset += 3 // Write HairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairTypeHighlightColor.R + dest[offset+1] = p.HairTypeHighlightColor.G + dest[offset+2] = p.HairTypeHighlightColor.B + offset += 3 // Write HairFaceType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.HairFaceType)) offset += 2 // Write HairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceColor.R + dest[offset+1] = p.HairFaceColor.G + dest[offset+2] = p.HairFaceColor.B + offset += 3 // Write HairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.HairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.HairFaceHighlightColor.R + dest[offset+1] = p.HairFaceHighlightColor.G + dest[offset+2] = p.HairFaceHighlightColor.B + offset += 3 // Write WingType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.WingType)) offset += 2 // Write WingColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor1.ToUint32()) - offset += 4 + dest[offset] = p.WingColor1.R + dest[offset+1] = p.WingColor1.G + dest[offset+2] = p.WingColor1.B + offset += 3 // Write WingColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.WingColor2.ToUint32()) - offset += 4 + dest[offset] = p.WingColor2.R + dest[offset+1] = p.WingColor2.G + dest[offset+2] = p.WingColor2.B + offset += 3 // Write ChestType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.ChestType)) offset += 2 // Write ShirtColor - binary.LittleEndian.PutUint32(dest[offset:], p.ShirtColor.ToUint32()) - offset += 4 + dest[offset] = p.ShirtColor.R + dest[offset+1] = p.ShirtColor.G + dest[offset+2] = p.ShirtColor.B + offset += 3 // Write UnknownChestColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownChestColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownChestColor.R + dest[offset+1] = p.UnknownChestColor.G + dest[offset+2] = p.UnknownChestColor.B + offset += 3 // Write LegsType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.LegsType)) offset += 2 // Write PantsColor - binary.LittleEndian.PutUint32(dest[offset:], p.PantsColor.ToUint32()) - offset += 4 + dest[offset] = p.PantsColor.R + dest[offset+1] = p.PantsColor.G + dest[offset+2] = p.PantsColor.B + offset += 3 // Write UnknownLegsColor - binary.LittleEndian.PutUint32(dest[offset:], p.UnknownLegsColor.ToUint32()) - offset += 4 + dest[offset] = p.UnknownLegsColor.R + dest[offset+1] = p.UnknownLegsColor.G + dest[offset+2] = p.UnknownLegsColor.B + offset += 3 // Write Unknown9 - binary.LittleEndian.PutUint32(dest[offset:], p.Unknown9.ToUint32()) - offset += 4 + dest[offset] = p.Unknown9.R + dest[offset+1] = p.Unknown9.G + dest[offset+2] = p.Unknown9.B + offset += 3 // Write EyeType array for i := 0; i < 3; i++ { @@ -4295,12 +4449,16 @@ func (p *CharSelectProfileV60085) Serialize(dest []byte) uint32 { } // Write HairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor1.ToUint32()) - offset += 4 + dest[offset] = p.HairColor1.R + dest[offset+1] = p.HairColor1.G + dest[offset+2] = p.HairColor1.B + offset += 3 // Write HairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.HairColor2.ToUint32()) - offset += 4 + dest[offset] = p.HairColor2.R + dest[offset+1] = p.HairColor2.G + dest[offset+2] = p.HairColor2.B + offset += 3 // Write Unknown11 array for i := 0; i < 13; i++ { @@ -4313,12 +4471,16 @@ func (p *CharSelectProfileV60085) Serialize(dest []byte) uint32 { offset += 2 // Write SogaSkinColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaSkinColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaSkinColor.R + dest[offset+1] = p.SogaSkinColor.G + dest[offset+2] = p.SogaSkinColor.B + offset += 3 // Write SogaEyeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaEyeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaEyeColor.R + dest[offset+1] = p.SogaEyeColor.G + dest[offset+2] = p.SogaEyeColor.B + offset += 3 // Write Unknown12 array for i := 0; i < 3; i++ { @@ -4373,40 +4535,54 @@ func (p *CharSelectProfileV60085) Serialize(dest []byte) uint32 { offset += 2 // Write SogaHairColor1 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor1.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor1.R + dest[offset+1] = p.SogaHairColor1.G + dest[offset+2] = p.SogaHairColor1.B + offset += 3 // Write SogaHairColor2 - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairColor2.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairColor2.R + dest[offset+1] = p.SogaHairColor2.G + dest[offset+2] = p.SogaHairColor2.B + offset += 3 // Write Unknown14 - binary.LittleEndian.PutUint32(dest[offset:], p.Unknown14.ToUint32()) - offset += 4 + dest[offset] = p.Unknown14.R + dest[offset+1] = p.Unknown14.G + dest[offset+2] = p.Unknown14.B + offset += 3 // Write SogaHairType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.SogaHairType)) offset += 2 // Write SogaHairTypeColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeColor.R + dest[offset+1] = p.SogaHairTypeColor.G + dest[offset+2] = p.SogaHairTypeColor.B + offset += 3 // Write SogaHairTypeHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairTypeHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairTypeHighlightColor.R + dest[offset+1] = p.SogaHairTypeHighlightColor.G + dest[offset+2] = p.SogaHairTypeHighlightColor.B + offset += 3 // Write SogaHairFaceType binary.LittleEndian.PutUint16(dest[offset:], uint16(p.SogaHairFaceType)) offset += 2 // Write SogaHairFaceColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceColor.R + dest[offset+1] = p.SogaHairFaceColor.G + dest[offset+2] = p.SogaHairFaceColor.B + offset += 3 // Write SogaHairFaceHighlightColor - binary.LittleEndian.PutUint32(dest[offset:], p.SogaHairFaceHighlightColor.ToUint32()) - offset += 4 + dest[offset] = p.SogaHairFaceHighlightColor.R + dest[offset+1] = p.SogaHairFaceHighlightColor.G + dest[offset+2] = p.SogaHairFaceHighlightColor.B + offset += 3 // Write Unknown15 array for i := 0; i < 7; i++ { @@ -4475,43 +4651,43 @@ func (p *CharSelectProfileV60085) Size() uint32 { size += 2 - size += 4 + size += 3 - size += 4 + size += 3 - size += 25 * 6 + size += 25 * 8 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 @@ -4531,17 +4707,17 @@ func (p *CharSelectProfileV60085) Size() uint32 { size += 9 - size += 4 + size += 3 - size += 4 + size += 3 size += 13 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 3 @@ -4561,23 +4737,23 @@ func (p *CharSelectProfileV60085) Size() uint32 { size += 2 - size += 4 + size += 3 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 2 - size += 4 + size += 3 - size += 4 + size += 3 size += 7 @@ -4771,10 +4947,14 @@ func (p *LSLoginReplyMsgV284) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -4840,8 +5020,8 @@ func (p *LSLoginReplyMsgV284) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -4997,10 +5177,14 @@ func (p *LSLoginReplyMsgV843) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -5072,8 +5256,8 @@ func (p *LSLoginReplyMsgV843) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -5237,10 +5421,14 @@ func (p *LSLoginReplyMsgV1096) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -5340,8 +5528,8 @@ func (p *LSLoginReplyMsgV1096) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -5522,10 +5710,14 @@ func (p *LSLoginReplyMsgV1142) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -5627,8 +5819,8 @@ func (p *LSLoginReplyMsgV1142) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -5810,10 +6002,14 @@ func (p *LSLoginReplyMsgV1188) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -5921,8 +6117,8 @@ func (p *LSLoginReplyMsgV1188) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -6130,10 +6326,14 @@ func (p *LSLoginReplyMsgV57080) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -6262,10 +6462,14 @@ func (p *LSLoginReplyMsgV57080) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -6334,8 +6538,8 @@ func (p *LSLoginReplyMsgV57080) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -6398,8 +6602,8 @@ func (p *LSLoginReplyMsgV57080) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -6581,10 +6785,14 @@ func (p *LSLoginReplyMsgV60100) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -6659,10 +6867,14 @@ func (p *LSLoginReplyMsgV60100) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -6692,10 +6904,14 @@ func (p *LSLoginReplyMsgV60100) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -6760,8 +6976,8 @@ func (p *LSLoginReplyMsgV60100) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -6806,8 +7022,8 @@ func (p *LSLoginReplyMsgV60100) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -6829,8 +7045,8 @@ func (p *LSLoginReplyMsgV60100) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -7031,10 +7247,14 @@ func (p *LSLoginReplyMsgV63181) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -7109,10 +7329,14 @@ func (p *LSLoginReplyMsgV63181) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -7142,10 +7366,14 @@ func (p *LSLoginReplyMsgV63181) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -7216,8 +7444,8 @@ func (p *LSLoginReplyMsgV63181) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -7262,8 +7490,8 @@ func (p *LSLoginReplyMsgV63181) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -7285,8 +7513,8 @@ func (p *LSLoginReplyMsgV63181) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -7456,10 +7684,14 @@ func (p *LSLoginReplyMsgV65534) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -7534,10 +7766,14 @@ func (p *LSLoginReplyMsgV65534) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -7567,10 +7803,14 @@ func (p *LSLoginReplyMsgV65534) Serialize(dest []byte) uint32 { offset++ dest[offset] = nestedElem.UseHighlightColor offset++ - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelColor.ToUint32()) - offset += 4 - binary.LittleEndian.PutUint32(dest[offset:], nestedElem.ModelHighlightColor.ToUint32()) - offset += 4 + dest[offset] = nestedElem.ModelColor.R + dest[offset+1] = nestedElem.ModelColor.G + dest[offset+2] = nestedElem.ModelColor.B + offset += 3 + dest[offset] = nestedElem.ModelHighlightColor.R + dest[offset+1] = nestedElem.ModelHighlightColor.G + dest[offset+2] = nestedElem.ModelHighlightColor.B + offset += 3 } @@ -7631,8 +7871,8 @@ func (p *LSLoginReplyMsgV65534) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -7677,8 +7917,8 @@ func (p *LSLoginReplyMsgV65534) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } @@ -7700,8 +7940,8 @@ func (p *LSLoginReplyMsgV65534) Size() uint32 { size += 1 size += 1 size += 1 - size += 4 - size += 4 + size += 3 + size += 3 } diff --git a/defs/generated/test.exe b/defs/generated/test.exe new file mode 100644 index 0000000..1981753 Binary files /dev/null and b/defs/generated/test.exe differ diff --git a/types/color.go b/types/color.go index 2d45560..a6655a7 100644 --- a/types/color.go +++ b/types/color.go @@ -5,58 +5,65 @@ import ( "io" ) -// Color represents an RGBA color value +// Color represents an RGB color value (3 bytes) matching EQ2's format type Color struct { R uint8 G uint8 B uint8 - A uint8 } -// NewColor creates a new Color from RGBA values -func NewColor(r, g, b, a uint8) Color { - return Color{R: r, G: g, B: b, A: a} +// NewColor creates a new Color from RGB values +func NewColor(r, g, b uint8) Color { + return Color{R: r, G: g, B: b} } -// NewColorFromUint32 creates a Color from a packed uint32 (0xAARRGGBB) +// NewColorFromUint32 creates a Color from a packed uint32 (ignores alpha, uses 0x00RRGGBB) func NewColorFromUint32(packed uint32) Color { return Color{ R: uint8((packed >> 16) & 0xFF), G: uint8((packed >> 8) & 0xFF), B: uint8(packed & 0xFF), - A: uint8((packed >> 24) & 0xFF), } } -// ToUint32 converts the color to a packed uint32 (0xAARRGGBB) +// ToUint32 converts the color to a packed uint32 (0x00RRGGBB for compatibility) func (c Color) ToUint32() uint32 { - return uint32(c.A)<<24 | uint32(c.R)<<16 | uint32(c.G)<<8 | uint32(c.B) + return uint32(c.R)<<16 | uint32(c.G)<<8 | uint32(c.B) } -// Serialize writes the color as a uint32 to a writer +// Serialize writes the color as 3 bytes (RGB) to a writer func (c Color) Serialize(w io.Writer) error { - return binary.Write(w, binary.LittleEndian, c.ToUint32()) -} - -// SerializeToBytes writes the color to a byte slice at the given offset -func (c Color) SerializeToBytes(dest []byte, offset *uint32) { - binary.LittleEndian.PutUint32(dest[*offset:], c.ToUint32()) - *offset += 4 -} - -// Size returns the serialized size of the color (always 4 bytes) -func (c Color) Size() uint32 { - return 4 -} - -// Deserialize reads a color from a reader -func (c *Color) Deserialize(r io.Reader) error { - var packed uint32 - if err := binary.Read(r, binary.LittleEndian, &packed); err != nil { + if err := binary.Write(w, binary.LittleEndian, c.R); err != nil { return err } - *c = NewColorFromUint32(packed) - return nil + if err := binary.Write(w, binary.LittleEndian, c.G); err != nil { + return err + } + return binary.Write(w, binary.LittleEndian, c.B) +} + +// SerializeToBytes writes the color as 3 bytes to a byte slice at the given offset +func (c Color) SerializeToBytes(dest []byte, offset *uint32) { + dest[*offset] = c.R + dest[*offset+1] = c.G + dest[*offset+2] = c.B + *offset += 3 +} + +// Size returns the serialized size of the color (always 3 bytes) +func (c Color) Size() uint32 { + return 3 +} + +// Deserialize reads a color (3 bytes) from a reader +func (c *Color) Deserialize(r io.Reader) error { + if err := binary.Read(r, binary.LittleEndian, &c.R); err != nil { + return err + } + if err := binary.Read(r, binary.LittleEndian, &c.G); err != nil { + return err + } + return binary.Read(r, binary.LittleEndian, &c.B) } // EQ2Color is an alias for Color specifically for EQ2 packets diff --git a/types/equipment.go b/types/equipment.go index a5a8606..0b3b233 100644 --- a/types/equipment.go +++ b/types/equipment.go @@ -6,9 +6,11 @@ import ( ) // EquipmentItem represents an equipment item with model and color information +// Matches EQ2_EquipmentItem from C++ code type EquipmentItem struct { - Type uint16 // Model/item type ID - Color Color // RGB color for the item + Type uint16 // Model/item type ID + Color Color // RGB color for the item (3 bytes) + Highlight Color // RGB highlight color for the item (3 bytes) } // Serialize writes the equipment item to a writer @@ -16,7 +18,10 @@ func (e *EquipmentItem) Serialize(w io.Writer) error { if err := binary.Write(w, binary.LittleEndian, e.Type); err != nil { return err } - return e.Color.Serialize(w) + if err := e.Color.Serialize(w); err != nil { + return err + } + return e.Highlight.Serialize(w) } // SerializeToBytes writes the equipment item to a byte slice at the given offset @@ -24,11 +29,12 @@ func (e *EquipmentItem) SerializeToBytes(dest []byte, offset *uint32) { binary.LittleEndian.PutUint16(dest[*offset:], e.Type) *offset += 2 e.Color.SerializeToBytes(dest, offset) + e.Highlight.SerializeToBytes(dest, offset) } // Size returns the serialized size of the equipment item func (e *EquipmentItem) Size() uint32 { - return 2 + e.Color.Size() // 2 bytes for type + color size + return 2 + e.Color.Size() + e.Highlight.Size() // 2 bytes for type + 3 bytes color + 3 bytes highlight = 8 bytes total } // Deserialize reads an equipment item from a reader @@ -36,5 +42,8 @@ func (e *EquipmentItem) Deserialize(r io.Reader) error { if err := binary.Read(r, binary.LittleEndian, &e.Type); err != nil { return err } - return e.Color.Deserialize(r) + if err := e.Color.Deserialize(r); err != nil { + return err + } + return e.Highlight.Deserialize(r) } \ No newline at end of file