From 425da65ed46061303604610bb539d6495b2b1f3f Mon Sep 17 00:00:00 2001 From: anon5 Date: Mon, 21 Jun 2021 18:47:26 +0000 Subject: [PATCH] Add high-level protocol (de)serialization --- ao.go | 201 + aocmds | 12 + aocmds_cmdno.go | 31 + auth.go | 9 + bytereader.go | 13 + cmd.go | 85 + cmd.sh | 11 + cmd/proxy/proxy.go | 86 + cmdno.sh | 13 + cmds.go | 13 + compression.go | 7 + deserialize.fmt | 121 + dir.go | 23 + internal/mkserialize/.gitignore | 1 + internal/mkserialize/go.mod | 5 + internal/mkserialize/go.sum | 27 + internal/mkserialize/mkserialize.go | 611 + itemdef.go | 56 + light.go | 13 + mapblk.go | 56 + minimap.go | 29 + mkpktinfos.sh | 11 + mkserialize.sh | 11 + mt.go | 26 +- nodebox.go | 39 + nodedef.go | 148 + nodemeta.go | 27 + pktinfos | 80 + pktinfos.go | 86 + playerpos.go | 74 + pointedthing.go | 69 + pos.go | 38 + proto.go | 101 + rudp/{ => cmd}/proxy/proxy.go | 0 serialize.fmt | 163 + serialize.go | 35094 ++++++++++++++++++++++++++ sound.go | 16 + stack.go | 10 +- texture.go | 3 + tileanim.go | 27 + tiledef.go | 40 + tocltcmds | 57 + tocltcmds.go | 766 + tocltcmds_cmdno.go | 121 + toolcaps.go | 45 + tosrvcmds | 23 + tosrvcmds.go | 155 + tosrvcmds_cmdno.go | 53 + vec.go | 20 + zerialize.go | 56 + 50 files changed, 38780 insertions(+), 2 deletions(-) create mode 100644 ao.go create mode 100644 aocmds create mode 100644 aocmds_cmdno.go create mode 100644 auth.go create mode 100644 bytereader.go create mode 100644 cmd.go create mode 100755 cmd.sh create mode 100644 cmd/proxy/proxy.go create mode 100755 cmdno.sh create mode 100644 cmds.go create mode 100644 compression.go create mode 100644 deserialize.fmt create mode 100644 dir.go create mode 100644 internal/mkserialize/.gitignore create mode 100644 internal/mkserialize/go.mod create mode 100644 internal/mkserialize/go.sum create mode 100644 internal/mkserialize/mkserialize.go create mode 100644 itemdef.go create mode 100644 light.go create mode 100644 mapblk.go create mode 100644 minimap.go create mode 100755 mkpktinfos.sh create mode 100755 mkserialize.sh create mode 100644 nodebox.go create mode 100644 nodedef.go create mode 100644 nodemeta.go create mode 100644 pktinfos create mode 100644 pktinfos.go create mode 100644 playerpos.go create mode 100644 pointedthing.go create mode 100644 pos.go create mode 100644 proto.go rename rudp/{ => cmd}/proxy/proxy.go (100%) create mode 100644 serialize.fmt create mode 100644 serialize.go create mode 100644 sound.go create mode 100644 texture.go create mode 100644 tileanim.go create mode 100644 tiledef.go create mode 100644 tocltcmds create mode 100644 tocltcmds.go create mode 100644 tocltcmds_cmdno.go create mode 100644 toolcaps.go create mode 100644 tosrvcmds create mode 100644 tosrvcmds.go create mode 100644 tosrvcmds_cmdno.go create mode 100644 vec.go create mode 100644 zerialize.go diff --git a/ao.go b/ao.go new file mode 100644 index 0000000..40b9983 --- /dev/null +++ b/ao.go @@ -0,0 +1,201 @@ +package mt + +import ( + "fmt" + "image/color" + "io" +) + +type AOID uint16 + +type aoType uint8 + +const genericCAO aoType = 101 + +type AOInitData struct { + // Version. + //mt:const uint8(1) + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg +} + +type AOProps struct { + // Version. + //mt:const uint8(4) + + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA +} + +type AOPos struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 +} + +type AOSprite struct { + Frame0 [2]int16 + Frames uint16 + FrameDuration float32 + ViewAngleFrames bool +} + +type AOAnim struct { + Frames [2]int32 + Speed float32 + Blend float32 + NoLoop bool +} + +type AOBonePos struct { + Pos Vec + Rot [3]float32 +} + +type AOAttach struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool +} + +type AOPhysOverride struct { + Walk, Jump, Gravity float32 + + // Player only. + NoSneak, NoSneakGlitch, OldSneak bool +} + +type AOCmdProps struct { + Props AOProps +} + +type AOCmdPos struct { + Pos AOPos +} + +type AOCmdTextureMod struct { + Mod Texture // suffix +} + +type AOCmdSprite struct { + Sprite AOSprite +} + +type AOCmdHP struct { + HP uint16 +} + +type AOCmdArmorGroups struct { + Armor []Group +} + +type AOCmdAnim struct { + Anim AOAnim +} + +type AOCmdBonePos struct { + Bone string + Pos AOBonePos +} + +type AOCmdAttach struct { + Attach AOAttach +} + +type AOCmdPhysOverride struct { + Phys AOPhysOverride +} + +type AOCmdSpawnInfant struct { + ID AOID + + // Type. + //mt:const genericCAO +} + +type AOCmdAnimSpeed struct { + Speed float32 +} + +//go:generate ./cmdno.sh aocmds AOCmd ao uint8 AOMsg newAOMsg + +type AOMsg interface { + aoCmdNo() uint8 +} + +func writeAOMsg(w io.Writer, msg AOMsg) error { + if _, err := w.Write([]byte{msg.aoCmdNo()}); err != nil { + return err + } + return serialize(w, msg) +} + +func readAOMsg(r io.Reader) (AOMsg, error) { + buf := make([]byte, 1) + if _, err := io.ReadFull(r, buf); err != nil { + return nil, err + } + newCmd, ok := newAOMsg[buf[0]] + if !ok { + return nil, fmt.Errorf("unsupported ao msg: %d", buf[0]) + } + msg := newCmd() + return msg, deserialize(r, msg) +} + +type IDAOMsg struct { + ID AOID + //mt:lenhdr 16 + Msg AOMsg + //mt:end +} diff --git a/aocmds b/aocmds new file mode 100644 index 0000000..a04350f --- /dev/null +++ b/aocmds @@ -0,0 +1,12 @@ +0 Props +1 Pos +2 TextureMod +3 Sprite +4 HP +5 ArmorGroups +6 Anim +7 BonePos +8 Attach +9 PhysOverride +11 SpawnInfant +12 AnimSpeed diff --git a/aocmds_cmdno.go b/aocmds_cmdno.go new file mode 100644 index 0000000..6d051b5 --- /dev/null +++ b/aocmds_cmdno.go @@ -0,0 +1,31 @@ +// Code generated by cmdno.sh. DO NOT EDIT. + +package mt + +func (*AOCmdProps) aoCmdNo() uint8 { return 0 } +func (*AOCmdPos) aoCmdNo() uint8 { return 1 } +func (*AOCmdTextureMod) aoCmdNo() uint8 { return 2 } +func (*AOCmdSprite) aoCmdNo() uint8 { return 3 } +func (*AOCmdHP) aoCmdNo() uint8 { return 4 } +func (*AOCmdArmorGroups) aoCmdNo() uint8 { return 5 } +func (*AOCmdAnim) aoCmdNo() uint8 { return 6 } +func (*AOCmdBonePos) aoCmdNo() uint8 { return 7 } +func (*AOCmdAttach) aoCmdNo() uint8 { return 8 } +func (*AOCmdPhysOverride) aoCmdNo() uint8 { return 9 } +func (*AOCmdSpawnInfant) aoCmdNo() uint8 { return 11 } +func (*AOCmdAnimSpeed) aoCmdNo() uint8 { return 12 } + +var newAOMsg = map[uint8]func() AOMsg{ + 0: func() AOMsg { return new(AOCmdProps) }, + 1: func() AOMsg { return new(AOCmdPos) }, + 2: func() AOMsg { return new(AOCmdTextureMod) }, + 3: func() AOMsg { return new(AOCmdSprite) }, + 4: func() AOMsg { return new(AOCmdHP) }, + 5: func() AOMsg { return new(AOCmdArmorGroups) }, + 6: func() AOMsg { return new(AOCmdAnim) }, + 7: func() AOMsg { return new(AOCmdBonePos) }, + 8: func() AOMsg { return new(AOCmdAttach) }, + 9: func() AOMsg { return new(AOCmdPhysOverride) }, + 11: func() AOMsg { return new(AOCmdSpawnInfant) }, + 12: func() AOMsg { return new(AOCmdAnimSpeed) }, +} diff --git a/auth.go b/auth.go new file mode 100644 index 0000000..5c2df14 --- /dev/null +++ b/auth.go @@ -0,0 +1,9 @@ +package mt + +type AuthMethods uint32 + +const ( + LegacyPasswd AuthMethods = 1 << iota + SRP + FirstSRP +) diff --git a/bytereader.go b/bytereader.go new file mode 100644 index 0000000..77447d0 --- /dev/null +++ b/bytereader.go @@ -0,0 +1,13 @@ +package mt + +import "io" + +type byteReader struct { + io.Reader +} + +func (br byteReader) ReadByte() (byte, error) { + buf := make([]byte, 1) + _, err := io.ReadFull(br, buf) + return buf[0], err +} diff --git a/cmd.go b/cmd.go new file mode 100644 index 0000000..db6b912 --- /dev/null +++ b/cmd.go @@ -0,0 +1,85 @@ +// Code generated by cmd.sh. DO NOT EDIT. + +package mt + +func (*ToCltHello) cmd() {} +func (*ToCltAcceptAuth) cmd() {} +func (*ToCltAcceptSudoMode) cmd() {} +func (*ToCltDenySudoMode) cmd() {} +func (*ToCltDisco) cmd() {} +func (*ToCltBlkData) cmd() {} +func (*ToCltAddNode) cmd() {} +func (*ToCltRemoveNode) cmd() {} +func (*ToCltInv) cmd() {} +func (*ToCltTimeOfDay) cmd() {} +func (*ToCltCSMRestrictionFlags) cmd() {} +func (*ToCltAddPlayerVel) cmd() {} +func (*ToCltMediaPush) cmd() {} +func (*ToCltChatMsg) cmd() {} +func (*ToCltAORmAdd) cmd() {} +func (*ToCltAOMsgs) cmd() {} +func (*ToCltHP) cmd() {} +func (*ToCltMovePlayer) cmd() {} +func (*ToCltDiscoLegacy) cmd() {} +func (*ToCltFOV) cmd() {} +func (*ToCltDeathScreen) cmd() {} +func (*ToCltMedia) cmd() {} +func (*ToCltNodeDefs) cmd() {} +func (*ToCltAnnounceMedia) cmd() {} +func (*ToCltItemDefs) cmd() {} +func (*ToCltPlaySound) cmd() {} +func (*ToCltStopSound) cmd() {} +func (*ToCltPrivs) cmd() {} +func (*ToCltInvFormspec) cmd() {} +func (*ToCltDetachedInv) cmd() {} +func (*ToCltShowFormspec) cmd() {} +func (*ToCltMovement) cmd() {} +func (*ToCltSpawnParticle) cmd() {} +func (*ToCltAddParticleSpawner) cmd() {} +func (*ToCltAddHUD) cmd() {} +func (*ToCltRmHUD) cmd() {} +func (*ToCltChangeHUD) cmd() {} +func (*ToCltHUDFlags) cmd() {} +func (*ToCltSetHotbarParam) cmd() {} +func (*ToCltBreath) cmd() {} +func (*ToCltSkyParams) cmd() {} +func (*ToCltOverrideDayNightRatio) cmd() {} +func (*ToCltLocalPlayerAnim) cmd() {} +func (*ToCltEyeOffset) cmd() {} +func (*ToCltDelParticleSpawner) cmd() {} +func (*ToCltCloudParams) cmd() {} +func (*ToCltFadeSound) cmd() {} +func (*ToCltUpdatePlayerList) cmd() {} +func (*ToCltModChanMsg) cmd() {} +func (*ToCltModChanSig) cmd() {} +func (*ToCltNodeMetasChanged) cmd() {} +func (*ToCltSunParams) cmd() {} +func (*ToCltMoonParams) cmd() {} +func (*ToCltStarParams) cmd() {} +func (*ToCltSRPBytesSaltB) cmd() {} +func (*ToCltFormspecPrepend) cmd() {} +func (*ToCltMinimapModes) cmd() {} + +func (*ToSrvNil) cmd() {} +func (*ToSrvInit) cmd() {} +func (*ToSrvInit2) cmd() {} +func (*ToSrvModChanJoin) cmd() {} +func (*ToSrvModChanLeave) cmd() {} +func (*ToSrvModChanMsg) cmd() {} +func (*ToSrvPlayerPos) cmd() {} +func (*ToSrvGotBlks) cmd() {} +func (*ToSrvDeletedBlks) cmd() {} +func (*ToSrvInvAction) cmd() {} +func (*ToSrvChatMsg) cmd() {} +func (*ToSrvFallDmg) cmd() {} +func (*ToSrvSelectItem) cmd() {} +func (*ToSrvRespawn) cmd() {} +func (*ToSrvInteract) cmd() {} +func (*ToSrvRemovedSounds) cmd() {} +func (*ToSrvNodeMetaFields) cmd() {} +func (*ToSrvInvFields) cmd() {} +func (*ToSrvReqMedia) cmd() {} +func (*ToSrvCltReady) cmd() {} +func (*ToSrvFirstSRP) cmd() {} +func (*ToSrvSRPBytesA) cmd() {} +func (*ToSrvSRPBytesM) cmd() {} diff --git a/cmd.sh b/cmd.sh new file mode 100755 index 0000000..ed887f3 --- /dev/null +++ b/cmd.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +( + echo // Code generated by cmd.sh. DO NOT EDIT. + echo + echo package mt + echo + awk '{ print "func (*ToClt"$2") cmd() {}" }' tocltcmds + echo + awk '{ print "func (*ToSrv"$2") cmd() {}" }' tosrvcmds +) | gofmt >cmd.go diff --git a/cmd/proxy/proxy.go b/cmd/proxy/proxy.go new file mode 100644 index 0000000..33cc354 --- /dev/null +++ b/cmd/proxy/proxy.go @@ -0,0 +1,86 @@ +/* +Proxy is a Minetest proxy server +supporting multiple concurrent connections. + +Usage: + proxy dial:port listen:port +where dial:port is the server address +and listen:port is the address to listen on. +*/ +package main + +import ( + "errors" + "fmt" + "log" + "net" + "os" + + "github.com/anon55555/mt" +) + +func main() { + if len(os.Args) != 3 { + fmt.Fprintln(os.Stderr, "usage: proxy dial:port listen:port") + os.Exit(1) + } + + srvaddr, err := net.ResolveUDPAddr("udp", os.Args[1]) + if err != nil { + log.Fatal(err) + } + + lc, err := net.ListenPacket("udp", os.Args[2]) + if err != nil { + log.Fatal(err) + } + defer lc.Close() + + l := mt.Listen(lc) + for { + clt, err := l.Accept() + if err != nil { + log.Print(err) + continue + } + + log.Print(clt.RemoteAddr().String() + " connected") + + conn, err := net.DialUDP("udp", nil, srvaddr) + if err != nil { + log.Print(err) + continue + } + srv := mt.Connect(conn) + + go proxy(clt, srv) + go proxy(srv, clt) + } +} + +func proxy(src, dest mt.Peer) { + s := fmt.Sprint(src.ID(), " (", src.RemoteAddr(), "): ") + + for { + pkt, err := src.Recv() + if err != nil { + if errors.Is(err, net.ErrClosed) { + if err := src.WhyClosed(); err != nil { + log.Print(s, "disconnected: ", err) + } else { + log.Print(s, "disconnected") + } + break + } + + log.Print(s, err) + continue + } + + if _, err := dest.Send(pkt); err != nil { + log.Print(err) + } + } + + dest.Close() +} diff --git a/cmdno.sh b/cmdno.sh new file mode 100755 index 0000000..186df7b --- /dev/null +++ b/cmdno.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +( + echo // Code generated by cmdno.sh. DO NOT EDIT. + echo + echo package mt + echo + awk '{ print "func (*'$2'"$2") '$3'CmdNo() '$4' { return "$1" }" }' $1 + echo + echo "var $6 = map[$4]func() $5{" + awk '{ print "\t"$1": func() '$5' { return new('$2'"$2") }," }' $1 + echo } +) | gofmt >$1_cmdno.go diff --git a/cmds.go b/cmds.go new file mode 100644 index 0000000..7a4f6bd --- /dev/null +++ b/cmds.go @@ -0,0 +1,13 @@ +//go:generate ./mkpktinfos.sh +//go:generate ./cmd.sh + +package mt + +import ( + "github.com/anon55555/mt/rudp" +) + +type Cmd interface { + DefaultPktInfo() rudp.PktInfo + cmd() +} diff --git a/compression.go b/compression.go new file mode 100644 index 0000000..b7fafb9 --- /dev/null +++ b/compression.go @@ -0,0 +1,7 @@ +package mt + +type CompressionModes uint16 + +const ( + _ CompressionModes = 1 << iota +) diff --git a/deserialize.fmt b/deserialize.fmt new file mode 100644 index 0000000..d2a7c67 --- /dev/null +++ b/deserialize.fmt @@ -0,0 +1,121 @@ + func readBuf(r io.Reader, n int) []byte { + buf := make([]byte, n) + _, err := io.ReadFull(r, buf) + chk(err) + return buf + } + + func read8 (r io.Reader) uint8 { return readBuf(r, 1)[0] } + func read16(r io.Reader) uint16 { return be.Uint16(readBuf(r, 2)) } + func read32(r io.Reader) uint32 { return be.Uint32(readBuf(r, 4)) } + func read64(r io.Reader) uint64 { return be.Uint64(readBuf(r, 8)) } + +byte *p = read8(r) +uint8 *p = read8(r) +uint16 *p = read16(r) +uint32 *p = read32(r) +uint64 *p = read64(r) + +int8 *p = int8(read8(r)) +int16 *p = int16(read16(r)) +int32 *p = int32(read32(r)) +int64 *p = int64(read64(r)) + +bool switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + +float32 *p = math.Float32frombits(read32(r)) +float64 *p = math.Float64frombits(read64(r)) + +AOMsg { + var err error + *p, err = readAOMsg(r) + chk(err) + } + +image/color.NRGBA *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + +map[uint16]*NodeMeta { + r, err := zlib.NewReader(byteReader{r}) + chk(err) + + switch ver := read8(r); ver { + case 0: + *p = nil + case 2: + n := read16(r) + *p = make(map[uint16]*NodeMeta, n) + for ; n > 0; n-- { + pos := read16(r) + nm := new(NodeMeta) + chk(deserialize(r, nm)) + (*p)[pos] = nm + } + default: + chk(fmt.Errorf("unsupported nodemetas version: %d", ver)) + } + + chk(r.Close()) + } + +map[[3]int16]*NodeMeta { + r, err := zlib.NewReader(byteReader{r}) + chk(err) + + switch ver := read8(r); ver { + case 0: + *p = nil + case 2: + n := read16(r) + *p = make(map[[3]int16]*NodeMeta, n) + for ; n > 0; n-- { + var pos [3]int16 + for i := range pos { + pos[i] = int16(read16(r)) + } + nm := new(NodeMeta) + chk(deserialize(r, nm)) + (*p)[pos] = nm + } + default: + chk(fmt.Errorf("unsupported nodemetas version: %d", ver)) + } + + chk(r.Close()) + } + +PointedThing { + var err error + *p, err = readPointedThing(r) + chk(err) + } + +[]AOMsg { // For AOInitData.Msgs. + *p = make([]AOMsg, read8(r)) + for i := range *p { + r := &io.LimitedReader{r, int64(read32(r))} + msg, err := readAOMsg(r) + chk(err) + (*p)[i] = msg + if r.N > 0 { + chk(fmt.Errorf("%d bytes of trailing data", r.N)) + } + } + } + +[]NodeDef { // For ToCltNodeDefs.Defs. + *p = make([]NodeDef, read16(r)) + r := &io.LimitedReader{r, int64(read32(r))} + for i := range *p { + (*p)[i].deserialize(r) + } + if r.N > 0 { + chk(fmt.Errorf("%d bytes of trailing data", r.N)) + } + } diff --git a/dir.go b/dir.go new file mode 100644 index 0000000..693db98 --- /dev/null +++ b/dir.go @@ -0,0 +1,23 @@ +package mt + +// A Dir represents a direction parallel to an axis. +type Dir uint8 + +const ( + East Dir = iota // +X + Above // +Y + North // +Z + South // -Z + Below // -Y + West // -X + NoDir +) + +// Opposite returns the Dir's opposite. +// NoDir is its own opposite. +func (d Dir) Opposite() Dir { + if d >= NoDir { + return NoDir + } + return 5 - d +} diff --git a/internal/mkserialize/.gitignore b/internal/mkserialize/.gitignore new file mode 100644 index 0000000..4dfd263 --- /dev/null +++ b/internal/mkserialize/.gitignore @@ -0,0 +1 @@ +mkserialize diff --git a/internal/mkserialize/go.mod b/internal/mkserialize/go.mod new file mode 100644 index 0000000..d845806 --- /dev/null +++ b/internal/mkserialize/go.mod @@ -0,0 +1,5 @@ +module mkserialize + +go 1.16 + +require golang.org/x/tools v0.1.3 diff --git a/internal/mkserialize/go.sum b/internal/mkserialize/go.sum new file mode 100644 index 0000000..e652f3e --- /dev/null +++ b/internal/mkserialize/go.sum @@ -0,0 +1,27 @@ +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/mkserialize/mkserialize.go b/internal/mkserialize/mkserialize.go new file mode 100644 index 0000000..9b4b019 --- /dev/null +++ b/internal/mkserialize/mkserialize.go @@ -0,0 +1,611 @@ +package main + +import ( + "bufio" + "flag" + "fmt" + "go/ast" + "go/printer" + "go/token" + "go/types" + "io" + "log" + "os" + "strconv" + "strings" + + "golang.org/x/tools/go/ast/astutil" + "golang.org/x/tools/go/packages" +) + +var ( + pkg *packages.Package + + serializeFmt = make(map[string]string) + deserializeFmt = make(map[string]string) + + uint8T = types.Universe.Lookup("uint8").Type() + byteT = types.Universe.Lookup("byte").Type() + + serialize []*types.Named + inSerialize = make(map[string]bool) + + consts = make(map[*ast.StructType][]*ast.Comment) +) + +func structPragma(c *ast.Comment, sp *[]func(), expr string, de bool) { + fields := strings.SplitN(strings.TrimPrefix(c.Text, "//mt:"), " ", 2) + arg := "" + if len(fields) == 2 { + arg = fields[1] + } + switch fields[0] { + case "const": + tv, err := types.Eval(pkg.Fset, pkg.Types, c.Slash, arg) + if err != nil { + error(c.Pos(), err) + } + + if de { + fmt.Println("{") + x := newVar() + fmt.Println("var", x, typeStr(tv.Type)) + genSerialize(tv.Type, x, token.NoPos, nil, de) + fmt.Println("if", x, "!=", "(", tv.Value, ")", + `{ chk(fmt.Errorf("const %v: %v",`, tv.Value, ",", x, ")) }") + fmt.Println("}") + } else { + v := newVar() + fmt.Println("{", v, ":=", arg) + genSerialize(tv.Type, v, c.Slash+token.Pos(len("//mt:const ")), nil, de) + fmt.Println("}") + } + case "assert": + fmt.Printf("if !("+arg+") {", expr) + fmt.Printf("chk(errors.New(%q))\n", "assertion failed: "+arg) + fmt.Println("}") + case "zlib": + if de { + fmt.Println("{ r, err := zlib.NewReader(byteReader{r}); chk(err)") + *sp = append(*sp, func() { + fmt.Println("chk(r.Close()) }") + }) + } else { + fmt.Println("{ w := zlib.NewWriter(w)") + *sp = append(*sp, func() { + fmt.Println("chk(w.Close()) }") + }) + } + case "lenhdr": + if arg != "8" && arg != "16" && arg != "32" { + error(c.Pos(), "usage: //mt:lenhdr (8|16|32)") + } + + fmt.Println("{") + + if !de { + fmt.Println("ow := w") + fmt.Println("w := new(bytes.Buffer)") + } + + var cg ast.CommentGroup + if de { + t := types.Universe.Lookup("uint" + arg).Type() + fmt.Println("var n", t) + genSerialize(t, "n", token.NoPos, nil, de) + if arg == "64" { + fmt.Println(`if n > math.MaxInt64 { panic("too big len") }`) + } + fmt.Println("r := &io.LimitedReader{r, int64(n)}") + } else { + switch arg { + case "8", "32": + cg.List = []*ast.Comment{{Text: "//mt:len" + arg}} + case "16": + } + } + + *sp = append(*sp, func() { + if de { + fmt.Println("if r.N > 0", + `{ chk(fmt.Errorf("%d bytes of trailing data", r.N)) }`) + } else { + fmt.Println("{") + fmt.Println("buf := w") + fmt.Println("w := ow") + byteSlice := types.NewSlice(types.Typ[types.Byte]) + genSerialize(byteSlice, "buf.Bytes()", token.NoPos, &cg, de) + fmt.Println("}") + } + + fmt.Println("}") + }) + case "end": + (*sp)[len(*sp)-1]() + *sp = (*sp)[:len(*sp)-1] + case "if": + fmt.Printf(strings.TrimPrefix(c.Text, "//mt:")+" {\n", expr) + *sp = append(*sp, func() { + fmt.Println("}") + }) + case "ifde": + if !de { + fmt.Println("/*") + } + } +} + +func genSerialize(t types.Type, expr string, pos token.Pos, doc *ast.CommentGroup, de bool) { + var lenhdr types.Type = types.Typ[types.Uint16] + + useMethod := true + if doc != nil { + for _, c := range doc.List { + pragma := true + switch c.Text { + case "//mt:utf16": + t = types.NewSlice(types.Typ[types.Uint16]) + if de { + v := newVar() + fmt.Println("var", v, typeStr(t)) + defer fmt.Println(expr + " = string(utf16.Decode(" + v + "))") + expr = v + } else { + expr = "utf16.Encode([]rune(" + expr + "))" + } + pos = token.NoPos + case "//mt:raw": + lenhdr = nil + case "//mt:len8": + lenhdr = types.Typ[types.Uint8] + case "//mt:len32": + lenhdr = types.Typ[types.Uint32] + case "//mt:opt": + fmt.Println("if err := pcall(func() {") + defer fmt.Println("}); err != nil && err != io.EOF", + "{ chk(err) }") + default: + pragma = false + } + if pragma { + useMethod = false + } + } + } + + str := types.TypeString(t, types.RelativeTo(pkg.Types)) + if de { + if or, ok := deserializeFmt[str]; ok { + fmt.Println("{") + fmt.Println("p := &" + expr) + fmt.Print(or) + fmt.Println("}") + return + } + } else { + if or, ok := serializeFmt[str]; ok { + fmt.Println("{") + fmt.Println("x := " + expr) + fmt.Print(or) + fmt.Println("}") + return + } + } + + expr = "(" + expr + ")" + + switch t := t.(type) { + case *types.Named: + if !useMethod { + t := t.Underlying() + genSerialize(t, "*(*"+typeStr(t)+")("+"&"+expr+")", pos, doc, de) + return + } + + method := "Serialize" + if de { + method = "Deserialize" + } + for i := 0; i < t.NumMethods(); i++ { + m := t.Method(i) + if m.Name() == method { + rw := "w" + if de { + rw = "r" + } + fmt.Println("chk(" + expr + "." + method + "(" + rw + "))") + return + } + } + + mkSerialize(t) + + fmt.Println("if err := pcall(func() {") + if de { + fmt.Println(expr + ".deserialize(r)") + } else { + fmt.Println(expr + ".serialize(w)") + } + fmt.Println("}); err != nil", + `{`, + `if err == io.EOF { chk(io.EOF) };`, + `chk(fmt.Errorf("%s: %w", `+strconv.Quote(t.String())+`, err))`, + `}`) + case *types.Struct: + st := pos2node(pos)[0].(*ast.StructType) + + a := consts[st] + b := st.Fields.List + + // Merge sorted slices. + c := make([]ast.Node, 0, len(a)+len(b)) + for i, j := 0, 0; i < len(a) || j < len(b); { + if i < len(a) && (j >= len(b) || a[i].Pos() < b[j].Pos()) { + c = append(c, a[i]) + i++ + } else { + c = append(c, b[j]) + j++ + } + } + + var ( + stk []func() + i int + ) + for _, field := range c { + switch field := field.(type) { + case *ast.Comment: + structPragma(field, &stk, expr, de) + case *ast.Field: + n := len(field.Names) + if n == 0 { + n = 1 + } + for ; n > 0; n-- { + f := t.Field(i) + genSerialize(f.Type(), expr+"."+f.Name(), field.Type.Pos(), field.Doc, de) + i++ + } + } + } + + if len(stk) > 0 { + error(pos, "missing //mt:end") + } + case *types.Basic: + switch t.Kind() { + case types.String: + byteSlice := types.NewSlice(types.Typ[types.Byte]) + if de { + v := newVar() + fmt.Println("var", v, byteSlice) + genSerialize(byteSlice, v, token.NoPos, doc, de) + fmt.Println(expr, "=", "string(", v, ")") + } else { + genSerialize(byteSlice, "[]byte"+expr, token.NoPos, doc, de) + } + default: + error(pos, "can't serialize ", t) + } + case *types.Slice: + if de { + if lenhdr != nil { + v := newVar() + fmt.Println("var", v, lenhdr) + genSerialize(lenhdr, v, pos, nil, de) + fmt.Printf("%s = make(%v, %s)\n", + expr, typeStr(t), v) + genSerialize(types.NewArray(t.Elem(), 0), expr, pos, nil, de) + } else { + fmt.Println("for {") + v := newVar() + fmt.Println("var", v, typeStr(t.Elem())) + fmt.Println("err := pcall(func() {") + if pos.IsValid() { + pos = pos2node(pos)[0].(*ast.ArrayType).Elt.Pos() + } + genSerialize(t.Elem(), v, pos, nil, de) + fmt.Println("})") + fmt.Println("if err == io.EOF { break }") + fmt.Println(expr + " = append(" + expr + ", " + v + ")") + fmt.Println("chk(err)") + fmt.Println("}") + } + } else { + if lenhdr != nil { + fmt.Println("if len("+expr+") >", + "math.Max"+strings.Title(lenhdr.String()), + "{ chk(ErrTooLong) }") + genSerialize(lenhdr, lenhdr.String()+"(len("+expr+"))", pos, nil, de) + } + genSerialize(types.NewArray(t.Elem(), 0), expr, pos, nil, de) + } + case *types.Array: + et := t.Elem() + if et == byteT || et == uint8T { + if de { + fmt.Println("{", + "_, err := io.ReadFull(r, "+expr+"[:]);", + "chk(err)", + "}") + } else { + fmt.Println("{", + "_, err := w.Write("+expr+"[:]);", + "chk(err)", + "}") + } + break + } + i := newVar() + fmt.Println("for", i, ":= range", expr, "{") + if pos.IsValid() { + pos = pos2node(pos)[0].(*ast.ArrayType).Elt.Pos() + } + genSerialize(et, expr+"["+i+"]", pos, nil, de) + fmt.Println("}") + default: + error(pos, "can't serialize ", t) + } +} + +func readOverrides(path string, override map[string]string) { + f, err := os.Open(path) + if err != nil { + log.Fatal(err) + } + defer f.Close() + + b := bufio.NewReader(f) + line := 0 + col1 := "" + for { + ln, err := b.ReadString('\n') + if err != nil { + if err == io.EOF { + if len(ln) > 0 { + log.Fatal("no newline at end of ", f.Name()) + } + return + } + log.Fatal(err) + } + line++ + + if ln == "\n" { + continue + } + + fields := strings.SplitN(ln, "\t", 2) + if len(fields) == 1 { + log.Fatal(f.Name(), ":", line, ": missing tab") + } + if fields[0] != "" { + col1 = fields[0] + } + + if col1 == "" { + fmt.Print(fields[1]) + continue + } + + override[col1] += fields[1] + } +} + +func mkSerialize(t *types.Named) { + if !inSerialize[t.String()] { + serialize = append(serialize, t) + inSerialize[t.String()] = true + } +} + +var varNo int + +func newVar() string { + varNo++ + return fmt.Sprint("local", varNo) +} + +func pos2node(pos token.Pos) []ast.Node { + return interval2node(pos, pos) +} + +func interval2node(start, end token.Pos) []ast.Node { + for _, f := range pkg.Syntax { + if f.Pos() <= start && end <= f.End() { + if path, _ := astutil.PathEnclosingInterval(f, start, end); path != nil { + return path + } + } + } + return nil +} + +func error(pos token.Pos, a ...interface{}) { + if !pos.IsValid() { + log.Fatal(a...) + } + log.Fatal(append([]interface{}{pkg.Fset.Position(pos), ": "}, a...)...) +} + +func typeStr(t types.Type) string { + return types.TypeString(t, func(p *types.Package) string { + if p == pkg.Types { + return "" + } + + return p.Name() + }) +} + +var typeNames = []string{ + "ToSrvNil", + "ToSrvInit", + "ToSrvInit2", + "ToSrvModChanJoin", + "ToSrvModChanLeave", + "ToSrvModChanMsg", + "ToSrvPlayerPos", + "ToSrvGotBlks", + "ToSrvDeletedBlks", + "ToSrvInvAction", + "ToSrvChatMsg", + "ToSrvFallDmg", + "ToSrvSelectItem", + "ToSrvRespawn", + "ToSrvInteract", + "ToSrvRemovedSounds", + "ToSrvNodeMetaFields", + "ToSrvInvFields", + "ToSrvReqMedia", + "ToSrvCltReady", + "ToSrvFirstSRP", + "ToSrvSRPBytesA", + "ToSrvSRPBytesM", + + "ToCltHello", + "ToCltAcceptAuth", + "ToCltAcceptSudoMode", + "ToCltDenySudoMode", + "ToCltDisco", + "ToCltBlkData", + "ToCltAddNode", + "ToCltRemoveNode", + "ToCltInv", + "ToCltTimeOfDay", + "ToCltCSMRestrictionFlags", + "ToCltAddPlayerVel", + "ToCltMediaPush", + "ToCltChatMsg", + "ToCltAORmAdd", + "ToCltAOMsgs", + "ToCltHP", + "ToCltMovePlayer", + "ToCltDiscoLegacy", + "ToCltFOV", + "ToCltDeathScreen", + "ToCltMedia", + "ToCltNodeDefs", + "ToCltAnnounceMedia", + "ToCltItemDefs", + "ToCltPlaySound", + "ToCltStopSound", + "ToCltPrivs", + "ToCltInvFormspec", + "ToCltDetachedInv", + "ToCltShowFormspec", + "ToCltMovement", + "ToCltSpawnParticle", + "ToCltAddParticleSpawner", + "ToCltAddHUD", + "ToCltRmHUD", + "ToCltChangeHUD", + "ToCltHUDFlags", + "ToCltSetHotbarParam", + "ToCltBreath", + "ToCltSkyParams", + "ToCltOverrideDayNightRatio", + "ToCltLocalPlayerAnim", + "ToCltEyeOffset", + "ToCltDelParticleSpawner", + "ToCltCloudParams", + "ToCltFadeSound", + "ToCltUpdatePlayerList", + "ToCltModChanMsg", + "ToCltModChanSig", + "ToCltNodeMetasChanged", + "ToCltSunParams", + "ToCltMoonParams", + "ToCltStarParams", + "ToCltSRPBytesSaltB", + "ToCltFormspecPrepend", + + "AOCmdProps", + "AOCmdPos", + "AOCmdTextureMod", + "AOCmdSprite", + "AOCmdHP", + "AOCmdArmorGroups", + "AOCmdAnim", + "AOCmdBonePos", + "AOCmdAttach", + "AOCmdPhysOverride", + "AOCmdSpawnInfant", + "AOCmdAnimSpeed", + + "NodeMeta", + "MinimapMode", + "NodeDef", + "PointedNode", + "PointedAO", +} + +func main() { + log.SetFlags(0) + log.SetPrefix("mkserialize: ") + + flag.Parse() + + cfg := &packages.Config{Mode: packages.NeedSyntax | + packages.NeedName | + packages.NeedDeps | + packages.NeedImports | + packages.NeedTypes | + packages.NeedTypesInfo} + pkgs, err := packages.Load(cfg, flag.Args()...) + if err != nil { + log.Fatal(err) + } + if packages.PrintErrors(pkgs) > 0 { + os.Exit(1) + } + + if len(pkgs) != 1 { + log.Fatal("must be exactly 1 package") + } + pkg = pkgs[0] + + fmt.Println("package", pkg.Name) + + readOverrides("serialize.fmt", serializeFmt) + readOverrides("deserialize.fmt", deserializeFmt) + + for _, f := range pkg.Syntax { + for _, cg := range f.Comments { + for _, c := range cg.List { + if !strings.HasPrefix(c.Text, "//mt:") { + continue + } + st := interval2node(c.Pos(), c.End())[1].(*ast.StructType) + consts[st] = append(consts[st], c) + } + } + } + + for _, name := range typeNames { + obj := pkg.Types.Scope().Lookup(name) + if obj == nil { + log.Println("undeclared identifier: ", name) + continue + } + mkSerialize(obj.Type().(*types.Named)) + } + + for i := 0; i < len(serialize); i++ { + for _, de := range []bool{false, true} { + t := serialize[i] + sig := "serialize(w io.Writer)" + if de { + sig = "deserialize(r io.Reader)" + } + fmt.Println("\nfunc (obj *" + t.Obj().Name() + ") " + sig + " {") + pos := t.Obj().Pos() + tExpr := pos2node(pos)[1].(*ast.TypeSpec).Type + var b strings.Builder + printer.Fprint(&b, pkg.Fset, tExpr) + genSerialize(pkg.TypesInfo.Types[tExpr].Type, "*(*("+b.String()+"))(obj)", tExpr.Pos(), nil, de) + fmt.Println("}") + } + } +} diff --git a/itemdef.go b/itemdef.go new file mode 100644 index 0000000..a761b65 --- /dev/null +++ b/itemdef.go @@ -0,0 +1,56 @@ +package mt + +import "image/color" + +type ItemType uint8 + +const ( + _ ItemType = iota + NodeItem + CraftItem + ToolItem +) + +// An ItemDef defines the properties of an item. +type ItemDef struct { + //mt:lenhdr 16 + + // Version. + //mt:const uint8(6) + + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + + //mt:end +} diff --git a/light.go b/light.go new file mode 100644 index 0000000..b086591 --- /dev/null +++ b/light.go @@ -0,0 +1,13 @@ +package mt + +const ( + MaxLight = 14 // Maximum artificial light. + SunLight = 15 +) + +type LightBank uint8 + +const ( + Day LightBank = iota + Night +) diff --git a/mapblk.go b/mapblk.go new file mode 100644 index 0000000..f40a504 --- /dev/null +++ b/mapblk.go @@ -0,0 +1,56 @@ +package mt + +type MapBlkFlags uint8 + +const ( + BlkIsUnderground MapBlkFlags = 1 << iota + BlkDayNightDiff + BlkLightExpired + BlkNotGenerated +) + +type LitFromBlks uint16 + +const AlwaysLitFrom LitFromBlks = 0xf000 + +func LitFrom(d Dir, b LightBank) LitFromBlks { + return 1 << (uint8(d) + uint8(6*b)) +} + +type MapBlk struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:const uint8(2) // Size of param0 in bytes. + //mt:const uint8(1 + 1) // Size of param1 and param2 combined, in bytes. + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + //mt:end + + NodeMetas map[uint16]*NodeMeta + + // net info + //mt:const uint8(2) // version +} + +// Pos2BlkPos converts a node position to a MapBlk position and index. +func Pos2Blkpos(pos [3]int16) (blkpos [3]int16, i uint16) { + for j := range pos { + blkpos[j] = pos[j] >> 4 + i |= uint16(pos[j]&0xf) << (4 * j) + } + + return +} + +// BlkPos2Pos converts a MapBlk position and index to a node position. +func Blkpos2Pos(blkpos [3]int16, i uint16) (pos [3]int16) { + for j := range pos { + pos[j] = blkpos[j]<<4 | int16(i>>(4*j)&0xf) + } + + return +} diff --git a/minimap.go b/minimap.go new file mode 100644 index 0000000..f0817f7 --- /dev/null +++ b/minimap.go @@ -0,0 +1,29 @@ +package mt + +type MinimapType uint16 + +const ( + NoMinimap MinimapType = iota + SurfaceMinimap + RadarMinimap + TextureMinimap +) + +type MinimapMode struct { + Type MinimapType + Label string + Size uint16 + Texture + Scale uint16 +} + +// DefaultMinimap is the initial set of MinimapModes used by the client. +var DefaultMinimap = []MinimapMode{ + {Type: NoMinimap}, + {Type: SurfaceMinimap, Size: 256}, + {Type: SurfaceMinimap, Size: 128}, + {Type: SurfaceMinimap, Size: 64}, + {Type: RadarMinimap, Size: 512}, + {Type: RadarMinimap, Size: 256}, + {Type: RadarMinimap, Size: 128}, +} diff --git a/mkpktinfos.sh b/mkpktinfos.sh new file mode 100755 index 0000000..3d5d5e7 --- /dev/null +++ b/mkpktinfos.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +( + echo // Code generated by mkpktinfos.sh. DO NOT EDIT. + echo + echo package mt + echo + awk '{ + print "func (*"$1") DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{"$2", "($3 == "unrel" ? "true" : "false")"} }" + }' pktinfos +) | goimports >pktinfos.go diff --git a/mkserialize.sh b/mkserialize.sh new file mode 100755 index 0000000..c758a85 --- /dev/null +++ b/mkserialize.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +rm -f serialize.go + +( + echo // Code generated by mkserialize.sh. DO NOT EDIT. + echo + internal/mkserialize/mkserialize | goimports +) >>serialize.go.tmp && +mv serialize.go.tmp serialize.go || +rm serialize.go.tmp diff --git a/mt.go b/mt.go index c5d665d..e7ca84a 100644 --- a/mt.go +++ b/mt.go @@ -1,5 +1,29 @@ +// Package mt implements the high-level Minetest protocol. +// This version is compatible with +// https://github.com/ClamityAnarchy/minetest/commit/66adeade9d5c45a5499b5ad1ad4bd91dae82482a. package mt +type Node struct { + Param0 Content + Param1, Param2 uint8 +} + +type Content uint16 + +const ( + Unknown Content = 125 + Air Content = 126 + Ignore Content = 127 +) + +type Group struct { + Name string + Rating int16 +} + type Field struct { - Name, Value string + Name string + + //mt:len32 + Value string } diff --git a/nodebox.go b/nodebox.go new file mode 100644 index 0000000..46d704c --- /dev/null +++ b/nodebox.go @@ -0,0 +1,39 @@ +package mt + +type Box [2]Vec + +type NodeBoxType uint8 + +const ( + CubeBox NodeBoxType = iota + FixedBox + MountedBox + LeveledBox + ConnectedBox + maxBox +) + +type DirBoxes struct { + Top, Bot []Box + Front, Left, Back, Right []Box +} + +type NodeBox struct { + //mt:const uint8(6) + + Type NodeBoxType + //mt:assert %s.Type < maxBox + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + //mt:end + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + //mt:end + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + //mt:end +} diff --git a/nodedef.go b/nodedef.go new file mode 100644 index 0000000..5606452 --- /dev/null +++ b/nodedef.go @@ -0,0 +1,148 @@ +package mt + +import "image/color" + +type Param1Type uint8 + +const ( + P1Nothing Param1Type = iota + P1Light +) + +type Param2Type uint8 + +const ( + P2Nibble Param2Type = iota + P2Byte + P2Flowing + P2FaceDir + P2Mounted + P2Leveled + P2Rotation + P2Mesh + P2Color + P2ColorFaceDir + P2ColorMounted + P2GlassLikeLevel +) + +// A DrawType specifies how a node is drawn. +type DrawType uint8 + +const ( + DrawCube DrawType = iota + DrawNothing + DrawLiquid + DrawFlowing + DrawLikeGlass + DrawAllFaces + DrawAllFacesOpt + DrawTorch + DrawSign + DrawPlant + DrawFence + DrawRail + DrawNodeBox + DrawGlassFrame + DrawFire + DrawGlassFrameOpt + DrawMesh + DrawRootedPlant +) + +type WaveType uint8 + +const ( + NotWaving WaveType = iota + PlantWaving // Only top waves from side to side. + LeafWaving // Wave side to side. + LiquidWaving // Wave up and down. +) + +type LiquidType uint8 + +const ( + NotALiquid LiquidType = iota + FlowingLiquid + LiquidSrc +) + +// AlphaUse specifies how the alpha channel of a texture is used. +type AlphaUse uint8 + +const ( + Blend AlphaUse = iota + Mask // "Rounded" to either fully opaque or transparent. + Opaque + Legacy +) + +type NodeDef struct { + Param0 Content + + //mt:lenhdr 16 + + //mt:const uint8(13) + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + + //mt:end +} diff --git a/nodemeta.go b/nodemeta.go new file mode 100644 index 0000000..b91abbf --- /dev/null +++ b/nodemeta.go @@ -0,0 +1,27 @@ +package mt + +type NodeMeta struct { + //mt:len32 + Fields []NodeMetaField + + Inv Inv +} + +type NodeMetaField struct { + Field + Private bool +} + +func (nm *NodeMeta) Field(name string) *NodeMetaField { + if nm == nil { + return nil + } + + for i, f := range nm.Fields { + if f.Name == name { + return &nm.Fields[i] + } + } + + return nil +} diff --git a/pktinfos b/pktinfos new file mode 100644 index 0000000..e6316f2 --- /dev/null +++ b/pktinfos @@ -0,0 +1,80 @@ +ToCltHello 0 rel +ToCltAcceptAuth 0 rel +ToCltAcceptSudoMode 0 rel +ToCltDenySudoMode 0 rel +ToCltDisco 0 rel +ToCltBlkData 2 rel +ToCltAddNode 0 rel +ToCltRemoveNode 0 rel +ToCltInv 0 rel +ToCltTimeOfDay 0 rel +ToCltCSMRestrictionFlags 0 rel +ToCltAddPlayerVel 0 rel +ToCltMediaPush 0 rel +ToCltChatMsg 0 rel +ToCltAORmAdd 0 rel +ToCltAOMsgs 0 rel +ToCltHP 0 rel +ToCltMovePlayer 0 rel +ToCltDiscoLegacy 0 rel +ToCltFOV 0 rel +ToCltDeathScreen 0 rel +ToCltMedia 2 rel +ToCltNodeDefs 0 rel +ToCltAnnounceMedia 0 rel +ToCltItemDefs 0 rel +ToCltPlaySound 0 rel +ToCltStopSound 0 rel +ToCltPrivs 0 rel +ToCltInvFormspec 0 rel +ToCltDetachedInv 0 rel +ToCltShowFormspec 0 rel +ToCltMovement 0 rel +ToCltSpawnParticle 0 rel +ToCltAddParticleSpawner 0 rel +ToCltAddHUD 1 rel +ToCltRmHUD 1 rel +ToCltChangeHUD 1 rel +ToCltHUDFlags 1 rel +ToCltSetHotbarParam 1 rel +ToCltBreath 0 rel +ToCltSkyParams 0 rel +ToCltOverrideDayNightRatio 0 rel +ToCltLocalPlayerAnim 0 rel +ToCltEyeOffset 0 rel +ToCltDelParticleSpawner 0 rel +ToCltCloudParams 0 rel +ToCltFadeSound 0 rel +ToCltUpdatePlayerList 0 rel +ToCltModChanMsg 0 rel +ToCltModChanSig 0 rel +ToCltNodeMetasChanged 0 rel +ToCltSunParams 0 rel +ToCltMoonParams 0 rel +ToCltStarParams 0 rel +ToCltSRPBytesSaltB 0 rel +ToCltFormspecPrepend 0 rel +ToCltMinimapModes 0 rel +ToSrvNil 0 rel +ToSrvInit 1 unrel +ToSrvInit2 1 rel +ToSrvModChanJoin 0 rel +ToSrvModChanLeave 0 rel +ToSrvModChanMsg 0 rel +ToSrvPlayerPos 0 unrel +ToSrvGotBlks 2 rel +ToSrvDeletedBlks 2 rel +ToSrvInvAction 0 rel +ToSrvChatMsg 0 rel +ToSrvFallDmg 0 rel +ToSrvSelectItem 0 rel +ToSrvRespawn 0 rel +ToSrvInteract 0 rel +ToSrvRemovedSounds 2 rel +ToSrvNodeMetaFields 0 rel +ToSrvInvFields 0 rel +ToSrvReqMedia 1 rel +ToSrvCltReady 1 rel +ToSrvFirstSRP 1 rel +ToSrvSRPBytesA 1 rel +ToSrvSRPBytesM 1 rel diff --git a/pktinfos.go b/pktinfos.go new file mode 100644 index 0000000..4b725da --- /dev/null +++ b/pktinfos.go @@ -0,0 +1,86 @@ +// Code generated by mkpktinfos.sh. DO NOT EDIT. + +package mt + +import "github.com/anon55555/mt/rudp" + +func (*ToCltHello) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltAcceptAuth) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltAcceptSudoMode) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltDenySudoMode) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltDisco) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltBlkData) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{2, false} } +func (*ToCltAddNode) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltRemoveNode) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltInv) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltTimeOfDay) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltCSMRestrictionFlags) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltAddPlayerVel) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltMediaPush) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltChatMsg) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltAORmAdd) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltAOMsgs) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltHP) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltMovePlayer) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltDiscoLegacy) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltFOV) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltDeathScreen) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltMedia) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{2, false} } +func (*ToCltNodeDefs) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltAnnounceMedia) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltItemDefs) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltPlaySound) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltStopSound) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltPrivs) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltInvFormspec) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltDetachedInv) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltShowFormspec) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltMovement) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltSpawnParticle) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltAddParticleSpawner) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltAddHUD) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{1, false} } +func (*ToCltRmHUD) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{1, false} } +func (*ToCltChangeHUD) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{1, false} } +func (*ToCltHUDFlags) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{1, false} } +func (*ToCltSetHotbarParam) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{1, false} } +func (*ToCltBreath) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltSkyParams) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltOverrideDayNightRatio) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltLocalPlayerAnim) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltEyeOffset) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltDelParticleSpawner) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltCloudParams) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltFadeSound) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltUpdatePlayerList) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltModChanMsg) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltModChanSig) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltNodeMetasChanged) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltSunParams) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltMoonParams) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltStarParams) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltSRPBytesSaltB) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltFormspecPrepend) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToCltMinimapModes) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToSrvNil) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToSrvInit) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{1, true} } +func (*ToSrvInit2) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{1, false} } +func (*ToSrvModChanJoin) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToSrvModChanLeave) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToSrvModChanMsg) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToSrvPlayerPos) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, true} } +func (*ToSrvGotBlks) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{2, false} } +func (*ToSrvDeletedBlks) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{2, false} } +func (*ToSrvInvAction) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToSrvChatMsg) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToSrvFallDmg) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToSrvSelectItem) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToSrvRespawn) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToSrvInteract) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToSrvRemovedSounds) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{2, false} } +func (*ToSrvNodeMetaFields) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToSrvInvFields) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{0, false} } +func (*ToSrvReqMedia) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{1, false} } +func (*ToSrvCltReady) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{1, false} } +func (*ToSrvFirstSRP) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{1, false} } +func (*ToSrvSRPBytesA) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{1, false} } +func (*ToSrvSRPBytesM) DefaultPktInfo() rudp.PktInfo { return rudp.PktInfo{1, false} } diff --git a/playerpos.go b/playerpos.go new file mode 100644 index 0000000..946bbae --- /dev/null +++ b/playerpos.go @@ -0,0 +1,74 @@ +package mt + +type Keys uint32 + +const ( + ForwardKey Keys = 1 << iota + BackwardKey + LeftKey + RightKey + JumpKey + SpecialKey + SneakKey + DigKey + PlaceKey + ZoomKey +) + +type PlayerPos struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. +} + +func (p PlayerPos) Pos() (pos Pos) { + for i := range pos { + pos[i] = float32(p.Pos100[i]) / 100 + } + return +} + +func (p *PlayerPos) SetPos(pos Pos) { + for i, x := range pos { + p.Pos100[i] = int32(x * 100) + } +} + +func (p PlayerPos) Vel() (vel Vec) { + for i := range vel { + vel[i] = float32(p.Vel100[i]) / 100 + } + return +} + +func (p *PlayerPos) SetVel(vel Vec) { + for i, x := range vel { + p.Vel100[i] = int32(x * 100) + } +} + +func (p PlayerPos) Pitch() float32 { + return float32(p.Pitch100) / 100 +} + +func (p *PlayerPos) SetPitch(pitch float32) { + p.Pitch100 = int32(pitch * 100) +} + +func (p PlayerPos) Yaw() float32 { + return float32(p.Yaw100) / 100 +} + +func (p *PlayerPos) SetYaw(yaw float32) { + p.Yaw100 = int32(yaw * 100) +} + +func (p PlayerPos) FOV() float32 { + return float32(p.FOV80) / 80 +} + +func (p *PlayerPos) SetFOV(fov float32) { + p.FOV80 = uint8(fov * 80) +} diff --git a/pointedthing.go b/pointedthing.go new file mode 100644 index 0000000..c73130f --- /dev/null +++ b/pointedthing.go @@ -0,0 +1,69 @@ +package mt + +import ( + "fmt" + "io" +) + +type PointedThing interface { + pt() +} + +func (*PointedNode) pt() {} +func (*PointedAO) pt() {} + +type PointedNode struct { + Under, Above [3]int16 +} + +func PointedSameNode(pos [3]int16) PointedThing { + return &PointedNode{pos, pos} +} + +type PointedAO struct { + ID AOID +} + +func writePointedThing(w io.Writer, pt PointedThing) error { + buf := make([]byte, 2) + buf[0] = 0 + switch pt.(type) { + case nil: + buf[1] = 0 + case *PointedNode: + buf[1] = 1 + case *PointedAO: + buf[1] = 2 + default: + panic(pt) + } + if _, err := w.Write(buf); err != nil { + return err + } + if pt == nil { + return nil + } + return serialize(w, pt) +} + +func readPointedThing(r io.Reader) (PointedThing, error) { + buf := make([]byte, 2) + if _, err := io.ReadFull(r, buf); err != nil { + return nil, err + } + if buf[0] != 0 { + return nil, fmt.Errorf("unsupported PointedThing version: %d", buf[0]) + } + var pt PointedThing + switch buf[1] { + case 0: + return nil, nil + case 1: + pt = new(PointedNode) + case 2: + pt = new(PointedAO) + case 3: + return nil, fmt.Errorf("invalid PointedThing type: %d", buf[1]) + } + return pt, deserialize(r, pt) +} diff --git a/pos.go b/pos.go new file mode 100644 index 0000000..7242a6e --- /dev/null +++ b/pos.go @@ -0,0 +1,38 @@ +package mt + +import "math" + +// A Pos is a world space position, +// represented as a Vec from the origin. +type Pos Vec + +// Add returns p+v. +func (p Pos) Add(v Vec) Pos { + return Pos(Vec(p).Add(v)) +} + +// Sub returns p-v. +func (p Pos) Sub(v Vec) Pos { + return Pos(Vec(p).Sub(v)) +} + +// From returns the Vec which moves to p from q. +func (p Pos) From(q Pos) Vec { + return Vec(p).Sub(Vec(q)) +} + +// Int returns the position of the node which the Pos is inside. +func (p Pos) Int() (ip [3]int16) { + for i := range ip { + ip[i] = int16(math.Round(float64(p[i]) / 10)) + } + return +} + +// IntPos returns the Pos of the node at ip. +func IntPos(ip [3]int16) (p Pos) { + for i := range p { + p[i] = 10 * float32(ip[i]) + } + return +} diff --git a/proto.go b/proto.go new file mode 100644 index 0000000..b859a39 --- /dev/null +++ b/proto.go @@ -0,0 +1,101 @@ +package mt + +import ( + "fmt" + "io" + "net" + + "github.com/anon55555/mt/rudp" +) + +const ChannelCount = rudp.ChannelCount + +// A Pkt is a deserialized rudp.Pkt. +type Pkt struct { + Cmd + rudp.PktInfo +} + +// Peer wraps rudp.Conn, adding (de)serialization. +type Peer struct { + *rudp.Conn +} + +func (p Peer) Send(pkt Pkt) (ack <-chan struct{}, err error) { + var cmdNo uint16 + if p.IsSrv() { + cmdNo = pkt.Cmd.(ToSrvCmd).toSrvCmdNo() + } else { + cmdNo = pkt.Cmd.(ToCltCmd).toCltCmdNo() + } + + r, w := io.Pipe() + go func() (err error) { + defer w.CloseWithError(err) + + buf := make([]byte, 2) + be.PutUint16(buf, cmdNo) + if _, err := w.Write(buf); err != nil { + return err + } + return serialize(w, pkt.Cmd) + }() + + return p.Conn.Send(rudp.Pkt{r, pkt.PktInfo}) +} + +// SendCmd is equivalent to Send(Pkt{cmd, cmd.DefaultPktInfo()}). +func (p Peer) SendCmd(cmd Cmd) (ack <-chan struct{}, err error) { + return p.Send(Pkt{cmd, cmd.DefaultPktInfo()}) +} + +func (p Peer) Recv() (_ Pkt, rerr error) { + pkt, err := p.Conn.Recv() + if err != nil { + return Pkt{}, err + } + + buf := make([]byte, 2) + if _, err := io.ReadFull(pkt, buf); err != nil { + return Pkt{}, err + } + cmdNo := be.Uint16(buf) + + var newCmd func() Cmd + if p.IsSrv() { + newCmd = newToCltCmd[cmdNo] + } else { + newCmd = newToSrvCmd[cmdNo] + } + if newCmd == nil { + return Pkt{}, fmt.Errorf("unknown cmd: %d", cmdNo) + } + cmd := newCmd() + + if err := deserialize(pkt, cmd); err != nil { + return Pkt{}, fmt.Errorf("%T: %w", cmd, err) + } + + extra, err := io.ReadAll(pkt) + if len(extra) > 0 { + err = rudp.TrailingDataError(extra) + } + return Pkt{cmd, pkt.PktInfo}, err +} + +func Connect(conn net.Conn) Peer { + return Peer{rudp.Connect(conn)} +} + +type Listener struct { + *rudp.Listener +} + +func Listen(conn net.PacketConn) Listener { + return Listener{rudp.Listen(conn)} +} + +func (l Listener) Accept() (Peer, error) { + rpeer, err := l.Listener.Accept() + return Peer{rpeer}, err +} diff --git a/rudp/proxy/proxy.go b/rudp/cmd/proxy/proxy.go similarity index 100% rename from rudp/proxy/proxy.go rename to rudp/cmd/proxy/proxy.go diff --git a/serialize.fmt b/serialize.fmt new file mode 100644 index 0000000..c157001 --- /dev/null +++ b/serialize.fmt @@ -0,0 +1,163 @@ + func write8(w io.Writer, x uint8) { + _, err := w.Write([]byte{x}) + chk(err) + } + + func write16(w io.Writer, x uint16) { + buf := make([]byte, 2) + be.PutUint16(buf, x) + _, err := w.Write(buf) + chk(err) + } + + func write32(w io.Writer, x uint32) { + buf := make([]byte, 4) + be.PutUint32(buf, x) + _, err := w.Write(buf) + chk(err) + } + + func write64(w io.Writer, x uint64) { + buf := make([]byte, 8) + be.PutUint64(buf, x) + _, err := w.Write(buf) + chk(err) + } + +byte write8(w, uint8(x)) +uint8 write8(w, uint8(x)) +uint16 write16(w, uint16(x)) +uint32 write32(w, uint32(x)) +uint64 write64(w, uint64(x)) + +int8 write8(w, uint8(x)) +int16 write16(w, uint16(x)) +int32 write32(w, uint32(x)) +int64 write64(w, uint64(x)) + +bool if x { write8(w, 1) } else { write8(w, 0) } + +float32 write32(w, math.Float32bits(x)) +float64 write64(w, math.Float64bits(x)) + +AOMsg writeAOMsg(w, x) + +image/color.NRGBA w.Write([]byte{x.A, x.R, x.G, x.B}) + +map[uint16]*NodeMeta { + w := zlib.NewWriter(w) + + if x == nil { + write8(w, 0) + } else { + write8(w, 2) + if len(x) > math.MaxUint16 { + chk(ErrTooLong) + } + write16(w, uint16(len(x))) + keys := make([]uint16, 0, len(x)) + for key := range x { + keys = append(keys, key) + } + sort.Slice(keys, func(i, j int) bool { + i2pos := func(i int) [3]int16 { + return Blkpos2Pos([3]int16{}, keys[i]) + } + + p, q := i2pos(i), i2pos(j) + + for i := range p { + switch { + case p[i] < q[i]: + return true + case p[i] > q[i]: + return false + } + } + + return false + }) + for _, key := range keys { + write16(w, key) + chk(serialize(w, x[key])) + } + } + + chk(w.Close()) + } + +map[[3]int16]*NodeMeta { + w := zlib.NewWriter(w) + + if x == nil { + write8(w, 0) + } else { + write8(w, 2) + if len(x) > math.MaxUint16 { + chk(ErrTooLong) + } + write16(w, uint16(len(x))) + keys := make([][3]int16, 0, len(x)) + for key := range x { + keys = append(keys, key) + } + sort.Slice(keys, func(i, j int) bool { + p, q := keys[i], keys[j] + + for i := range p { + switch { + case p[i] < q[i]: + return true + case p[i] > q[i]: + return false + } + } + + return false + }) + for _, key := range keys { + for _, n := range key { + write16(w, uint16(n)) + } + chk(serialize(w, x[key])) + } + } + + chk(w.Close()) + } + +PointedThing chk(writePointedThing(w, x)) + +[]AOMsg { // For AOInitData.Msgs + if len(x) > math.MaxUint8 { + chk(ErrTooLong) + } + write8(w, uint8(len(x))) + for _, msg := range x { + var b bytes.Buffer + chk(writeAOMsg(&b, msg)) + if b.Len() > math.MaxUint32 { + chk(ErrTooLong) + } + write32(w, uint32(b.Len())) + _, err := b.WriteTo(w) + chk(err) + } + } + +[]NodeDef { // For ToCltNodeDefs.Defs + if len(x) > math.MaxUint16 { + chk(ErrTooLong) + } + write16(w, uint16(len(x))) + var b bytes.Buffer + for i := range x { + x[i].serialize(&b) + } + if b.Len() > math.MaxUint32 { + chk(ErrTooLong) + } + write32(w, uint32(b.Len())) + _, err := b.WriteTo(w) + chk(err) + } diff --git a/serialize.go b/serialize.go new file mode 100644 index 0000000..892e9f3 --- /dev/null +++ b/serialize.go @@ -0,0 +1,35094 @@ +// Code generated by mkserialize.sh. DO NOT EDIT. + +package mt + +import ( + "bytes" + "compress/zlib" + "crypto/sha1" + "errors" + "fmt" + "image/color" + "io" + "math" + "sort" + "unicode/utf16" +) + +func write8(w io.Writer, x uint8) { + _, err := w.Write([]byte{x}) + chk(err) +} + +func write16(w io.Writer, x uint16) { + buf := make([]byte, 2) + be.PutUint16(buf, x) + _, err := w.Write(buf) + chk(err) +} + +func write32(w io.Writer, x uint32) { + buf := make([]byte, 4) + be.PutUint32(buf, x) + _, err := w.Write(buf) + chk(err) +} + +func write64(w io.Writer, x uint64) { + buf := make([]byte, 8) + be.PutUint64(buf, x) + _, err := w.Write(buf) + chk(err) +} +func readBuf(r io.Reader, n int) []byte { + buf := make([]byte, n) + _, err := io.ReadFull(r, buf) + chk(err) + return buf +} + +func read8(r io.Reader) uint8 { return readBuf(r, 1)[0] } +func read16(r io.Reader) uint16 { return be.Uint16(readBuf(r, 2)) } +func read32(r io.Reader) uint32 { return be.Uint32(readBuf(r, 4)) } +func read64(r io.Reader) uint64 { return be.Uint64(readBuf(r, 8)) } + +func (obj *ToSrvNil) serialize(w io.Writer) { +} + +func (obj *ToSrvNil) deserialize(r io.Reader) { +} + +func (obj *ToSrvInit) serialize(w io.Writer) { + { + x := (*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).SerializeVer + write8(w, uint8(x)) + } + if err := pcall(func() { + ((*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).SupportedCompression).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.CompressionModes", err)) + } + { + x := (*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).MinProtoVer + write16(w, uint16(x)) + } + { + x := (*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).MaxProtoVer + write16(w, uint16(x)) + } + if len(([]byte((*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).PlayerName))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).PlayerName)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).PlayerName))[:]) + chk(err) + } + if err := pcall(func() { + { + x := (*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).SendFullItemMeta + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + }); err != nil && err != io.EOF { + chk(err) + } +} + +func (obj *ToSrvInit) deserialize(r io.Reader) { + { + p := &(*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).SerializeVer + *p = read8(r) + } + if err := pcall(func() { + ((*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).SupportedCompression).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.CompressionModes", err)) + } + { + p := &(*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).MinProtoVer + *p = read16(r) + } + { + p := &(*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).MaxProtoVer + *p = read16(r) + } + var local1 []uint8 + var local2 uint16 + { + p := &local2 + *p = read16(r) + } + (local1) = make([]uint8, local2) + { + _, err := io.ReadFull(r, (local1)[:]) + chk(err) + } + ((*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).PlayerName) = string(local1) + if err := pcall(func() { + { + p := &(*(*(struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool + }))(obj)).SendFullItemMeta + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + }); err != nil && err != io.EOF { + chk(err) + } +} + +func (obj *ToSrvInit2) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + Lang string + }))(obj)).Lang))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Lang string + }))(obj)).Lang)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Lang string + }))(obj)).Lang))[:]) + chk(err) + } +} + +func (obj *ToSrvInit2) deserialize(r io.Reader) { + var local3 []uint8 + var local4 uint16 + { + p := &local4 + *p = read16(r) + } + (local3) = make([]uint8, local4) + { + _, err := io.ReadFull(r, (local3)[:]) + chk(err) + } + ((*(*(struct { + Lang string + }))(obj)).Lang) = string(local3) +} + +func (obj *ToSrvModChanJoin) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + Channel string + }))(obj)).Channel))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Channel string + }))(obj)).Channel)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Channel string + }))(obj)).Channel))[:]) + chk(err) + } +} + +func (obj *ToSrvModChanJoin) deserialize(r io.Reader) { + var local5 []uint8 + var local6 uint16 + { + p := &local6 + *p = read16(r) + } + (local5) = make([]uint8, local6) + { + _, err := io.ReadFull(r, (local5)[:]) + chk(err) + } + ((*(*(struct { + Channel string + }))(obj)).Channel) = string(local5) +} + +func (obj *ToSrvModChanLeave) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + Channel string + }))(obj)).Channel))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Channel string + }))(obj)).Channel)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Channel string + }))(obj)).Channel))[:]) + chk(err) + } +} + +func (obj *ToSrvModChanLeave) deserialize(r io.Reader) { + var local7 []uint8 + var local8 uint16 + { + p := &local8 + *p = read16(r) + } + (local7) = make([]uint8, local8) + { + _, err := io.ReadFull(r, (local7)[:]) + chk(err) + } + ((*(*(struct { + Channel string + }))(obj)).Channel) = string(local7) +} + +func (obj *ToSrvModChanMsg) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + Channel string + Msg string + }))(obj)).Channel))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Channel string + Msg string + }))(obj)).Channel)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Channel string + Msg string + }))(obj)).Channel))[:]) + chk(err) + } + if len(([]byte((*(*(struct { + Channel string + Msg string + }))(obj)).Msg))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Channel string + Msg string + }))(obj)).Msg)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Channel string + Msg string + }))(obj)).Msg))[:]) + chk(err) + } +} + +func (obj *ToSrvModChanMsg) deserialize(r io.Reader) { + var local9 []uint8 + var local10 uint16 + { + p := &local10 + *p = read16(r) + } + (local9) = make([]uint8, local10) + { + _, err := io.ReadFull(r, (local9)[:]) + chk(err) + } + ((*(*(struct { + Channel string + Msg string + }))(obj)).Channel) = string(local9) + var local11 []uint8 + var local12 uint16 + { + p := &local12 + *p = read16(r) + } + (local11) = make([]uint8, local12) + { + _, err := io.ReadFull(r, (local11)[:]) + chk(err) + } + ((*(*(struct { + Channel string + Msg string + }))(obj)).Msg) = string(local11) +} + +func (obj *ToSrvPlayerPos) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Pos PlayerPos + }))(obj)).Pos).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.PlayerPos", err)) + } +} + +func (obj *ToSrvPlayerPos) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Pos PlayerPos + }))(obj)).Pos).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.PlayerPos", err)) + } +} + +func (obj *ToSrvGotBlks) serialize(w io.Writer) { + if len(((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks)) > math.MaxUint8 { + chk(ErrTooLong) + } + { + x := uint8(len(((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks))) + write8(w, uint8(x)) + } + for local13 := range (*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks { + for local14 := range ((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks)[local13] { + { + x := (((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks)[local13])[local14] + write16(w, uint16(x)) + } + } + } +} + +func (obj *ToSrvGotBlks) deserialize(r io.Reader) { + var local15 uint8 + { + p := &local15 + *p = read8(r) + } + ((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks) = make([][3]int16, local15) + for local16 := range (*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks { + for local17 := range ((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks)[local16] { + { + p := &(((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks)[local16])[local17] + *p = int16(read16(r)) + } + } + } +} + +func (obj *ToSrvDeletedBlks) serialize(w io.Writer) { + if len(((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks)) > math.MaxUint8 { + chk(ErrTooLong) + } + { + x := uint8(len(((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks))) + write8(w, uint8(x)) + } + for local18 := range (*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks { + for local19 := range ((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks)[local18] { + { + x := (((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks)[local18])[local19] + write16(w, uint16(x)) + } + } + } +} + +func (obj *ToSrvDeletedBlks) deserialize(r io.Reader) { + var local20 uint8 + { + p := &local20 + *p = read8(r) + } + ((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks) = make([][3]int16, local20) + for local21 := range (*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks { + for local22 := range ((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks)[local21] { + { + p := &(((*(*(struct { + //mt:len8 + Blks [][3]int16 + }))(obj)).Blks)[local21])[local22] + *p = int16(read16(r)) + } + } + } +} + +func (obj *ToSrvInvAction) serialize(w io.Writer) { + { + _, err := w.Write(([]byte((*(*(struct { + //mt:raw + Action string + }))(obj)).Action))[:]) + chk(err) + } +} + +func (obj *ToSrvInvAction) deserialize(r io.Reader) { + var local23 []uint8 + for { + var local24 uint8 + err := pcall(func() { + { + p := &local24 + *p = read8(r) + } + }) + if err == io.EOF { + break + } + (local23) = append((local23), local24) + chk(err) + } + ((*(*(struct { + //mt:raw + Action string + }))(obj)).Action) = string(local23) +} + +func (obj *ToSrvChatMsg) serialize(w io.Writer) { + if len((utf16.Encode([]rune((*(*(struct { + //mt:utf16 + Msg string + }))(obj)).Msg)))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len((utf16.Encode([]rune((*(*(struct { + //mt:utf16 + Msg string + }))(obj)).Msg))))) + write16(w, uint16(x)) + } + for local25 := range utf16.Encode([]rune((*(*(struct { + //mt:utf16 + Msg string + }))(obj)).Msg)) { + { + x := (utf16.Encode([]rune((*(*(struct { + //mt:utf16 + Msg string + }))(obj)).Msg)))[local25] + write16(w, uint16(x)) + } + } +} + +func (obj *ToSrvChatMsg) deserialize(r io.Reader) { + var local26 []uint16 + var local27 uint16 + { + p := &local27 + *p = read16(r) + } + (local26) = make([]uint16, local27) + for local28 := range local26 { + { + p := &(local26)[local28] + *p = read16(r) + } + } + (*(*(struct { + //mt:utf16 + Msg string + }))(obj)).Msg = string(utf16.Decode(local26)) +} + +func (obj *ToSrvFallDmg) serialize(w io.Writer) { + { + x := (*(*(struct { + Amount uint16 + }))(obj)).Amount + write16(w, uint16(x)) + } +} + +func (obj *ToSrvFallDmg) deserialize(r io.Reader) { + { + p := &(*(*(struct { + Amount uint16 + }))(obj)).Amount + *p = read16(r) + } +} + +func (obj *ToSrvSelectItem) serialize(w io.Writer) { + { + x := (*(*(struct { + Slot uint16 + }))(obj)).Slot + write16(w, uint16(x)) + } +} + +func (obj *ToSrvSelectItem) deserialize(r io.Reader) { + { + p := &(*(*(struct { + Slot uint16 + }))(obj)).Slot + *p = read16(r) + } +} + +func (obj *ToSrvRespawn) serialize(w io.Writer) { +} + +func (obj *ToSrvRespawn) deserialize(r io.Reader) { +} + +func (obj *ToSrvInteract) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Action Interaction + ItemSlot uint16 + //mt:lenhdr 32 + Pointed PointedThing + //mt:end + Pos PlayerPos + }))(obj)).Action).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Interaction", err)) + } + { + x := (*(*(struct { + Action Interaction + ItemSlot uint16 + //mt:lenhdr 32 + Pointed PointedThing + //mt:end + Pos PlayerPos + }))(obj)).ItemSlot + write16(w, uint16(x)) + } + { + ow := w + w := new(bytes.Buffer) + { + x := (*(*(struct { + Action Interaction + ItemSlot uint16 + //mt:lenhdr 32 + Pointed PointedThing + //mt:end + Pos PlayerPos + }))(obj)).Pointed + chk(writePointedThing(w, x)) + } + { + buf := w + w := ow + if len((buf.Bytes())) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len((buf.Bytes()))) + write32(w, uint32(x)) + } + { + _, err := w.Write((buf.Bytes())[:]) + chk(err) + } + } + } + if err := pcall(func() { + ((*(*(struct { + Action Interaction + ItemSlot uint16 + //mt:lenhdr 32 + Pointed PointedThing + //mt:end + Pos PlayerPos + }))(obj)).Pos).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.PlayerPos", err)) + } +} + +func (obj *ToSrvInteract) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Action Interaction + ItemSlot uint16 + //mt:lenhdr 32 + Pointed PointedThing + //mt:end + Pos PlayerPos + }))(obj)).Action).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Interaction", err)) + } + { + p := &(*(*(struct { + Action Interaction + ItemSlot uint16 + //mt:lenhdr 32 + Pointed PointedThing + //mt:end + Pos PlayerPos + }))(obj)).ItemSlot + *p = read16(r) + } + { + var n uint32 + { + p := &n + *p = read32(r) + } + r := &io.LimitedReader{r, int64(n)} + { + p := &(*(*(struct { + Action Interaction + ItemSlot uint16 + //mt:lenhdr 32 + Pointed PointedThing + //mt:end + Pos PlayerPos + }))(obj)).Pointed + { + var err error + *p, err = readPointedThing(r) + chk(err) + } + } + if r.N > 0 { + chk(fmt.Errorf("%d bytes of trailing data", r.N)) + } + } + if err := pcall(func() { + ((*(*(struct { + Action Interaction + ItemSlot uint16 + //mt:lenhdr 32 + Pointed PointedThing + //mt:end + Pos PlayerPos + }))(obj)).Pos).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.PlayerPos", err)) + } +} + +func (obj *ToSrvRemovedSounds) serialize(w io.Writer) { + if len(((*(*(struct { + IDs []SoundID + }))(obj)).IDs)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + IDs []SoundID + }))(obj)).IDs))) + write16(w, uint16(x)) + } + for local29 := range (*(*(struct { + IDs []SoundID + }))(obj)).IDs { + if err := pcall(func() { + (((*(*(struct { + IDs []SoundID + }))(obj)).IDs)[local29]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundID", err)) + } + } +} + +func (obj *ToSrvRemovedSounds) deserialize(r io.Reader) { + var local30 uint16 + { + p := &local30 + *p = read16(r) + } + ((*(*(struct { + IDs []SoundID + }))(obj)).IDs) = make([]SoundID, local30) + for local31 := range (*(*(struct { + IDs []SoundID + }))(obj)).IDs { + if err := pcall(func() { + (((*(*(struct { + IDs []SoundID + }))(obj)).IDs)[local31]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundID", err)) + } + } +} + +func (obj *ToSrvNodeMetaFields) serialize(w io.Writer) { + for local32 := range (*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Pos { + { + x := ((*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Pos)[local32] + write16(w, uint16(x)) + } + } + if len(([]byte((*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Formname))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Formname)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Formname))[:]) + chk(err) + } + if len(((*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Fields)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Fields))) + write16(w, uint16(x)) + } + for local33 := range (*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Fields { + if err := pcall(func() { + (((*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Fields)[local33]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Field", err)) + } + } +} + +func (obj *ToSrvNodeMetaFields) deserialize(r io.Reader) { + for local34 := range (*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Pos { + { + p := &((*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Pos)[local34] + *p = int16(read16(r)) + } + } + var local35 []uint8 + var local36 uint16 + { + p := &local36 + *p = read16(r) + } + (local35) = make([]uint8, local36) + { + _, err := io.ReadFull(r, (local35)[:]) + chk(err) + } + ((*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Formname) = string(local35) + var local37 uint16 + { + p := &local37 + *p = read16(r) + } + ((*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Fields) = make([]Field, local37) + for local38 := range (*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Fields { + if err := pcall(func() { + (((*(*(struct { + Pos [3]int16 + Formname string + Fields []Field + }))(obj)).Fields)[local38]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Field", err)) + } + } +} + +func (obj *ToSrvInvFields) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + Formname string + Fields []Field + }))(obj)).Formname))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Formname string + Fields []Field + }))(obj)).Formname)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Formname string + Fields []Field + }))(obj)).Formname))[:]) + chk(err) + } + if len(((*(*(struct { + Formname string + Fields []Field + }))(obj)).Fields)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Formname string + Fields []Field + }))(obj)).Fields))) + write16(w, uint16(x)) + } + for local39 := range (*(*(struct { + Formname string + Fields []Field + }))(obj)).Fields { + if err := pcall(func() { + (((*(*(struct { + Formname string + Fields []Field + }))(obj)).Fields)[local39]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Field", err)) + } + } +} + +func (obj *ToSrvInvFields) deserialize(r io.Reader) { + var local40 []uint8 + var local41 uint16 + { + p := &local41 + *p = read16(r) + } + (local40) = make([]uint8, local41) + { + _, err := io.ReadFull(r, (local40)[:]) + chk(err) + } + ((*(*(struct { + Formname string + Fields []Field + }))(obj)).Formname) = string(local40) + var local42 uint16 + { + p := &local42 + *p = read16(r) + } + ((*(*(struct { + Formname string + Fields []Field + }))(obj)).Fields) = make([]Field, local42) + for local43 := range (*(*(struct { + Formname string + Fields []Field + }))(obj)).Fields { + if err := pcall(func() { + (((*(*(struct { + Formname string + Fields []Field + }))(obj)).Fields)[local43]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Field", err)) + } + } +} + +func (obj *ToSrvReqMedia) serialize(w io.Writer) { + if len(((*(*(struct { + Filenames []string + }))(obj)).Filenames)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Filenames []string + }))(obj)).Filenames))) + write16(w, uint16(x)) + } + for local44 := range (*(*(struct { + Filenames []string + }))(obj)).Filenames { + if len(([]byte(((*(*(struct { + Filenames []string + }))(obj)).Filenames)[local44]))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte(((*(*(struct { + Filenames []string + }))(obj)).Filenames)[local44])))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte(((*(*(struct { + Filenames []string + }))(obj)).Filenames)[local44]))[:]) + chk(err) + } + } +} + +func (obj *ToSrvReqMedia) deserialize(r io.Reader) { + var local45 uint16 + { + p := &local45 + *p = read16(r) + } + ((*(*(struct { + Filenames []string + }))(obj)).Filenames) = make([]string, local45) + for local46 := range (*(*(struct { + Filenames []string + }))(obj)).Filenames { + var local47 []uint8 + var local48 uint16 + { + p := &local48 + *p = read16(r) + } + (local47) = make([]uint8, local48) + { + _, err := io.ReadFull(r, (local47)[:]) + chk(err) + } + (((*(*(struct { + Filenames []string + }))(obj)).Filenames)[local46]) = string(local47) + } +} + +func (obj *ToSrvCltReady) serialize(w io.Writer) { + { + x := (*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Major + write8(w, uint8(x)) + } + { + x := (*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Minor + write8(w, uint8(x)) + } + { + x := (*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Patch + write8(w, uint8(x)) + } + { + x := (*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Reserved + write8(w, uint8(x)) + } + if len(([]byte((*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Version))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Version)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Version))[:]) + chk(err) + } + { + x := (*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Formspec + write16(w, uint16(x)) + } +} + +func (obj *ToSrvCltReady) deserialize(r io.Reader) { + { + p := &(*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Major + *p = read8(r) + } + { + p := &(*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Minor + *p = read8(r) + } + { + p := &(*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Patch + *p = read8(r) + } + { + p := &(*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Reserved + *p = read8(r) + } + var local49 []uint8 + var local50 uint16 + { + p := &local50 + *p = read16(r) + } + (local49) = make([]uint8, local50) + { + _, err := io.ReadFull(r, (local49)[:]) + chk(err) + } + ((*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Version) = string(local49) + { + p := &(*(*(struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 + }))(obj)).Formspec + *p = read16(r) + } +} + +func (obj *ToSrvFirstSRP) serialize(w io.Writer) { + if len(((*(*(struct { + Salt []byte + Verifier []byte + EmptyPasswd bool + }))(obj)).Salt)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Salt []byte + Verifier []byte + EmptyPasswd bool + }))(obj)).Salt))) + write16(w, uint16(x)) + } + { + _, err := w.Write(((*(*(struct { + Salt []byte + Verifier []byte + EmptyPasswd bool + }))(obj)).Salt)[:]) + chk(err) + } + if len(((*(*(struct { + Salt []byte + Verifier []byte + EmptyPasswd bool + }))(obj)).Verifier)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Salt []byte + Verifier []byte + EmptyPasswd bool + }))(obj)).Verifier))) + write16(w, uint16(x)) + } + { + _, err := w.Write(((*(*(struct { + Salt []byte + Verifier []byte + EmptyPasswd bool + }))(obj)).Verifier)[:]) + chk(err) + } + { + x := (*(*(struct { + Salt []byte + Verifier []byte + EmptyPasswd bool + }))(obj)).EmptyPasswd + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } +} + +func (obj *ToSrvFirstSRP) deserialize(r io.Reader) { + var local51 uint16 + { + p := &local51 + *p = read16(r) + } + ((*(*(struct { + Salt []byte + Verifier []byte + EmptyPasswd bool + }))(obj)).Salt) = make([]byte, local51) + { + _, err := io.ReadFull(r, ((*(*(struct { + Salt []byte + Verifier []byte + EmptyPasswd bool + }))(obj)).Salt)[:]) + chk(err) + } + var local52 uint16 + { + p := &local52 + *p = read16(r) + } + ((*(*(struct { + Salt []byte + Verifier []byte + EmptyPasswd bool + }))(obj)).Verifier) = make([]byte, local52) + { + _, err := io.ReadFull(r, ((*(*(struct { + Salt []byte + Verifier []byte + EmptyPasswd bool + }))(obj)).Verifier)[:]) + chk(err) + } + { + p := &(*(*(struct { + Salt []byte + Verifier []byte + EmptyPasswd bool + }))(obj)).EmptyPasswd + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } +} + +func (obj *ToSrvSRPBytesA) serialize(w io.Writer) { + if len(((*(*(struct { + A []byte + NoSHA1 bool + }))(obj)).A)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + A []byte + NoSHA1 bool + }))(obj)).A))) + write16(w, uint16(x)) + } + { + _, err := w.Write(((*(*(struct { + A []byte + NoSHA1 bool + }))(obj)).A)[:]) + chk(err) + } + { + x := (*(*(struct { + A []byte + NoSHA1 bool + }))(obj)).NoSHA1 + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } +} + +func (obj *ToSrvSRPBytesA) deserialize(r io.Reader) { + var local53 uint16 + { + p := &local53 + *p = read16(r) + } + ((*(*(struct { + A []byte + NoSHA1 bool + }))(obj)).A) = make([]byte, local53) + { + _, err := io.ReadFull(r, ((*(*(struct { + A []byte + NoSHA1 bool + }))(obj)).A)[:]) + chk(err) + } + { + p := &(*(*(struct { + A []byte + NoSHA1 bool + }))(obj)).NoSHA1 + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } +} + +func (obj *ToSrvSRPBytesM) serialize(w io.Writer) { + if len(((*(*(struct { + M []byte + }))(obj)).M)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + M []byte + }))(obj)).M))) + write16(w, uint16(x)) + } + { + _, err := w.Write(((*(*(struct { + M []byte + }))(obj)).M)[:]) + chk(err) + } +} + +func (obj *ToSrvSRPBytesM) deserialize(r io.Reader) { + var local54 uint16 + { + p := &local54 + *p = read16(r) + } + ((*(*(struct { + M []byte + }))(obj)).M) = make([]byte, local54) + { + _, err := io.ReadFull(r, ((*(*(struct { + M []byte + }))(obj)).M)[:]) + chk(err) + } +} + +func (obj *ToCltHello) serialize(w io.Writer) { + { + x := (*(*(struct { + SerializeVer uint8 + Compression CompressionModes + ProtoVer uint16 + AuthMethods + Username string + }))(obj)).SerializeVer + write8(w, uint8(x)) + } + if err := pcall(func() { + ((*(*(struct { + SerializeVer uint8 + Compression CompressionModes + ProtoVer uint16 + AuthMethods + Username string + }))(obj)).Compression).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.CompressionModes", err)) + } + { + x := (*(*(struct { + SerializeVer uint8 + Compression CompressionModes + ProtoVer uint16 + AuthMethods + Username string + }))(obj)).ProtoVer + write16(w, uint16(x)) + } + if err := pcall(func() { + ((*(*(struct { + SerializeVer uint8 + Compression CompressionModes + ProtoVer uint16 + AuthMethods + Username string + }))(obj)).AuthMethods).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AuthMethods", err)) + } + if len(([]byte((*(*(struct { + SerializeVer uint8 + Compression CompressionModes + ProtoVer uint16 + AuthMethods + Username string + }))(obj)).Username))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + SerializeVer uint8 + Compression CompressionModes + ProtoVer uint16 + AuthMethods + Username string + }))(obj)).Username)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + SerializeVer uint8 + Compression CompressionModes + ProtoVer uint16 + AuthMethods + Username string + }))(obj)).Username))[:]) + chk(err) + } +} + +func (obj *ToCltHello) deserialize(r io.Reader) { + { + p := &(*(*(struct { + SerializeVer uint8 + Compression CompressionModes + ProtoVer uint16 + AuthMethods + Username string + }))(obj)).SerializeVer + *p = read8(r) + } + if err := pcall(func() { + ((*(*(struct { + SerializeVer uint8 + Compression CompressionModes + ProtoVer uint16 + AuthMethods + Username string + }))(obj)).Compression).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.CompressionModes", err)) + } + { + p := &(*(*(struct { + SerializeVer uint8 + Compression CompressionModes + ProtoVer uint16 + AuthMethods + Username string + }))(obj)).ProtoVer + *p = read16(r) + } + if err := pcall(func() { + ((*(*(struct { + SerializeVer uint8 + Compression CompressionModes + ProtoVer uint16 + AuthMethods + Username string + }))(obj)).AuthMethods).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AuthMethods", err)) + } + var local55 []uint8 + var local56 uint16 + { + p := &local56 + *p = read16(r) + } + (local55) = make([]uint8, local56) + { + _, err := io.ReadFull(r, (local55)[:]) + chk(err) + } + ((*(*(struct { + SerializeVer uint8 + Compression CompressionModes + ProtoVer uint16 + AuthMethods + Username string + }))(obj)).Username) = string(local55) +} + +func (obj *ToCltAcceptAuth) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + // The client does the equivalent of + // PlayerPos[1] -= 5 + // before using PlayerPos. + PlayerPos Pos + + MapSeed uint64 + SendInterval float32 + SudoAuthMethods AuthMethods + }))(obj)).PlayerPos).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + { + x := (*(*(struct { + // The client does the equivalent of + // PlayerPos[1] -= 5 + // before using PlayerPos. + PlayerPos Pos + + MapSeed uint64 + SendInterval float32 + SudoAuthMethods AuthMethods + }))(obj)).MapSeed + write64(w, uint64(x)) + } + { + x := (*(*(struct { + // The client does the equivalent of + // PlayerPos[1] -= 5 + // before using PlayerPos. + PlayerPos Pos + + MapSeed uint64 + SendInterval float32 + SudoAuthMethods AuthMethods + }))(obj)).SendInterval + write32(w, math.Float32bits(x)) + } + if err := pcall(func() { + ((*(*(struct { + // The client does the equivalent of + // PlayerPos[1] -= 5 + // before using PlayerPos. + PlayerPos Pos + + MapSeed uint64 + SendInterval float32 + SudoAuthMethods AuthMethods + }))(obj)).SudoAuthMethods).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AuthMethods", err)) + } +} + +func (obj *ToCltAcceptAuth) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + // The client does the equivalent of + // PlayerPos[1] -= 5 + // before using PlayerPos. + PlayerPos Pos + + MapSeed uint64 + SendInterval float32 + SudoAuthMethods AuthMethods + }))(obj)).PlayerPos).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + { + p := &(*(*(struct { + // The client does the equivalent of + // PlayerPos[1] -= 5 + // before using PlayerPos. + PlayerPos Pos + + MapSeed uint64 + SendInterval float32 + SudoAuthMethods AuthMethods + }))(obj)).MapSeed + *p = read64(r) + } + { + p := &(*(*(struct { + // The client does the equivalent of + // PlayerPos[1] -= 5 + // before using PlayerPos. + PlayerPos Pos + + MapSeed uint64 + SendInterval float32 + SudoAuthMethods AuthMethods + }))(obj)).SendInterval + *p = math.Float32frombits(read32(r)) + } + if err := pcall(func() { + ((*(*(struct { + // The client does the equivalent of + // PlayerPos[1] -= 5 + // before using PlayerPos. + PlayerPos Pos + + MapSeed uint64 + SendInterval float32 + SudoAuthMethods AuthMethods + }))(obj)).SudoAuthMethods).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AuthMethods", err)) + } +} + +func (obj *ToCltAcceptSudoMode) serialize(w io.Writer) { +} + +func (obj *ToCltAcceptSudoMode) deserialize(r io.Reader) { +} + +func (obj *ToCltDenySudoMode) serialize(w io.Writer) { +} + +func (obj *ToCltDenySudoMode) deserialize(r io.Reader) { +} + +func (obj *ToCltDisco) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Reason).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.DiscoReason", err)) + } + if !((*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Reason < maxDiscoReason) { + chk(errors.New("assertion failed: %s.Reason < maxDiscoReason")) + } + if dr := (*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Reason; dr == Custom || dr == Shutdown || dr == Crash { + if len(([]byte((*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Custom))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Custom)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Custom))[:]) + chk(err) + } + } + if dr := (*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Reason; dr == Shutdown || dr == Crash { + { + x := (*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Reconnect + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + } +} + +func (obj *ToCltDisco) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Reason).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.DiscoReason", err)) + } + if !((*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Reason < maxDiscoReason) { + chk(errors.New("assertion failed: %s.Reason < maxDiscoReason")) + } + if dr := (*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Reason; dr == Custom || dr == Shutdown || dr == Crash { + var local57 []uint8 + var local58 uint16 + { + p := &local58 + *p = read16(r) + } + (local57) = make([]uint8, local58) + { + _, err := io.ReadFull(r, (local57)[:]) + chk(err) + } + ((*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Custom) = string(local57) + } + if dr := (*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Reason; dr == Shutdown || dr == Crash { + { + p := &(*(*(struct { + Reason DiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + }))(obj)).Reconnect + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + } +} + +func (obj *ToCltBlkData) serialize(w io.Writer) { + for local59 := range (*(*(struct { + Blkpos [3]int16 + Blk MapBlk + }))(obj)).Blkpos { + { + x := ((*(*(struct { + Blkpos [3]int16 + Blk MapBlk + }))(obj)).Blkpos)[local59] + write16(w, uint16(x)) + } + } + if err := pcall(func() { + ((*(*(struct { + Blkpos [3]int16 + Blk MapBlk + }))(obj)).Blk).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.MapBlk", err)) + } +} + +func (obj *ToCltBlkData) deserialize(r io.Reader) { + for local60 := range (*(*(struct { + Blkpos [3]int16 + Blk MapBlk + }))(obj)).Blkpos { + { + p := &((*(*(struct { + Blkpos [3]int16 + Blk MapBlk + }))(obj)).Blkpos)[local60] + *p = int16(read16(r)) + } + } + if err := pcall(func() { + ((*(*(struct { + Blkpos [3]int16 + Blk MapBlk + }))(obj)).Blk).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.MapBlk", err)) + } +} + +func (obj *ToCltAddNode) serialize(w io.Writer) { + for local61 := range (*(*(struct { + Pos [3]int16 + Node + KeepMeta bool + }))(obj)).Pos { + { + x := ((*(*(struct { + Pos [3]int16 + Node + KeepMeta bool + }))(obj)).Pos)[local61] + write16(w, uint16(x)) + } + } + if err := pcall(func() { + ((*(*(struct { + Pos [3]int16 + Node + KeepMeta bool + }))(obj)).Node).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Node", err)) + } + { + x := (*(*(struct { + Pos [3]int16 + Node + KeepMeta bool + }))(obj)).KeepMeta + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } +} + +func (obj *ToCltAddNode) deserialize(r io.Reader) { + for local62 := range (*(*(struct { + Pos [3]int16 + Node + KeepMeta bool + }))(obj)).Pos { + { + p := &((*(*(struct { + Pos [3]int16 + Node + KeepMeta bool + }))(obj)).Pos)[local62] + *p = int16(read16(r)) + } + } + if err := pcall(func() { + ((*(*(struct { + Pos [3]int16 + Node + KeepMeta bool + }))(obj)).Node).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Node", err)) + } + { + p := &(*(*(struct { + Pos [3]int16 + Node + KeepMeta bool + }))(obj)).KeepMeta + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } +} + +func (obj *ToCltRemoveNode) serialize(w io.Writer) { + for local63 := range (*(*(struct { + Pos [3]int16 + }))(obj)).Pos { + { + x := ((*(*(struct { + Pos [3]int16 + }))(obj)).Pos)[local63] + write16(w, uint16(x)) + } + } +} + +func (obj *ToCltRemoveNode) deserialize(r io.Reader) { + for local64 := range (*(*(struct { + Pos [3]int16 + }))(obj)).Pos { + { + p := &((*(*(struct { + Pos [3]int16 + }))(obj)).Pos)[local64] + *p = int16(read16(r)) + } + } +} + +func (obj *ToCltInv) serialize(w io.Writer) { + { + _, err := w.Write(([]byte((*(*(struct { + //mt:raw + Inv string + }))(obj)).Inv))[:]) + chk(err) + } +} + +func (obj *ToCltInv) deserialize(r io.Reader) { + var local65 []uint8 + for { + var local66 uint8 + err := pcall(func() { + { + p := &local66 + *p = read8(r) + } + }) + if err == io.EOF { + break + } + (local65) = append((local65), local66) + chk(err) + } + ((*(*(struct { + //mt:raw + Inv string + }))(obj)).Inv) = string(local65) +} + +func (obj *ToCltTimeOfDay) serialize(w io.Writer) { + { + x := (*(*(struct { + Time uint16 // %24000 + Speed float32 // Speed times faster than real time + }))(obj)).Time + write16(w, uint16(x)) + } + { + x := (*(*(struct { + Time uint16 // %24000 + Speed float32 // Speed times faster than real time + }))(obj)).Speed + write32(w, math.Float32bits(x)) + } +} + +func (obj *ToCltTimeOfDay) deserialize(r io.Reader) { + { + p := &(*(*(struct { + Time uint16 // %24000 + Speed float32 // Speed times faster than real time + }))(obj)).Time + *p = read16(r) + } + { + p := &(*(*(struct { + Time uint16 // %24000 + Speed float32 // Speed times faster than real time + }))(obj)).Speed + *p = math.Float32frombits(read32(r)) + } +} + +func (obj *ToCltCSMRestrictionFlags) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Flags CSMRestrictionFlags + + // MapRange is the maximum distance from the player CSMs can read the map + // if Flags&LimitMapRange != 0. + MapRange uint32 + }))(obj)).Flags).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.CSMRestrictionFlags", err)) + } + { + x := (*(*(struct { + Flags CSMRestrictionFlags + + // MapRange is the maximum distance from the player CSMs can read the map + // if Flags&LimitMapRange != 0. + MapRange uint32 + }))(obj)).MapRange + write32(w, uint32(x)) + } +} + +func (obj *ToCltCSMRestrictionFlags) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Flags CSMRestrictionFlags + + // MapRange is the maximum distance from the player CSMs can read the map + // if Flags&LimitMapRange != 0. + MapRange uint32 + }))(obj)).Flags).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.CSMRestrictionFlags", err)) + } + { + p := &(*(*(struct { + Flags CSMRestrictionFlags + + // MapRange is the maximum distance from the player CSMs can read the map + // if Flags&LimitMapRange != 0. + MapRange uint32 + }))(obj)).MapRange + *p = read32(r) + } +} + +func (obj *ToCltAddPlayerVel) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Vel Vec + }))(obj)).Vel).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } +} + +func (obj *ToCltAddPlayerVel) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Vel Vec + }))(obj)).Vel).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } +} + +func (obj *ToCltMediaPush) serialize(w io.Writer) { + { + local67 := uint16(sha1.Size) + { + x := local67 + write16(w, uint16(x)) + } + } + { + _, err := w.Write(((*(*(struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte + }))(obj)).SHA1)[:]) + chk(err) + } + if len(([]byte((*(*(struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte + }))(obj)).Filename))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte + }))(obj)).Filename)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte + }))(obj)).Filename))[:]) + chk(err) + } + { + x := (*(*(struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte + }))(obj)).ShouldCache + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if len(((*(*(struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte + }))(obj)).Data)) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len(((*(*(struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte + }))(obj)).Data))) + write32(w, uint32(x)) + } + { + _, err := w.Write(((*(*(struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte + }))(obj)).Data)[:]) + chk(err) + } +} + +func (obj *ToCltMediaPush) deserialize(r io.Reader) { + { + var local68 uint16 + { + p := &local68 + *p = read16(r) + } + if local68 != (20) { + chk(fmt.Errorf("const %v: %v", 20, local68)) + } + } + { + _, err := io.ReadFull(r, ((*(*(struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte + }))(obj)).SHA1)[:]) + chk(err) + } + var local69 []uint8 + var local70 uint16 + { + p := &local70 + *p = read16(r) + } + (local69) = make([]uint8, local70) + { + _, err := io.ReadFull(r, (local69)[:]) + chk(err) + } + ((*(*(struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte + }))(obj)).Filename) = string(local69) + { + p := &(*(*(struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte + }))(obj)).ShouldCache + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + var local71 uint32 + { + p := &local71 + *p = read32(r) + } + ((*(*(struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte + }))(obj)).Data) = make([]byte, local71) + { + _, err := io.ReadFull(r, ((*(*(struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte + }))(obj)).Data)[:]) + chk(err) + } +} + +func (obj *ToCltChatMsg) serialize(w io.Writer) { + { + local72 := uint8(1) + { + x := local72 + write8(w, uint8(x)) + } + } + if err := pcall(func() { + ((*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Type).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ChatMsgType", err)) + } + if len((utf16.Encode([]rune((*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Sender)))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len((utf16.Encode([]rune((*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Sender))))) + write16(w, uint16(x)) + } + for local73 := range utf16.Encode([]rune((*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Sender)) { + { + x := (utf16.Encode([]rune((*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Sender)))[local73] + write16(w, uint16(x)) + } + } + if len((utf16.Encode([]rune((*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Text)))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len((utf16.Encode([]rune((*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Text))))) + write16(w, uint16(x)) + } + for local74 := range utf16.Encode([]rune((*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Text)) { + { + x := (utf16.Encode([]rune((*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Text)))[local74] + write16(w, uint16(x)) + } + } + { + x := (*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Timestamp + write64(w, uint64(x)) + } +} + +func (obj *ToCltChatMsg) deserialize(r io.Reader) { + { + var local75 uint8 + { + p := &local75 + *p = read8(r) + } + if local75 != (1) { + chk(fmt.Errorf("const %v: %v", 1, local75)) + } + } + if err := pcall(func() { + ((*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Type).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ChatMsgType", err)) + } + var local76 []uint16 + var local77 uint16 + { + p := &local77 + *p = read16(r) + } + (local76) = make([]uint16, local77) + for local78 := range local76 { + { + p := &(local76)[local78] + *p = read16(r) + } + } + (*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Sender = string(utf16.Decode(local76)) + var local79 []uint16 + var local80 uint16 + { + p := &local80 + *p = read16(r) + } + (local79) = make([]uint16, local80) + for local81 := range local79 { + { + p := &(local79)[local81] + *p = read16(r) + } + } + (*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Text = string(utf16.Decode(local79)) + { + p := &(*(*(struct { + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. + }))(obj)).Timestamp + *p = int64(read64(r)) + } +} + +func (obj *ToCltAORmAdd) serialize(w io.Writer) { + if len(((*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Remove)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Remove))) + write16(w, uint16(x)) + } + for local82 := range (*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Remove { + if err := pcall(func() { + (((*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Remove)[local82]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + } + if len(((*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Add)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Add))) + write16(w, uint16(x)) + } + for local83 := range (*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Add { + if err := pcall(func() { + ((((*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Add)[local83]).ID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + { + local84 := genericCAO + if err := pcall(func() { + (local84).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.aoType", err)) + } + } + { + ow := w + w := new(bytes.Buffer) + if err := pcall(func() { + ((((*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Add)[local83]).InitData).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOInitData", err)) + } + { + buf := w + w := ow + if len((buf.Bytes())) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len((buf.Bytes()))) + write32(w, uint32(x)) + } + { + _, err := w.Write((buf.Bytes())[:]) + chk(err) + } + } + } + } +} + +func (obj *ToCltAORmAdd) deserialize(r io.Reader) { + var local85 uint16 + { + p := &local85 + *p = read16(r) + } + ((*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Remove) = make([]AOID, local85) + for local86 := range (*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Remove { + if err := pcall(func() { + (((*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Remove)[local86]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + } + var local87 uint16 + { + p := &local87 + *p = read16(r) + } + ((*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Add) = make([]struct { + ID AOID + InitData AOInitData + }, local87) + for local88 := range (*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Add { + if err := pcall(func() { + ((((*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Add)[local88]).ID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + { + var local89 aoType + if err := pcall(func() { + (local89).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.aoType", err)) + } + if local89 != (101) { + chk(fmt.Errorf("const %v: %v", 101, local89)) + } + } + { + var n uint32 + { + p := &n + *p = read32(r) + } + r := &io.LimitedReader{r, int64(n)} + if err := pcall(func() { + ((((*(*(struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + } + }))(obj)).Add)[local88]).InitData).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOInitData", err)) + } + if r.N > 0 { + chk(fmt.Errorf("%d bytes of trailing data", r.N)) + } + } + } +} + +func (obj *ToCltAOMsgs) serialize(w io.Writer) { + for local90 := range (*(*(struct { + //mt:raw + Msgs []IDAOMsg + }))(obj)).Msgs { + if err := pcall(func() { + (((*(*(struct { + //mt:raw + Msgs []IDAOMsg + }))(obj)).Msgs)[local90]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.IDAOMsg", err)) + } + } +} + +func (obj *ToCltAOMsgs) deserialize(r io.Reader) { + for { + var local91 IDAOMsg + err := pcall(func() { + if err := pcall(func() { + (local91).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.IDAOMsg", err)) + } + }) + if err == io.EOF { + break + } + ((*(*(struct { + //mt:raw + Msgs []IDAOMsg + }))(obj)).Msgs) = append(((*(*(struct { + //mt:raw + Msgs []IDAOMsg + }))(obj)).Msgs), local91) + chk(err) + } +} + +func (obj *ToCltHP) serialize(w io.Writer) { + { + x := (*(*(struct { + HP uint16 + }))(obj)).HP + write16(w, uint16(x)) + } +} + +func (obj *ToCltHP) deserialize(r io.Reader) { + { + p := &(*(*(struct { + HP uint16 + }))(obj)).HP + *p = read16(r) + } +} + +func (obj *ToCltMovePlayer) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Pos + Pitch, Yaw float32 + }))(obj)).Pos).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + { + x := (*(*(struct { + Pos + Pitch, Yaw float32 + }))(obj)).Pitch + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + Pos + Pitch, Yaw float32 + }))(obj)).Yaw + write32(w, math.Float32bits(x)) + } +} + +func (obj *ToCltMovePlayer) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Pos + Pitch, Yaw float32 + }))(obj)).Pos).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + { + p := &(*(*(struct { + Pos + Pitch, Yaw float32 + }))(obj)).Pitch + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + Pos + Pitch, Yaw float32 + }))(obj)).Yaw + *p = math.Float32frombits(read32(r)) + } +} + +func (obj *ToCltDiscoLegacy) serialize(w io.Writer) { + if len((utf16.Encode([]rune((*(*(struct { + //mt:utf16 + Reason string + }))(obj)).Reason)))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len((utf16.Encode([]rune((*(*(struct { + //mt:utf16 + Reason string + }))(obj)).Reason))))) + write16(w, uint16(x)) + } + for local92 := range utf16.Encode([]rune((*(*(struct { + //mt:utf16 + Reason string + }))(obj)).Reason)) { + { + x := (utf16.Encode([]rune((*(*(struct { + //mt:utf16 + Reason string + }))(obj)).Reason)))[local92] + write16(w, uint16(x)) + } + } +} + +func (obj *ToCltDiscoLegacy) deserialize(r io.Reader) { + var local93 []uint16 + var local94 uint16 + { + p := &local94 + *p = read16(r) + } + (local93) = make([]uint16, local94) + for local95 := range local93 { + { + p := &(local93)[local95] + *p = read16(r) + } + } + (*(*(struct { + //mt:utf16 + Reason string + }))(obj)).Reason = string(utf16.Decode(local93)) +} + +func (obj *ToCltFOV) serialize(w io.Writer) { + { + x := (*(*(struct { + FOV float32 + Multiplier bool + TransitionTime float32 + }))(obj)).FOV + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + FOV float32 + Multiplier bool + TransitionTime float32 + }))(obj)).Multiplier + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + FOV float32 + Multiplier bool + TransitionTime float32 + }))(obj)).TransitionTime + write32(w, math.Float32bits(x)) + } +} + +func (obj *ToCltFOV) deserialize(r io.Reader) { + { + p := &(*(*(struct { + FOV float32 + Multiplier bool + TransitionTime float32 + }))(obj)).FOV + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + FOV float32 + Multiplier bool + TransitionTime float32 + }))(obj)).Multiplier + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + FOV float32 + Multiplier bool + TransitionTime float32 + }))(obj)).TransitionTime + *p = math.Float32frombits(read32(r)) + } +} + +func (obj *ToCltDeathScreen) serialize(w io.Writer) { + { + x := (*(*(struct { + PointCam bool + PointAt Pos + }))(obj)).PointCam + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if err := pcall(func() { + ((*(*(struct { + PointCam bool + PointAt Pos + }))(obj)).PointAt).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } +} + +func (obj *ToCltDeathScreen) deserialize(r io.Reader) { + { + p := &(*(*(struct { + PointCam bool + PointAt Pos + }))(obj)).PointCam + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + if err := pcall(func() { + ((*(*(struct { + PointCam bool + PointAt Pos + }))(obj)).PointAt).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } +} + +func (obj *ToCltMedia) serialize(w io.Writer) { + { + x := (*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).N + write16(w, uint16(x)) + } + { + x := (*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).I + write16(w, uint16(x)) + } + if len(((*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files)) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len(((*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files))) + write32(w, uint32(x)) + } + for local96 := range (*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files { + if len(([]byte((((*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files)[local96]).Name))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((((*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files)[local96]).Name)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((((*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files)[local96]).Name))[:]) + chk(err) + } + if len(((((*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files)[local96]).Data)) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len(((((*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files)[local96]).Data))) + write32(w, uint32(x)) + } + { + _, err := w.Write(((((*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files)[local96]).Data)[:]) + chk(err) + } + } +} + +func (obj *ToCltMedia) deserialize(r io.Reader) { + { + p := &(*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).N + *p = read16(r) + } + { + p := &(*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).I + *p = read16(r) + } + var local97 uint32 + { + p := &local97 + *p = read32(r) + } + ((*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files) = make([]struct { + Name string + Data []byte + }, local97) + for local98 := range (*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files { + var local99 []uint8 + var local100 uint16 + { + p := &local100 + *p = read16(r) + } + (local99) = make([]uint8, local100) + { + _, err := io.ReadFull(r, (local99)[:]) + chk(err) + } + ((((*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files)[local98]).Name) = string(local99) + var local101 uint32 + { + p := &local101 + *p = read32(r) + } + ((((*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files)[local98]).Data) = make([]byte, local101) + { + _, err := io.ReadFull(r, ((((*(*(struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } + }))(obj)).Files)[local98]).Data)[:]) + chk(err) + } + } +} + +func (obj *ToCltNodeDefs) serialize(w io.Writer) { + { + ow := w + w := new(bytes.Buffer) + { + w := zlib.NewWriter(w) + { + local102 := uint8(1) + { + x := local102 + write8(w, uint8(x)) + } + } + { + x := (*(*(struct { + + // See (de)serialize.fmt. + Defs []NodeDef + }))(obj)).Defs + { // For ToCltNodeDefs.Defs + if len(x) > math.MaxUint16 { + chk(ErrTooLong) + } + write16(w, uint16(len(x))) + var b bytes.Buffer + for i := range x { + x[i].serialize(&b) + } + if b.Len() > math.MaxUint32 { + chk(ErrTooLong) + } + write32(w, uint32(b.Len())) + _, err := b.WriteTo(w) + chk(err) + } + } + chk(w.Close()) + } + { + buf := w + w := ow + if len((buf.Bytes())) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len((buf.Bytes()))) + write32(w, uint32(x)) + } + { + _, err := w.Write((buf.Bytes())[:]) + chk(err) + } + } + } +} + +func (obj *ToCltNodeDefs) deserialize(r io.Reader) { + { + var n uint32 + { + p := &n + *p = read32(r) + } + r := &io.LimitedReader{r, int64(n)} + { + r, err := zlib.NewReader(byteReader{r}) + chk(err) + { + var local103 uint8 + { + p := &local103 + *p = read8(r) + } + if local103 != (1) { + chk(fmt.Errorf("const %v: %v", 1, local103)) + } + } + { + p := &(*(*(struct { + + // See (de)serialize.fmt. + Defs []NodeDef + }))(obj)).Defs + { // For ToCltNodeDefs.Defs. + *p = make([]NodeDef, read16(r)) + r := &io.LimitedReader{r, int64(read32(r))} + for i := range *p { + (*p)[i].deserialize(r) + } + if r.N > 0 { + chk(fmt.Errorf("%d bytes of trailing data", r.N)) + } + } + } + chk(r.Close()) + } + if r.N > 0 { + chk(fmt.Errorf("%d bytes of trailing data", r.N)) + } + } +} + +func (obj *ToCltAnnounceMedia) serialize(w io.Writer) { + if len(((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).Files)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).Files))) + write16(w, uint16(x)) + } + for local104 := range (*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).Files { + if len(([]byte((((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).Files)[local104]).Name))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).Files)[local104]).Name)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).Files)[local104]).Name))[:]) + chk(err) + } + if len(([]byte((((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).Files)[local104]).Base64SHA1))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).Files)[local104]).Base64SHA1)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).Files)[local104]).Base64SHA1))[:]) + chk(err) + } + } + if len(([]byte((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).URL))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).URL)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).URL))[:]) + chk(err) + } +} + +func (obj *ToCltAnnounceMedia) deserialize(r io.Reader) { + var local105 uint16 + { + p := &local105 + *p = read16(r) + } + ((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).Files) = make([]struct { + Name string + Base64SHA1 string + }, local105) + for local106 := range (*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).Files { + var local107 []uint8 + var local108 uint16 + { + p := &local108 + *p = read16(r) + } + (local107) = make([]uint8, local108) + { + _, err := io.ReadFull(r, (local107)[:]) + chk(err) + } + ((((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).Files)[local106]).Name) = string(local107) + var local109 []uint8 + var local110 uint16 + { + p := &local110 + *p = read16(r) + } + (local109) = make([]uint8, local110) + { + _, err := io.ReadFull(r, (local109)[:]) + chk(err) + } + ((((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).Files)[local106]).Base64SHA1) = string(local109) + } + var local111 []uint8 + var local112 uint16 + { + p := &local112 + *p = read16(r) + } + (local111) = make([]uint8, local112) + { + _, err := io.ReadFull(r, (local111)[:]) + chk(err) + } + ((*(*(struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string + }))(obj)).URL) = string(local111) +} + +func (obj *ToCltItemDefs) serialize(w io.Writer) { + { + ow := w + w := new(bytes.Buffer) + { + w := zlib.NewWriter(w) + { + local113 := uint8(0) + { + x := local113 + write8(w, uint8(x)) + } + } + if len(((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Defs)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Defs))) + write16(w, uint16(x)) + } + for local114 := range (*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Defs { + if err := pcall(func() { + (((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Defs)[local114]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ItemDef", err)) + } + } + if len(((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Aliases)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Aliases))) + write16(w, uint16(x)) + } + for local115 := range (*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Aliases { + if len(([]byte((((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Aliases)[local115]).Alias))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Aliases)[local115]).Alias)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Aliases)[local115]).Alias))[:]) + chk(err) + } + if len(([]byte((((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Aliases)[local115]).Orig))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Aliases)[local115]).Orig)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Aliases)[local115]).Orig))[:]) + chk(err) + } + } + chk(w.Close()) + } + { + buf := w + w := ow + if len((buf.Bytes())) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len((buf.Bytes()))) + write32(w, uint32(x)) + } + { + _, err := w.Write((buf.Bytes())[:]) + chk(err) + } + } + } +} + +func (obj *ToCltItemDefs) deserialize(r io.Reader) { + { + var n uint32 + { + p := &n + *p = read32(r) + } + r := &io.LimitedReader{r, int64(n)} + { + r, err := zlib.NewReader(byteReader{r}) + chk(err) + { + var local116 uint8 + { + p := &local116 + *p = read8(r) + } + if local116 != (0) { + chk(fmt.Errorf("const %v: %v", 0, local116)) + } + } + var local117 uint16 + { + p := &local117 + *p = read16(r) + } + ((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Defs) = make([]ItemDef, local117) + for local118 := range (*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Defs { + if err := pcall(func() { + (((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Defs)[local118]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ItemDef", err)) + } + } + var local119 uint16 + { + p := &local119 + *p = read16(r) + } + ((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Aliases) = make([]struct { + Alias string + Orig string + }, local119) + for local120 := range (*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Aliases { + var local121 []uint8 + var local122 uint16 + { + p := &local122 + *p = read16(r) + } + (local121) = make([]uint8, local122) + { + _, err := io.ReadFull(r, (local121)[:]) + chk(err) + } + ((((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Aliases)[local120]).Alias) = string(local121) + var local123 []uint8 + var local124 uint16 + { + p := &local124 + *p = read16(r) + } + (local123) = make([]uint8, local124) + { + _, err := io.ReadFull(r, (local123)[:]) + chk(err) + } + ((((*(*(struct { + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + }))(obj)).Aliases)[local120]).Orig) = string(local123) + } + chk(r.Close()) + } + if r.N > 0 { + chk(fmt.Errorf("%d bytes of trailing data", r.N)) + } + } +} + +func (obj *ToCltPlaySound) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).ID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundID", err)) + } + if len(([]byte((*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Name))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Name)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Name))[:]) + chk(err) + } + { + x := (*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Gain + write32(w, math.Float32bits(x)) + } + if err := pcall(func() { + ((*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).SrcType).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundSrcType", err)) + } + if err := pcall(func() { + ((*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Pos).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + if err := pcall(func() { + ((*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).SrcAOID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + { + x := (*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Loop + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Fade + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Pitch + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Ephemeral + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } +} + +func (obj *ToCltPlaySound) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).ID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundID", err)) + } + var local125 []uint8 + var local126 uint16 + { + p := &local126 + *p = read16(r) + } + (local125) = make([]uint8, local126) + { + _, err := io.ReadFull(r, (local125)[:]) + chk(err) + } + ((*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Name) = string(local125) + { + p := &(*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Gain + *p = math.Float32frombits(read32(r)) + } + if err := pcall(func() { + ((*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).SrcType).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundSrcType", err)) + } + if err := pcall(func() { + ((*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Pos).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + if err := pcall(func() { + ((*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).SrcAOID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + { + p := &(*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Loop + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Fade + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Pitch + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool + }))(obj)).Ephemeral + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } +} + +func (obj *ToCltStopSound) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + ID SoundID + }))(obj)).ID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundID", err)) + } +} + +func (obj *ToCltStopSound) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + ID SoundID + }))(obj)).ID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundID", err)) + } +} + +func (obj *ToCltPrivs) serialize(w io.Writer) { + if len(((*(*(struct { + Privs []string + }))(obj)).Privs)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Privs []string + }))(obj)).Privs))) + write16(w, uint16(x)) + } + for local127 := range (*(*(struct { + Privs []string + }))(obj)).Privs { + if len(([]byte(((*(*(struct { + Privs []string + }))(obj)).Privs)[local127]))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte(((*(*(struct { + Privs []string + }))(obj)).Privs)[local127])))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte(((*(*(struct { + Privs []string + }))(obj)).Privs)[local127]))[:]) + chk(err) + } + } +} + +func (obj *ToCltPrivs) deserialize(r io.Reader) { + var local128 uint16 + { + p := &local128 + *p = read16(r) + } + ((*(*(struct { + Privs []string + }))(obj)).Privs) = make([]string, local128) + for local129 := range (*(*(struct { + Privs []string + }))(obj)).Privs { + var local130 []uint8 + var local131 uint16 + { + p := &local131 + *p = read16(r) + } + (local130) = make([]uint8, local131) + { + _, err := io.ReadFull(r, (local130)[:]) + chk(err) + } + (((*(*(struct { + Privs []string + }))(obj)).Privs)[local129]) = string(local130) + } +} + +func (obj *ToCltInvFormspec) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + //mt:len32 + Formspec string + }))(obj)).Formspec))) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len(([]byte((*(*(struct { + //mt:len32 + Formspec string + }))(obj)).Formspec)))) + write32(w, uint32(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + //mt:len32 + Formspec string + }))(obj)).Formspec))[:]) + chk(err) + } +} + +func (obj *ToCltInvFormspec) deserialize(r io.Reader) { + var local132 []uint8 + var local133 uint32 + { + p := &local133 + *p = read32(r) + } + (local132) = make([]uint8, local133) + { + _, err := io.ReadFull(r, (local132)[:]) + chk(err) + } + ((*(*(struct { + //mt:len32 + Formspec string + }))(obj)).Formspec) = string(local132) +} + +func (obj *ToCltDetachedInv) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + Name string + Keep bool + Len uint16 // deprecated + + //mt:raw + Inv string + }))(obj)).Name))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Name string + Keep bool + Len uint16 // deprecated + + //mt:raw + Inv string + }))(obj)).Name)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Name string + Keep bool + Len uint16 // deprecated + + //mt:raw + Inv string + }))(obj)).Name))[:]) + chk(err) + } + { + x := (*(*(struct { + Name string + Keep bool + Len uint16 // deprecated + + //mt:raw + Inv string + }))(obj)).Keep + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Name string + Keep bool + Len uint16 // deprecated + + //mt:raw + Inv string + }))(obj)).Len + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Name string + Keep bool + Len uint16 // deprecated + + //mt:raw + Inv string + }))(obj)).Inv))[:]) + chk(err) + } +} + +func (obj *ToCltDetachedInv) deserialize(r io.Reader) { + var local134 []uint8 + var local135 uint16 + { + p := &local135 + *p = read16(r) + } + (local134) = make([]uint8, local135) + { + _, err := io.ReadFull(r, (local134)[:]) + chk(err) + } + ((*(*(struct { + Name string + Keep bool + Len uint16 // deprecated + + //mt:raw + Inv string + }))(obj)).Name) = string(local134) + { + p := &(*(*(struct { + Name string + Keep bool + Len uint16 // deprecated + + //mt:raw + Inv string + }))(obj)).Keep + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Name string + Keep bool + Len uint16 // deprecated + + //mt:raw + Inv string + }))(obj)).Len + *p = read16(r) + } + var local136 []uint8 + for { + var local137 uint8 + err := pcall(func() { + { + p := &local137 + *p = read8(r) + } + }) + if err == io.EOF { + break + } + (local136) = append((local136), local137) + chk(err) + } + ((*(*(struct { + Name string + Keep bool + Len uint16 // deprecated + + //mt:raw + Inv string + }))(obj)).Inv) = string(local136) +} + +func (obj *ToCltShowFormspec) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + //mt:len32 + Formspec string + + Formname string + }))(obj)).Formspec))) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len(([]byte((*(*(struct { + //mt:len32 + Formspec string + + Formname string + }))(obj)).Formspec)))) + write32(w, uint32(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + //mt:len32 + Formspec string + + Formname string + }))(obj)).Formspec))[:]) + chk(err) + } + if len(([]byte((*(*(struct { + //mt:len32 + Formspec string + + Formname string + }))(obj)).Formname))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + //mt:len32 + Formspec string + + Formname string + }))(obj)).Formname)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + //mt:len32 + Formspec string + + Formname string + }))(obj)).Formname))[:]) + chk(err) + } +} + +func (obj *ToCltShowFormspec) deserialize(r io.Reader) { + var local138 []uint8 + var local139 uint32 + { + p := &local139 + *p = read32(r) + } + (local138) = make([]uint8, local139) + { + _, err := io.ReadFull(r, (local138)[:]) + chk(err) + } + ((*(*(struct { + //mt:len32 + Formspec string + + Formname string + }))(obj)).Formspec) = string(local138) + var local140 []uint8 + var local141 uint16 + { + p := &local141 + *p = read16(r) + } + (local140) = make([]uint8, local141) + { + _, err := io.ReadFull(r, (local140)[:]) + chk(err) + } + ((*(*(struct { + //mt:len32 + Formspec string + + Formname string + }))(obj)).Formname) = string(local140) +} + +func (obj *ToCltMovement) serialize(w io.Writer) { + { + x := (*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).DefaultAccel + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).AirAccel + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).FastAccel + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).WalkSpeed + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).CrouchSpeed + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).FastSpeed + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).ClimbSpeed + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).JumpSpeed + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).Fluidity + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).Smoothing + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).Sink + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).Gravity + write32(w, math.Float32bits(x)) + } +} + +func (obj *ToCltMovement) deserialize(r io.Reader) { + { + p := &(*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).DefaultAccel + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).AirAccel + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).FastAccel + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).WalkSpeed + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).CrouchSpeed + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).FastSpeed + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).ClimbSpeed + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).JumpSpeed + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).Fluidity + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).Smoothing + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).Sink + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, + Gravity float32 + }))(obj)).Gravity + *p = math.Float32frombits(read32(r)) + } +} + +func (obj *ToCltSpawnParticle) serialize(w io.Writer) { + for local142 := range (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Pos { + { + x := ((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Pos)[local142] + write32(w, math.Float32bits(x)) + } + } + for local143 := range (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vel { + { + x := ((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vel)[local143] + write32(w, math.Float32bits(x)) + } + } + for local144 := range (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Acc { + { + x := ((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Acc)[local144] + write32(w, math.Float32bits(x)) + } + } + { + x := (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).ExpirationTime + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Size + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Collide + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if len(([]byte(*(*string)(&((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Texture))))) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len(([]byte(*(*string)(&((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Texture)))))) + write32(w, uint32(x)) + } + { + _, err := w.Write(([]byte(*(*string)(&((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Texture))))[:]) + chk(err) + } + { + x := (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vertical + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).CollisionRm + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if err := pcall(func() { + ((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).AnimParams).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileAnim", err)) + } + { + x := (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Glow + write8(w, uint8(x)) + } + { + x := (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).AOCollision + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if err := pcall(func() { + ((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).NodeParam0).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Content", err)) + } + { + x := (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).NodeParam2 + write8(w, uint8(x)) + } + { + x := (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).NodeTile + write8(w, uint8(x)) + } +} + +func (obj *ToCltSpawnParticle) deserialize(r io.Reader) { + for local145 := range (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Pos { + { + p := &((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Pos)[local145] + *p = math.Float32frombits(read32(r)) + } + } + for local146 := range (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vel { + { + p := &((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vel)[local146] + *p = math.Float32frombits(read32(r)) + } + } + for local147 := range (*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Acc { + { + p := &((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Acc)[local147] + *p = math.Float32frombits(read32(r)) + } + } + { + p := &(*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).ExpirationTime + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Size + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Collide + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + var local148 []uint8 + var local149 uint32 + { + p := &local149 + *p = read32(r) + } + (local148) = make([]uint8, local149) + { + _, err := io.ReadFull(r, (local148)[:]) + chk(err) + } + (*(*string)(&((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Texture))) = string(local148) + { + p := &(*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vertical + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).CollisionRm + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + if err := pcall(func() { + ((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).AnimParams).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileAnim", err)) + } + { + p := &(*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Glow + *p = read8(r) + } + { + p := &(*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).AOCollision + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + if err := pcall(func() { + ((*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).NodeParam0).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Content", err)) + } + { + p := &(*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).NodeParam2 + *p = read8(r) + } + { + p := &(*(*(struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).NodeTile + *p = read8(r) + } +} + +func (obj *ToCltAddParticleSpawner) serialize(w io.Writer) { + { + x := (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Amount + write16(w, uint16(x)) + } + { + x := (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Duration + write32(w, math.Float32bits(x)) + } + for local150 := range (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Pos { + for local151 := range ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Pos)[local150] { + { + x := (((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Pos)[local150])[local151] + write32(w, math.Float32bits(x)) + } + } + } + for local152 := range (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vel { + for local153 := range ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vel)[local152] { + { + x := (((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vel)[local152])[local153] + write32(w, math.Float32bits(x)) + } + } + } + for local154 := range (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Acc { + for local155 := range ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Acc)[local154] { + { + x := (((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Acc)[local154])[local155] + write32(w, math.Float32bits(x)) + } + } + } + for local156 := range (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).ExpirationTime { + { + x := ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).ExpirationTime)[local156] + write32(w, math.Float32bits(x)) + } + } + for local157 := range (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Size { + { + x := ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Size)[local157] + write32(w, math.Float32bits(x)) + } + } + { + x := (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Collide + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if len(([]byte(*(*string)(&((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Texture))))) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len(([]byte(*(*string)(&((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Texture)))))) + write32(w, uint32(x)) + } + { + _, err := w.Write(([]byte(*(*string)(&((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Texture))))[:]) + chk(err) + } + if err := pcall(func() { + ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).ID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ParticleSpawnerID", err)) + } + { + x := (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vertical + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).CollisionRm + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if err := pcall(func() { + ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).AttachedAOID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + if err := pcall(func() { + ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).AnimParams).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileAnim", err)) + } + { + x := (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Glow + write8(w, uint8(x)) + } + { + x := (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).AOCollision + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if err := pcall(func() { + ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).NodeParam0).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Content", err)) + } + { + x := (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).NodeParam2 + write8(w, uint8(x)) + } + { + x := (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).NodeTile + write8(w, uint8(x)) + } +} + +func (obj *ToCltAddParticleSpawner) deserialize(r io.Reader) { + { + p := &(*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Amount + *p = read16(r) + } + { + p := &(*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Duration + *p = math.Float32frombits(read32(r)) + } + for local158 := range (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Pos { + for local159 := range ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Pos)[local158] { + { + p := &(((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Pos)[local158])[local159] + *p = math.Float32frombits(read32(r)) + } + } + } + for local160 := range (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vel { + for local161 := range ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vel)[local160] { + { + p := &(((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vel)[local160])[local161] + *p = math.Float32frombits(read32(r)) + } + } + } + for local162 := range (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Acc { + for local163 := range ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Acc)[local162] { + { + p := &(((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Acc)[local162])[local163] + *p = math.Float32frombits(read32(r)) + } + } + } + for local164 := range (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).ExpirationTime { + { + p := &((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).ExpirationTime)[local164] + *p = math.Float32frombits(read32(r)) + } + } + for local165 := range (*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Size { + { + p := &((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Size)[local165] + *p = math.Float32frombits(read32(r)) + } + } + { + p := &(*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Collide + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + var local166 []uint8 + var local167 uint32 + { + p := &local167 + *p = read32(r) + } + (local166) = make([]uint8, local167) + { + _, err := io.ReadFull(r, (local166)[:]) + chk(err) + } + (*(*string)(&((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Texture))) = string(local166) + if err := pcall(func() { + ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).ID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ParticleSpawnerID", err)) + } + { + p := &(*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Vertical + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).CollisionRm + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + if err := pcall(func() { + ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).AttachedAOID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + if err := pcall(func() { + ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).AnimParams).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileAnim", err)) + } + { + p := &(*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).Glow + *p = read8(r) + } + { + p := &(*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).AOCollision + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + if err := pcall(func() { + ((*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).NodeParam0).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Content", err)) + } + { + p := &(*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).NodeParam2 + *p = read8(r) + } + { + p := &(*(*(struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 + }))(obj)).NodeTile + *p = read8(r) + } +} + +func (obj *ToCltAddHUD) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).ID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDID", err)) + } + if err := pcall(func() { + ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Type).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDType", err)) + } + for local168 := range (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Pos { + { + x := ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Pos)[local168] + write32(w, math.Float32bits(x)) + } + } + if len(([]byte((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Name))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Name)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Name))[:]) + chk(err) + } + for local169 := range (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Scale { + { + x := ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Scale)[local169] + write32(w, math.Float32bits(x)) + } + } + if len(([]byte((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Text))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Text)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Text))[:]) + chk(err) + } + { + x := (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Number + write32(w, uint32(x)) + } + { + x := (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Item + write32(w, uint32(x)) + } + { + x := (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Dir + write32(w, uint32(x)) + } + for local170 := range (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Align { + { + x := ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Align)[local170] + write32(w, math.Float32bits(x)) + } + } + for local171 := range (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Offset { + { + x := ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Offset)[local171] + write32(w, math.Float32bits(x)) + } + } + if err := pcall(func() { + ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).WorldPos).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + for local172 := range (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Size { + { + x := ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Size)[local172] + write32(w, uint32(x)) + } + } + { + x := (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).ZIndex + write16(w, uint16(x)) + } + if len(([]byte((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Text2))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Text2)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Text2))[:]) + chk(err) + } +} + +func (obj *ToCltAddHUD) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).ID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDID", err)) + } + if err := pcall(func() { + ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Type).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDType", err)) + } + for local173 := range (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Pos { + { + p := &((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Pos)[local173] + *p = math.Float32frombits(read32(r)) + } + } + var local174 []uint8 + var local175 uint16 + { + p := &local175 + *p = read16(r) + } + (local174) = make([]uint8, local175) + { + _, err := io.ReadFull(r, (local174)[:]) + chk(err) + } + ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Name) = string(local174) + for local176 := range (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Scale { + { + p := &((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Scale)[local176] + *p = math.Float32frombits(read32(r)) + } + } + var local177 []uint8 + var local178 uint16 + { + p := &local178 + *p = read16(r) + } + (local177) = make([]uint8, local178) + { + _, err := io.ReadFull(r, (local177)[:]) + chk(err) + } + ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Text) = string(local177) + { + p := &(*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Number + *p = read32(r) + } + { + p := &(*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Item + *p = read32(r) + } + { + p := &(*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Dir + *p = read32(r) + } + for local179 := range (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Align { + { + p := &((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Align)[local179] + *p = math.Float32frombits(read32(r)) + } + } + for local180 := range (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Offset { + { + p := &((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Offset)[local180] + *p = math.Float32frombits(read32(r)) + } + } + if err := pcall(func() { + ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).WorldPos).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + for local181 := range (*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Size { + { + p := &((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Size)[local181] + *p = int32(read32(r)) + } + } + { + p := &(*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).ZIndex + *p = int16(read16(r)) + } + var local182 []uint8 + var local183 uint16 + { + p := &local183 + *p = read16(r) + } + (local182) = make([]uint8, local183) + { + _, err := io.ReadFull(r, (local182)[:]) + chk(err) + } + ((*(*(struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string + }))(obj)).Text2) = string(local182) +} + +func (obj *ToCltRmHUD) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + ID HUDID + }))(obj)).ID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDID", err)) + } +} + +func (obj *ToCltRmHUD) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + ID HUDID + }))(obj)).ID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDID", err)) + } +} + +func (obj *ToCltChangeHUD) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).ID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDID", err)) + } + if err := pcall(func() { + ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDField", err)) + } + if !((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field < hudMax) { + chk(errors.New("assertion failed: %s.Field < hudMax")) + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDPos { + for local184 := range (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Pos { + { + x := ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Pos)[local184] + write32(w, math.Float32bits(x)) + } + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDName { + if len(([]byte((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Name))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Name)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Name))[:]) + chk(err) + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDScale { + for local185 := range (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Scale { + { + x := ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Scale)[local185] + write32(w, math.Float32bits(x)) + } + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDText { + if len(([]byte((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Text))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Text)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Text))[:]) + chk(err) + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDNumber { + { + x := (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Number + write32(w, uint32(x)) + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDItem { + { + x := (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Item + write32(w, uint32(x)) + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDDir { + { + x := (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Dir + write32(w, uint32(x)) + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDAlign { + for local186 := range (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Align { + { + x := ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Align)[local186] + write32(w, math.Float32bits(x)) + } + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDOffset { + for local187 := range (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Offset { + { + x := ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Offset)[local187] + write32(w, math.Float32bits(x)) + } + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDWorldPos { + if err := pcall(func() { + ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).WorldPos).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDSize { + for local188 := range (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Size { + { + x := ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Size)[local188] + write32(w, uint32(x)) + } + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDZIndex { + { + x := (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).ZIndex + write32(w, uint32(x)) + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDText2 { + if len(([]byte((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Text2))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Text2)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Text2))[:]) + chk(err) + } + } +} + +func (obj *ToCltChangeHUD) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).ID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDID", err)) + } + if err := pcall(func() { + ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDField", err)) + } + if !((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field < hudMax) { + chk(errors.New("assertion failed: %s.Field < hudMax")) + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDPos { + for local189 := range (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Pos { + { + p := &((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Pos)[local189] + *p = math.Float32frombits(read32(r)) + } + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDName { + var local190 []uint8 + var local191 uint16 + { + p := &local191 + *p = read16(r) + } + (local190) = make([]uint8, local191) + { + _, err := io.ReadFull(r, (local190)[:]) + chk(err) + } + ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Name) = string(local190) + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDScale { + for local192 := range (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Scale { + { + p := &((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Scale)[local192] + *p = math.Float32frombits(read32(r)) + } + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDText { + var local193 []uint8 + var local194 uint16 + { + p := &local194 + *p = read16(r) + } + (local193) = make([]uint8, local194) + { + _, err := io.ReadFull(r, (local193)[:]) + chk(err) + } + ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Text) = string(local193) + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDNumber { + { + p := &(*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Number + *p = read32(r) + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDItem { + { + p := &(*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Item + *p = read32(r) + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDDir { + { + p := &(*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Dir + *p = read32(r) + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDAlign { + for local195 := range (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Align { + { + p := &((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Align)[local195] + *p = math.Float32frombits(read32(r)) + } + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDOffset { + for local196 := range (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Offset { + { + p := &((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Offset)[local196] + *p = math.Float32frombits(read32(r)) + } + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDWorldPos { + if err := pcall(func() { + ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).WorldPos).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDSize { + for local197 := range (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Size { + { + p := &((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Size)[local197] + *p = int32(read32(r)) + } + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDZIndex { + { + p := &(*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).ZIndex + *p = read32(r) + } + } + if (*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Field == HUDText2 { + var local198 []uint8 + var local199 uint16 + { + p := &local199 + *p = read16(r) + } + (local198) = make([]uint8, local199) + { + _, err := io.ReadFull(r, (local198)[:]) + chk(err) + } + ((*(*(struct { + ID HUDID + + Field HUDField + + //mt:if %s.Field == HUDPos + Pos [2]float32 + + //mt:if %s.Field == HUDName + Name string + + //mt:if %s.Field == HUDScale + Scale [2]float32 + + //mt:if %s.Field == HUDText + Text string + + //mt:if %s.Field == HUDNumber + Number uint32 + + //mt:if %s.Field == HUDItem + Item uint32 + + //mt:if %s.Field == HUDDir + Dir uint32 + + //mt:if %s.Field == HUDAlign + Align [2]float32 + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + + //mt:if %s.Field == HUDSize + Size [2]int32 + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + + //mt:if %s.Field == HUDText2 + Text2 string + }))(obj)).Text2) = string(local198) + } +} + +func (obj *ToCltHUDFlags) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + // &^= Mask + // |= Flags + Flags, Mask HUDFlags + }))(obj)).Flags).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDFlags", err)) + } + if err := pcall(func() { + ((*(*(struct { + // &^= Mask + // |= Flags + Flags, Mask HUDFlags + }))(obj)).Mask).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDFlags", err)) + } +} + +func (obj *ToCltHUDFlags) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + // &^= Mask + // |= Flags + Flags, Mask HUDFlags + }))(obj)).Flags).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDFlags", err)) + } + if err := pcall(func() { + ((*(*(struct { + // &^= Mask + // |= Flags + Flags, Mask HUDFlags + }))(obj)).Mask).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HUDFlags", err)) + } +} + +func (obj *ToCltSetHotbarParam) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Param HotbarParam + + //mt:if %s.Param == HotbarSize + //mt:const uint16(4) // Size of Size field. + Size int32 + + //mt:if %s.Param != HotbarSize + Img Texture + }))(obj)).Param).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HotbarParam", err)) + } + if (*(*(struct { + Param HotbarParam + + //mt:if %s.Param == HotbarSize + //mt:const uint16(4) // Size of Size field. + Size int32 + + //mt:if %s.Param != HotbarSize + Img Texture + }))(obj)).Param == HotbarSize { + { + local200 := uint16(4) // Size of Size field. + { + x := local200 + write16(w, uint16(x)) + } + } + { + x := (*(*(struct { + Param HotbarParam + + //mt:if %s.Param == HotbarSize + //mt:const uint16(4) // Size of Size field. + Size int32 + + //mt:if %s.Param != HotbarSize + Img Texture + }))(obj)).Size + write32(w, uint32(x)) + } + } + if (*(*(struct { + Param HotbarParam + + //mt:if %s.Param == HotbarSize + //mt:const uint16(4) // Size of Size field. + Size int32 + + //mt:if %s.Param != HotbarSize + Img Texture + }))(obj)).Param != HotbarSize { + if err := pcall(func() { + ((*(*(struct { + Param HotbarParam + + //mt:if %s.Param == HotbarSize + //mt:const uint16(4) // Size of Size field. + Size int32 + + //mt:if %s.Param != HotbarSize + Img Texture + }))(obj)).Img).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + } +} + +func (obj *ToCltSetHotbarParam) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Param HotbarParam + + //mt:if %s.Param == HotbarSize + //mt:const uint16(4) // Size of Size field. + Size int32 + + //mt:if %s.Param != HotbarSize + Img Texture + }))(obj)).Param).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.HotbarParam", err)) + } + if (*(*(struct { + Param HotbarParam + + //mt:if %s.Param == HotbarSize + //mt:const uint16(4) // Size of Size field. + Size int32 + + //mt:if %s.Param != HotbarSize + Img Texture + }))(obj)).Param == HotbarSize { + { + var local201 uint16 + { + p := &local201 + *p = read16(r) + } + if local201 != (4) { + chk(fmt.Errorf("const %v: %v", 4, local201)) + } + } + { + p := &(*(*(struct { + Param HotbarParam + + //mt:if %s.Param == HotbarSize + //mt:const uint16(4) // Size of Size field. + Size int32 + + //mt:if %s.Param != HotbarSize + Img Texture + }))(obj)).Size + *p = int32(read32(r)) + } + } + if (*(*(struct { + Param HotbarParam + + //mt:if %s.Param == HotbarSize + //mt:const uint16(4) // Size of Size field. + Size int32 + + //mt:if %s.Param != HotbarSize + Img Texture + }))(obj)).Param != HotbarSize { + if err := pcall(func() { + ((*(*(struct { + Param HotbarParam + + //mt:if %s.Param == HotbarSize + //mt:const uint16(4) // Size of Size field. + Size int32 + + //mt:if %s.Param != HotbarSize + Img Texture + }))(obj)).Img).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + } +} + +func (obj *ToCltBreath) serialize(w io.Writer) { + { + x := (*(*(struct { + Breath uint16 + }))(obj)).Breath + write16(w, uint16(x)) + } +} + +func (obj *ToCltBreath) deserialize(r io.Reader) { + { + p := &(*(*(struct { + Breath uint16 + }))(obj)).Breath + *p = read16(r) + } +} + +func (obj *ToCltSkyParams) serialize(w io.Writer) { + { + x := (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).BgColor + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + if len(([]byte((*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Type))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Type)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Type))[:]) + chk(err) + } + { + x := (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Clouds + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).SunFogTint + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + { + x := (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).MoonFogTint + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + if len(([]byte((*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).FogTintType))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).FogTintType)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).FogTintType))[:]) + chk(err) + } + if (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Type == "skybox" { + if len(((*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Textures)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Textures))) + write16(w, uint16(x)) + } + for local202 := range (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Textures { + if err := pcall(func() { + (((*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Textures)[local202]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + } + } + if (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Type == "regular" { + { + x := (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).DaySky + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + { + x := (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).DayHorizon + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + { + x := (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).DawnSky + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + { + x := (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).DawnHorizon + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + { + x := (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).NightSky + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + { + x := (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).NightHorizon + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + { + x := (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Indoor + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + } +} + +func (obj *ToCltSkyParams) deserialize(r io.Reader) { + { + p := &(*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).BgColor + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + var local203 []uint8 + var local204 uint16 + { + p := &local204 + *p = read16(r) + } + (local203) = make([]uint8, local204) + { + _, err := io.ReadFull(r, (local203)[:]) + chk(err) + } + ((*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Type) = string(local203) + { + p := &(*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Clouds + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).SunFogTint + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + { + p := &(*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).MoonFogTint + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + var local205 []uint8 + var local206 uint16 + { + p := &local206 + *p = read16(r) + } + (local205) = make([]uint8, local206) + { + _, err := io.ReadFull(r, (local205)[:]) + chk(err) + } + ((*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).FogTintType) = string(local205) + if (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Type == "skybox" { + var local207 uint16 + { + p := &local207 + *p = read16(r) + } + ((*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Textures) = make([]Texture, local207) + for local208 := range (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Textures { + if err := pcall(func() { + (((*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Textures)[local208]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + } + } + if (*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Type == "regular" { + { + p := &(*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).DaySky + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + { + p := &(*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).DayHorizon + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + { + p := &(*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).DawnSky + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + { + p := &(*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).DawnHorizon + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + { + p := &(*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).NightSky + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + { + p := &(*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).NightHorizon + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + { + p := &(*(*(struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + }))(obj)).Indoor + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + } +} + +func (obj *ToCltOverrideDayNightRatio) serialize(w io.Writer) { + { + x := (*(*(struct { + Override bool + Ratio uint16 + }))(obj)).Override + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Override bool + Ratio uint16 + }))(obj)).Ratio + write16(w, uint16(x)) + } +} + +func (obj *ToCltOverrideDayNightRatio) deserialize(r io.Reader) { + { + p := &(*(*(struct { + Override bool + Ratio uint16 + }))(obj)).Override + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Override bool + Ratio uint16 + }))(obj)).Ratio + *p = read16(r) + } +} + +func (obj *ToCltLocalPlayerAnim) serialize(w io.Writer) { + for local209 := range (*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Idle { + { + x := ((*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Idle)[local209] + write32(w, uint32(x)) + } + } + for local210 := range (*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Walk { + { + x := ((*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Walk)[local210] + write32(w, uint32(x)) + } + } + for local211 := range (*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Dig { + { + x := ((*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Dig)[local211] + write32(w, uint32(x)) + } + } + for local212 := range (*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).WalkDig { + { + x := ((*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).WalkDig)[local212] + write32(w, uint32(x)) + } + } + { + x := (*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Speed + write32(w, math.Float32bits(x)) + } +} + +func (obj *ToCltLocalPlayerAnim) deserialize(r io.Reader) { + for local213 := range (*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Idle { + { + p := &((*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Idle)[local213] + *p = int32(read32(r)) + } + } + for local214 := range (*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Walk { + { + p := &((*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Walk)[local214] + *p = int32(read32(r)) + } + } + for local215 := range (*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Dig { + { + p := &((*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Dig)[local215] + *p = int32(read32(r)) + } + } + for local216 := range (*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).WalkDig { + { + p := &((*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).WalkDig)[local216] + *p = int32(read32(r)) + } + } + { + p := &(*(*(struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 + }))(obj)).Speed + *p = math.Float32frombits(read32(r)) + } +} + +func (obj *ToCltEyeOffset) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + First, Third Vec + }))(obj)).First).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } + if err := pcall(func() { + ((*(*(struct { + First, Third Vec + }))(obj)).Third).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } +} + +func (obj *ToCltEyeOffset) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + First, Third Vec + }))(obj)).First).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } + if err := pcall(func() { + ((*(*(struct { + First, Third Vec + }))(obj)).Third).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } +} + +func (obj *ToCltDelParticleSpawner) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + ID ParticleSpawnerID + }))(obj)).ID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ParticleSpawnerID", err)) + } +} + +func (obj *ToCltDelParticleSpawner) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + ID ParticleSpawnerID + }))(obj)).ID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ParticleSpawnerID", err)) + } +} + +func (obj *ToCltCloudParams) serialize(w io.Writer) { + { + x := (*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).Density + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).DiffuseColor + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + { + x := (*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).AmbientColor + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + { + x := (*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).Height + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).Thickness + write32(w, math.Float32bits(x)) + } + for local217 := range (*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).Speed { + { + x := ((*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).Speed)[local217] + write32(w, math.Float32bits(x)) + } + } +} + +func (obj *ToCltCloudParams) deserialize(r io.Reader) { + { + p := &(*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).Density + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).DiffuseColor + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + { + p := &(*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).AmbientColor + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + { + p := &(*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).Height + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).Thickness + *p = math.Float32frombits(read32(r)) + } + for local218 := range (*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).Speed { + { + p := &((*(*(struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 + }))(obj)).Speed)[local218] + *p = math.Float32frombits(read32(r)) + } + } +} + +func (obj *ToCltFadeSound) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + ID SoundID + Step float32 + Gain float32 + }))(obj)).ID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundID", err)) + } + { + x := (*(*(struct { + ID SoundID + Step float32 + Gain float32 + }))(obj)).Step + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + ID SoundID + Step float32 + Gain float32 + }))(obj)).Gain + write32(w, math.Float32bits(x)) + } +} + +func (obj *ToCltFadeSound) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + ID SoundID + Step float32 + Gain float32 + }))(obj)).ID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundID", err)) + } + { + p := &(*(*(struct { + ID SoundID + Step float32 + Gain float32 + }))(obj)).Step + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + ID SoundID + Step float32 + Gain float32 + }))(obj)).Gain + *p = math.Float32frombits(read32(r)) + } +} + +func (obj *ToCltUpdatePlayerList) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Type PlayerListUpdateType + Players []string + }))(obj)).Type).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.PlayerListUpdateType", err)) + } + if len(((*(*(struct { + Type PlayerListUpdateType + Players []string + }))(obj)).Players)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Type PlayerListUpdateType + Players []string + }))(obj)).Players))) + write16(w, uint16(x)) + } + for local219 := range (*(*(struct { + Type PlayerListUpdateType + Players []string + }))(obj)).Players { + if len(([]byte(((*(*(struct { + Type PlayerListUpdateType + Players []string + }))(obj)).Players)[local219]))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte(((*(*(struct { + Type PlayerListUpdateType + Players []string + }))(obj)).Players)[local219])))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte(((*(*(struct { + Type PlayerListUpdateType + Players []string + }))(obj)).Players)[local219]))[:]) + chk(err) + } + } +} + +func (obj *ToCltUpdatePlayerList) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Type PlayerListUpdateType + Players []string + }))(obj)).Type).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.PlayerListUpdateType", err)) + } + var local220 uint16 + { + p := &local220 + *p = read16(r) + } + ((*(*(struct { + Type PlayerListUpdateType + Players []string + }))(obj)).Players) = make([]string, local220) + for local221 := range (*(*(struct { + Type PlayerListUpdateType + Players []string + }))(obj)).Players { + var local222 []uint8 + var local223 uint16 + { + p := &local223 + *p = read16(r) + } + (local222) = make([]uint8, local223) + { + _, err := io.ReadFull(r, (local222)[:]) + chk(err) + } + (((*(*(struct { + Type PlayerListUpdateType + Players []string + }))(obj)).Players)[local221]) = string(local222) + } +} + +func (obj *ToCltModChanMsg) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + Channel string + Sender string + Msg string + }))(obj)).Channel))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Channel string + Sender string + Msg string + }))(obj)).Channel)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Channel string + Sender string + Msg string + }))(obj)).Channel))[:]) + chk(err) + } + if len(([]byte((*(*(struct { + Channel string + Sender string + Msg string + }))(obj)).Sender))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Channel string + Sender string + Msg string + }))(obj)).Sender)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Channel string + Sender string + Msg string + }))(obj)).Sender))[:]) + chk(err) + } + if len(([]byte((*(*(struct { + Channel string + Sender string + Msg string + }))(obj)).Msg))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Channel string + Sender string + Msg string + }))(obj)).Msg)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Channel string + Sender string + Msg string + }))(obj)).Msg))[:]) + chk(err) + } +} + +func (obj *ToCltModChanMsg) deserialize(r io.Reader) { + var local224 []uint8 + var local225 uint16 + { + p := &local225 + *p = read16(r) + } + (local224) = make([]uint8, local225) + { + _, err := io.ReadFull(r, (local224)[:]) + chk(err) + } + ((*(*(struct { + Channel string + Sender string + Msg string + }))(obj)).Channel) = string(local224) + var local226 []uint8 + var local227 uint16 + { + p := &local227 + *p = read16(r) + } + (local226) = make([]uint8, local227) + { + _, err := io.ReadFull(r, (local226)[:]) + chk(err) + } + ((*(*(struct { + Channel string + Sender string + Msg string + }))(obj)).Sender) = string(local226) + var local228 []uint8 + var local229 uint16 + { + p := &local229 + *p = read16(r) + } + (local228) = make([]uint8, local229) + { + _, err := io.ReadFull(r, (local228)[:]) + chk(err) + } + ((*(*(struct { + Channel string + Sender string + Msg string + }))(obj)).Msg) = string(local228) +} + +func (obj *ToCltModChanSig) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Signal ModChanSig + Channel string + }))(obj)).Signal).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ModChanSig", err)) + } + if len(([]byte((*(*(struct { + Signal ModChanSig + Channel string + }))(obj)).Channel))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Signal ModChanSig + Channel string + }))(obj)).Channel)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Signal ModChanSig + Channel string + }))(obj)).Channel))[:]) + chk(err) + } +} + +func (obj *ToCltModChanSig) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Signal ModChanSig + Channel string + }))(obj)).Signal).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ModChanSig", err)) + } + var local230 []uint8 + var local231 uint16 + { + p := &local231 + *p = read16(r) + } + (local230) = make([]uint8, local231) + { + _, err := io.ReadFull(r, (local230)[:]) + chk(err) + } + ((*(*(struct { + Signal ModChanSig + Channel string + }))(obj)).Channel) = string(local230) +} + +func (obj *ToCltNodeMetasChanged) serialize(w io.Writer) { + { + ow := w + w := new(bytes.Buffer) + { + x := (*(*(struct { + //mt:lenhdr 32 + Changed map[[3]int16]*NodeMeta + }))(obj)).Changed + { + w := zlib.NewWriter(w) + if x == nil { + write8(w, 0) + } else { + write8(w, 2) + if len(x) > math.MaxUint16 { + chk(ErrTooLong) + } + write16(w, uint16(len(x))) + keys := make([][3]int16, 0, len(x)) + for key := range x { + keys = append(keys, key) + } + sort.Slice(keys, func(i, j int) bool { + p, q := keys[i], keys[j] + for i := range p { + switch { + case p[i] < q[i]: + return true + case p[i] > q[i]: + return false + } + } + return false + }) + for _, key := range keys { + for _, n := range key { + write16(w, uint16(n)) + } + chk(serialize(w, x[key])) + } + } + chk(w.Close()) + } + } + { + buf := w + w := ow + if len((buf.Bytes())) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len((buf.Bytes()))) + write32(w, uint32(x)) + } + { + _, err := w.Write((buf.Bytes())[:]) + chk(err) + } + } + } +} + +func (obj *ToCltNodeMetasChanged) deserialize(r io.Reader) { + { + var n uint32 + { + p := &n + *p = read32(r) + } + r := &io.LimitedReader{r, int64(n)} + { + p := &(*(*(struct { + //mt:lenhdr 32 + Changed map[[3]int16]*NodeMeta + }))(obj)).Changed + { + r, err := zlib.NewReader(byteReader{r}) + chk(err) + switch ver := read8(r); ver { + case 0: + *p = nil + case 2: + n := read16(r) + *p = make(map[[3]int16]*NodeMeta, n) + for ; n > 0; n-- { + var pos [3]int16 + for i := range pos { + pos[i] = int16(read16(r)) + } + nm := new(NodeMeta) + chk(deserialize(r, nm)) + (*p)[pos] = nm + } + default: + chk(fmt.Errorf("unsupported nodemetas version: %d", ver)) + } + chk(r.Close()) + } + } + if r.N > 0 { + chk(fmt.Errorf("%d bytes of trailing data", r.N)) + } + } +} + +func (obj *ToCltSunParams) serialize(w io.Writer) { + { + x := (*(*(struct { + Visible bool + Texture + ToneMap Texture + Rise Texture + Rising bool + Size float32 + }))(obj)).Visible + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if err := pcall(func() { + ((*(*(struct { + Visible bool + Texture + ToneMap Texture + Rise Texture + Rising bool + Size float32 + }))(obj)).Texture).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Visible bool + Texture + ToneMap Texture + Rise Texture + Rising bool + Size float32 + }))(obj)).ToneMap).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Visible bool + Texture + ToneMap Texture + Rise Texture + Rising bool + Size float32 + }))(obj)).Rise).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + { + x := (*(*(struct { + Visible bool + Texture + ToneMap Texture + Rise Texture + Rising bool + Size float32 + }))(obj)).Rising + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Visible bool + Texture + ToneMap Texture + Rise Texture + Rising bool + Size float32 + }))(obj)).Size + write32(w, math.Float32bits(x)) + } +} + +func (obj *ToCltSunParams) deserialize(r io.Reader) { + { + p := &(*(*(struct { + Visible bool + Texture + ToneMap Texture + Rise Texture + Rising bool + Size float32 + }))(obj)).Visible + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + if err := pcall(func() { + ((*(*(struct { + Visible bool + Texture + ToneMap Texture + Rise Texture + Rising bool + Size float32 + }))(obj)).Texture).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Visible bool + Texture + ToneMap Texture + Rise Texture + Rising bool + Size float32 + }))(obj)).ToneMap).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Visible bool + Texture + ToneMap Texture + Rise Texture + Rising bool + Size float32 + }))(obj)).Rise).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + { + p := &(*(*(struct { + Visible bool + Texture + ToneMap Texture + Rise Texture + Rising bool + Size float32 + }))(obj)).Rising + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Visible bool + Texture + ToneMap Texture + Rise Texture + Rising bool + Size float32 + }))(obj)).Size + *p = math.Float32frombits(read32(r)) + } +} + +func (obj *ToCltMoonParams) serialize(w io.Writer) { + { + x := (*(*(struct { + Visible bool + Texture + ToneMap Texture + Size float32 + }))(obj)).Visible + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if err := pcall(func() { + ((*(*(struct { + Visible bool + Texture + ToneMap Texture + Size float32 + }))(obj)).Texture).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Visible bool + Texture + ToneMap Texture + Size float32 + }))(obj)).ToneMap).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + { + x := (*(*(struct { + Visible bool + Texture + ToneMap Texture + Size float32 + }))(obj)).Size + write32(w, math.Float32bits(x)) + } +} + +func (obj *ToCltMoonParams) deserialize(r io.Reader) { + { + p := &(*(*(struct { + Visible bool + Texture + ToneMap Texture + Size float32 + }))(obj)).Visible + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + if err := pcall(func() { + ((*(*(struct { + Visible bool + Texture + ToneMap Texture + Size float32 + }))(obj)).Texture).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Visible bool + Texture + ToneMap Texture + Size float32 + }))(obj)).ToneMap).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + { + p := &(*(*(struct { + Visible bool + Texture + ToneMap Texture + Size float32 + }))(obj)).Size + *p = math.Float32frombits(read32(r)) + } +} + +func (obj *ToCltStarParams) serialize(w io.Writer) { + { + x := (*(*(struct { + Visible bool + Count uint32 + Color color.NRGBA + Size float32 + }))(obj)).Visible + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Visible bool + Count uint32 + Color color.NRGBA + Size float32 + }))(obj)).Count + write32(w, uint32(x)) + } + { + x := (*(*(struct { + Visible bool + Count uint32 + Color color.NRGBA + Size float32 + }))(obj)).Color + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + { + x := (*(*(struct { + Visible bool + Count uint32 + Color color.NRGBA + Size float32 + }))(obj)).Size + write32(w, math.Float32bits(x)) + } +} + +func (obj *ToCltStarParams) deserialize(r io.Reader) { + { + p := &(*(*(struct { + Visible bool + Count uint32 + Color color.NRGBA + Size float32 + }))(obj)).Visible + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Visible bool + Count uint32 + Color color.NRGBA + Size float32 + }))(obj)).Count + *p = read32(r) + } + { + p := &(*(*(struct { + Visible bool + Count uint32 + Color color.NRGBA + Size float32 + }))(obj)).Color + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + { + p := &(*(*(struct { + Visible bool + Count uint32 + Color color.NRGBA + Size float32 + }))(obj)).Size + *p = math.Float32frombits(read32(r)) + } +} + +func (obj *ToCltSRPBytesSaltB) serialize(w io.Writer) { + if len(((*(*(struct { + Salt, B []byte + }))(obj)).Salt)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Salt, B []byte + }))(obj)).Salt))) + write16(w, uint16(x)) + } + { + _, err := w.Write(((*(*(struct { + Salt, B []byte + }))(obj)).Salt)[:]) + chk(err) + } + if len(((*(*(struct { + Salt, B []byte + }))(obj)).B)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Salt, B []byte + }))(obj)).B))) + write16(w, uint16(x)) + } + { + _, err := w.Write(((*(*(struct { + Salt, B []byte + }))(obj)).B)[:]) + chk(err) + } +} + +func (obj *ToCltSRPBytesSaltB) deserialize(r io.Reader) { + var local232 uint16 + { + p := &local232 + *p = read16(r) + } + ((*(*(struct { + Salt, B []byte + }))(obj)).Salt) = make([]byte, local232) + { + _, err := io.ReadFull(r, ((*(*(struct { + Salt, B []byte + }))(obj)).Salt)[:]) + chk(err) + } + var local233 uint16 + { + p := &local233 + *p = read16(r) + } + ((*(*(struct { + Salt, B []byte + }))(obj)).B) = make([]byte, local233) + { + _, err := io.ReadFull(r, ((*(*(struct { + Salt, B []byte + }))(obj)).B)[:]) + chk(err) + } +} + +func (obj *ToCltFormspecPrepend) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + Prepend string + }))(obj)).Prepend))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Prepend string + }))(obj)).Prepend)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Prepend string + }))(obj)).Prepend))[:]) + chk(err) + } +} + +func (obj *ToCltFormspecPrepend) deserialize(r io.Reader) { + var local234 []uint8 + var local235 uint16 + { + p := &local235 + *p = read16(r) + } + (local234) = make([]uint8, local235) + { + _, err := io.ReadFull(r, (local234)[:]) + chk(err) + } + ((*(*(struct { + Prepend string + }))(obj)).Prepend) = string(local234) +} + +func (obj *AOCmdProps) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Props AOProps + }))(obj)).Props).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOProps", err)) + } +} + +func (obj *AOCmdProps) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Props AOProps + }))(obj)).Props).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOProps", err)) + } +} + +func (obj *AOCmdPos) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Pos AOPos + }))(obj)).Pos).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOPos", err)) + } +} + +func (obj *AOCmdPos) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Pos AOPos + }))(obj)).Pos).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOPos", err)) + } +} + +func (obj *AOCmdTextureMod) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Mod Texture // suffix + }))(obj)).Mod).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } +} + +func (obj *AOCmdTextureMod) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Mod Texture // suffix + }))(obj)).Mod).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } +} + +func (obj *AOCmdSprite) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Sprite AOSprite + }))(obj)).Sprite).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOSprite", err)) + } +} + +func (obj *AOCmdSprite) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Sprite AOSprite + }))(obj)).Sprite).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOSprite", err)) + } +} + +func (obj *AOCmdHP) serialize(w io.Writer) { + { + x := (*(*(struct { + HP uint16 + }))(obj)).HP + write16(w, uint16(x)) + } +} + +func (obj *AOCmdHP) deserialize(r io.Reader) { + { + p := &(*(*(struct { + HP uint16 + }))(obj)).HP + *p = read16(r) + } +} + +func (obj *AOCmdArmorGroups) serialize(w io.Writer) { + if len(((*(*(struct { + Armor []Group + }))(obj)).Armor)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Armor []Group + }))(obj)).Armor))) + write16(w, uint16(x)) + } + for local236 := range (*(*(struct { + Armor []Group + }))(obj)).Armor { + if err := pcall(func() { + (((*(*(struct { + Armor []Group + }))(obj)).Armor)[local236]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Group", err)) + } + } +} + +func (obj *AOCmdArmorGroups) deserialize(r io.Reader) { + var local237 uint16 + { + p := &local237 + *p = read16(r) + } + ((*(*(struct { + Armor []Group + }))(obj)).Armor) = make([]Group, local237) + for local238 := range (*(*(struct { + Armor []Group + }))(obj)).Armor { + if err := pcall(func() { + (((*(*(struct { + Armor []Group + }))(obj)).Armor)[local238]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Group", err)) + } + } +} + +func (obj *AOCmdAnim) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Anim AOAnim + }))(obj)).Anim).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOAnim", err)) + } +} + +func (obj *AOCmdAnim) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Anim AOAnim + }))(obj)).Anim).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOAnim", err)) + } +} + +func (obj *AOCmdBonePos) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + Bone string + Pos AOBonePos + }))(obj)).Bone))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Bone string + Pos AOBonePos + }))(obj)).Bone)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Bone string + Pos AOBonePos + }))(obj)).Bone))[:]) + chk(err) + } + if err := pcall(func() { + ((*(*(struct { + Bone string + Pos AOBonePos + }))(obj)).Pos).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOBonePos", err)) + } +} + +func (obj *AOCmdBonePos) deserialize(r io.Reader) { + var local239 []uint8 + var local240 uint16 + { + p := &local240 + *p = read16(r) + } + (local239) = make([]uint8, local240) + { + _, err := io.ReadFull(r, (local239)[:]) + chk(err) + } + ((*(*(struct { + Bone string + Pos AOBonePos + }))(obj)).Bone) = string(local239) + if err := pcall(func() { + ((*(*(struct { + Bone string + Pos AOBonePos + }))(obj)).Pos).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOBonePos", err)) + } +} + +func (obj *AOCmdAttach) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Attach AOAttach + }))(obj)).Attach).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOAttach", err)) + } +} + +func (obj *AOCmdAttach) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Attach AOAttach + }))(obj)).Attach).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOAttach", err)) + } +} + +func (obj *AOCmdPhysOverride) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Phys AOPhysOverride + }))(obj)).Phys).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOPhysOverride", err)) + } +} + +func (obj *AOCmdPhysOverride) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Phys AOPhysOverride + }))(obj)).Phys).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOPhysOverride", err)) + } +} + +func (obj *AOCmdSpawnInfant) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + ID AOID + }))(obj)).ID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + { + local241 := genericCAO + if err := pcall(func() { + (local241).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.aoType", err)) + } + } +} + +func (obj *AOCmdSpawnInfant) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + ID AOID + }))(obj)).ID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + { + var local242 aoType + if err := pcall(func() { + (local242).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.aoType", err)) + } + if local242 != (101) { + chk(fmt.Errorf("const %v: %v", 101, local242)) + } + } +} + +func (obj *AOCmdAnimSpeed) serialize(w io.Writer) { + { + x := (*(*(struct { + Speed float32 + }))(obj)).Speed + write32(w, math.Float32bits(x)) + } +} + +func (obj *AOCmdAnimSpeed) deserialize(r io.Reader) { + { + p := &(*(*(struct { + Speed float32 + }))(obj)).Speed + *p = math.Float32frombits(read32(r)) + } +} + +func (obj *NodeMeta) serialize(w io.Writer) { + if len(((*(*(struct { + //mt:len32 + Fields []NodeMetaField + + Inv Inv + }))(obj)).Fields)) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len(((*(*(struct { + //mt:len32 + Fields []NodeMetaField + + Inv Inv + }))(obj)).Fields))) + write32(w, uint32(x)) + } + for local243 := range (*(*(struct { + //mt:len32 + Fields []NodeMetaField + + Inv Inv + }))(obj)).Fields { + if err := pcall(func() { + (((*(*(struct { + //mt:len32 + Fields []NodeMetaField + + Inv Inv + }))(obj)).Fields)[local243]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.NodeMetaField", err)) + } + } + chk(((*(*(struct { + //mt:len32 + Fields []NodeMetaField + + Inv Inv + }))(obj)).Inv).Serialize(w)) +} + +func (obj *NodeMeta) deserialize(r io.Reader) { + var local244 uint32 + { + p := &local244 + *p = read32(r) + } + ((*(*(struct { + //mt:len32 + Fields []NodeMetaField + + Inv Inv + }))(obj)).Fields) = make([]NodeMetaField, local244) + for local245 := range (*(*(struct { + //mt:len32 + Fields []NodeMetaField + + Inv Inv + }))(obj)).Fields { + if err := pcall(func() { + (((*(*(struct { + //mt:len32 + Fields []NodeMetaField + + Inv Inv + }))(obj)).Fields)[local245]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.NodeMetaField", err)) + } + } + chk(((*(*(struct { + //mt:len32 + Fields []NodeMetaField + + Inv Inv + }))(obj)).Inv).Deserialize(r)) +} + +func (obj *MinimapMode) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Type MinimapType + Label string + Size uint16 + Texture + Scale uint16 + }))(obj)).Type).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.MinimapType", err)) + } + if len(([]byte((*(*(struct { + Type MinimapType + Label string + Size uint16 + Texture + Scale uint16 + }))(obj)).Label))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Type MinimapType + Label string + Size uint16 + Texture + Scale uint16 + }))(obj)).Label)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Type MinimapType + Label string + Size uint16 + Texture + Scale uint16 + }))(obj)).Label))[:]) + chk(err) + } + { + x := (*(*(struct { + Type MinimapType + Label string + Size uint16 + Texture + Scale uint16 + }))(obj)).Size + write16(w, uint16(x)) + } + if err := pcall(func() { + ((*(*(struct { + Type MinimapType + Label string + Size uint16 + Texture + Scale uint16 + }))(obj)).Texture).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + { + x := (*(*(struct { + Type MinimapType + Label string + Size uint16 + Texture + Scale uint16 + }))(obj)).Scale + write16(w, uint16(x)) + } +} + +func (obj *MinimapMode) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Type MinimapType + Label string + Size uint16 + Texture + Scale uint16 + }))(obj)).Type).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.MinimapType", err)) + } + var local246 []uint8 + var local247 uint16 + { + p := &local247 + *p = read16(r) + } + (local246) = make([]uint8, local247) + { + _, err := io.ReadFull(r, (local246)[:]) + chk(err) + } + ((*(*(struct { + Type MinimapType + Label string + Size uint16 + Texture + Scale uint16 + }))(obj)).Label) = string(local246) + { + p := &(*(*(struct { + Type MinimapType + Label string + Size uint16 + Texture + Scale uint16 + }))(obj)).Size + *p = read16(r) + } + if err := pcall(func() { + ((*(*(struct { + Type MinimapType + Label string + Size uint16 + Texture + Scale uint16 + }))(obj)).Texture).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + { + p := &(*(*(struct { + Type MinimapType + Label string + Size uint16 + Texture + Scale uint16 + }))(obj)).Scale + *p = read16(r) + } +} + +func (obj *NodeDef) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Param0).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Content", err)) + } + { + ow := w + w := new(bytes.Buffer) + { + local248 := uint8(13) + { + x := local248 + write8(w, uint8(x)) + } + } + if len(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Name))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Name)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Name))[:]) + chk(err) + } + if len(((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Groups)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Groups))) + write16(w, uint16(x)) + } + for local249 := range (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Groups { + if err := pcall(func() { + (((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Groups)[local249]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Group", err)) + } + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).P1Type).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Param1Type", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).P2Type).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Param2Type", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DrawType).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.DrawType", err)) + } + if len(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Mesh))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Mesh)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Mesh))[:]) + chk(err) + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Scale + write32(w, math.Float32bits(x)) + } + { + local250 := uint8(6) + { + x := local250 + write8(w, uint8(x)) + } + } + for local251 := range (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Tiles { + if err := pcall(func() { + (((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Tiles)[local251]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileDef", err)) + } + } + for local252 := range (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).OverlayTiles { + if err := pcall(func() { + (((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).OverlayTiles)[local252]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileDef", err)) + } + } + { + local253 := uint8(6) + { + x := local253 + write8(w, uint8(x)) + } + } + for local254 := range (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).SpecialTiles { + if err := pcall(func() { + (((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).SpecialTiles)[local254]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileDef", err)) + } + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Color + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Palette).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Waving).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.WaveType", err)) + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).ConnectSides + write8(w, uint8(x)) + } + if len(((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).ConnectTo)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).ConnectTo))) + write16(w, uint16(x)) + } + for local255 := range (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).ConnectTo { + if err := pcall(func() { + (((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).ConnectTo)[local255]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Content", err)) + } + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).InsideTint + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Level + write8(w, uint8(x)) + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Translucent + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Transparent + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).LightSrc + write8(w, uint8(x)) + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).GndContent + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Collides + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Pointable + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Diggable + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Climbable + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Replaceable + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).OnRightClick + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DmgPerSec + write32(w, uint32(x)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).LiquidType).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.LiquidType", err)) + } + if len(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).FlowingAlt))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).FlowingAlt)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).FlowingAlt))[:]) + chk(err) + } + if len(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).SrcAlt))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).SrcAlt)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).SrcAlt))[:]) + chk(err) + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Viscosity + write8(w, uint8(x)) + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).LiqRenewable + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).FlowRange + write8(w, uint8(x)) + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DrownDmg + write8(w, uint8(x)) + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Floodable + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DrawBox).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.NodeBox", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).ColBox).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.NodeBox", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).SelBox).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.NodeBox", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).FootstepSnd).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundDef", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DiggingSnd).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundDef", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DugSnd).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundDef", err)) + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).LegacyFaceDir + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).LegacyMounted + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if len(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DigPredict))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DigPredict)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DigPredict))[:]) + chk(err) + } + { + x := (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).MaxLvl + write8(w, uint8(x)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).AlphaUse).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AlphaUse", err)) + } + { + buf := w + w := ow + if len((buf.Bytes())) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len((buf.Bytes()))) + write16(w, uint16(x)) + } + { + _, err := w.Write((buf.Bytes())[:]) + chk(err) + } + } + } +} + +func (obj *NodeDef) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Param0).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Content", err)) + } + { + var n uint16 + { + p := &n + *p = read16(r) + } + r := &io.LimitedReader{r, int64(n)} + { + var local256 uint8 + { + p := &local256 + *p = read8(r) + } + if local256 != (13) { + chk(fmt.Errorf("const %v: %v", 13, local256)) + } + } + var local257 []uint8 + var local258 uint16 + { + p := &local258 + *p = read16(r) + } + (local257) = make([]uint8, local258) + { + _, err := io.ReadFull(r, (local257)[:]) + chk(err) + } + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Name) = string(local257) + var local259 uint16 + { + p := &local259 + *p = read16(r) + } + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Groups) = make([]Group, local259) + for local260 := range (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Groups { + if err := pcall(func() { + (((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Groups)[local260]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Group", err)) + } + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).P1Type).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Param1Type", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).P2Type).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Param2Type", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DrawType).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.DrawType", err)) + } + var local261 []uint8 + var local262 uint16 + { + p := &local262 + *p = read16(r) + } + (local261) = make([]uint8, local262) + { + _, err := io.ReadFull(r, (local261)[:]) + chk(err) + } + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Mesh) = string(local261) + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Scale + *p = math.Float32frombits(read32(r)) + } + { + var local263 uint8 + { + p := &local263 + *p = read8(r) + } + if local263 != (6) { + chk(fmt.Errorf("const %v: %v", 6, local263)) + } + } + for local264 := range (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Tiles { + if err := pcall(func() { + (((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Tiles)[local264]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileDef", err)) + } + } + for local265 := range (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).OverlayTiles { + if err := pcall(func() { + (((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).OverlayTiles)[local265]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileDef", err)) + } + } + { + var local266 uint8 + { + p := &local266 + *p = read8(r) + } + if local266 != (6) { + chk(fmt.Errorf("const %v: %v", 6, local266)) + } + } + for local267 := range (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).SpecialTiles { + if err := pcall(func() { + (((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).SpecialTiles)[local267]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileDef", err)) + } + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Color + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Palette).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Waving).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.WaveType", err)) + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).ConnectSides + *p = read8(r) + } + var local268 uint16 + { + p := &local268 + *p = read16(r) + } + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).ConnectTo) = make([]Content, local268) + for local269 := range (*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).ConnectTo { + if err := pcall(func() { + (((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).ConnectTo)[local269]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Content", err)) + } + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).InsideTint + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Level + *p = read8(r) + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Translucent + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Transparent + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).LightSrc + *p = read8(r) + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).GndContent + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Collides + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Pointable + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Diggable + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Climbable + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Replaceable + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).OnRightClick + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DmgPerSec + *p = int32(read32(r)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).LiquidType).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.LiquidType", err)) + } + var local270 []uint8 + var local271 uint16 + { + p := &local271 + *p = read16(r) + } + (local270) = make([]uint8, local271) + { + _, err := io.ReadFull(r, (local270)[:]) + chk(err) + } + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).FlowingAlt) = string(local270) + var local272 []uint8 + var local273 uint16 + { + p := &local273 + *p = read16(r) + } + (local272) = make([]uint8, local273) + { + _, err := io.ReadFull(r, (local272)[:]) + chk(err) + } + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).SrcAlt) = string(local272) + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Viscosity + *p = read8(r) + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).LiqRenewable + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).FlowRange + *p = read8(r) + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DrownDmg + *p = read8(r) + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).Floodable + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DrawBox).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.NodeBox", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).ColBox).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.NodeBox", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).SelBox).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.NodeBox", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).FootstepSnd).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundDef", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DiggingSnd).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundDef", err)) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DugSnd).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundDef", err)) + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).LegacyFaceDir + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).LegacyMounted + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + var local274 []uint8 + var local275 uint16 + { + p := &local275 + *p = read16(r) + } + (local274) = make([]uint8, local275) + { + _, err := io.ReadFull(r, (local274)[:]) + chk(err) + } + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).DigPredict) = string(local274) + { + p := &(*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).MaxLvl + *p = read8(r) + } + if err := pcall(func() { + ((*(*(struct { + Param0 Content + + Name string + Groups []Group + + P1Type Param1Type + P2Type Param2Type + DrawType DrawType + + Mesh string + Scale float32 + //mt:const uint8(6) + Tiles [6]TileDef + OverlayTiles [6]TileDef + //mt:const uint8(6) + SpecialTiles [6]TileDef + + Color color.NRGBA + Palette Texture + + Waving WaveType + ConnectSides uint8 + ConnectTo []Content + InsideTint color.NRGBA + Level uint8 // Must be < 128. + + Translucent bool // Sunlight is scattered and becomes normal light. + Transparent bool // Sunlight isn't scattered. + LightSrc uint8 + + GndContent bool + Collides bool + Pointable bool + Diggable bool + Climbable bool + Replaceable bool + OnRightClick bool + + DmgPerSec int32 + + LiquidType LiquidType + FlowingAlt string + SrcAlt string + Viscosity uint8 // 0-7 + LiqRenewable bool + FlowRange uint8 + DrownDmg uint8 + Floodable bool + + DrawBox, ColBox, SelBox NodeBox + + FootstepSnd, DiggingSnd, DugSnd SoundDef + + LegacyFaceDir bool + LegacyMounted bool + + DigPredict string + + MaxLvl uint8 + + AlphaUse + }))(obj)).AlphaUse).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AlphaUse", err)) + } + if r.N > 0 { + chk(fmt.Errorf("%d bytes of trailing data", r.N)) + } + } +} + +func (obj *PointedNode) serialize(w io.Writer) { + for local276 := range (*(*(struct { + Under, Above [3]int16 + }))(obj)).Under { + { + x := ((*(*(struct { + Under, Above [3]int16 + }))(obj)).Under)[local276] + write16(w, uint16(x)) + } + } + for local277 := range (*(*(struct { + Under, Above [3]int16 + }))(obj)).Above { + { + x := ((*(*(struct { + Under, Above [3]int16 + }))(obj)).Above)[local277] + write16(w, uint16(x)) + } + } +} + +func (obj *PointedNode) deserialize(r io.Reader) { + for local278 := range (*(*(struct { + Under, Above [3]int16 + }))(obj)).Under { + { + p := &((*(*(struct { + Under, Above [3]int16 + }))(obj)).Under)[local278] + *p = int16(read16(r)) + } + } + for local279 := range (*(*(struct { + Under, Above [3]int16 + }))(obj)).Above { + { + p := &((*(*(struct { + Under, Above [3]int16 + }))(obj)).Above)[local279] + *p = int16(read16(r)) + } + } +} + +func (obj *PointedAO) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + ID AOID + }))(obj)).ID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } +} + +func (obj *PointedAO) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + ID AOID + }))(obj)).ID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } +} + +func (obj *CompressionModes) serialize(w io.Writer) { + { + x := *(*(uint16))(obj) + write16(w, uint16(x)) + } +} + +func (obj *CompressionModes) deserialize(r io.Reader) { + { + p := &*(*(uint16))(obj) + *p = read16(r) + } +} + +func (obj *PlayerPos) serialize(w io.Writer) { + for local280 := range (*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Pos100 { + { + x := ((*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Pos100)[local280] + write32(w, uint32(x)) + } + } + for local281 := range (*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Vel100 { + { + x := ((*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Vel100)[local281] + write32(w, uint32(x)) + } + } + { + x := (*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Pitch100 + write32(w, uint32(x)) + } + { + x := (*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Yaw100 + write32(w, uint32(x)) + } + if err := pcall(func() { + ((*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Keys).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Keys", err)) + } + { + x := (*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).FOV80 + write8(w, uint8(x)) + } + { + x := (*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).WantedRange + write8(w, uint8(x)) + } +} + +func (obj *PlayerPos) deserialize(r io.Reader) { + for local282 := range (*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Pos100 { + { + p := &((*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Pos100)[local282] + *p = int32(read32(r)) + } + } + for local283 := range (*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Vel100 { + { + p := &((*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Vel100)[local283] + *p = int32(read32(r)) + } + } + { + p := &(*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Pitch100 + *p = int32(read32(r)) + } + { + p := &(*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Yaw100 + *p = int32(read32(r)) + } + if err := pcall(func() { + ((*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).Keys).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Keys", err)) + } + { + p := &(*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).FOV80 + *p = read8(r) + } + { + p := &(*(*(struct { + Pos100, Vel100 [3]int32 + Pitch100, Yaw100 int32 + Keys Keys + FOV80 uint8 + WantedRange uint8 // in MapBlks. + }))(obj)).WantedRange + *p = read8(r) + } +} + +func (obj *Interaction) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *Interaction) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *SoundID) serialize(w io.Writer) { + { + x := *(*(int32))(obj) + write32(w, uint32(x)) + } +} + +func (obj *SoundID) deserialize(r io.Reader) { + { + p := &*(*(int32))(obj) + *p = int32(read32(r)) + } +} + +func (obj *Field) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + Name string + + //mt:len32 + Value string + }))(obj)).Name))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Name string + + //mt:len32 + Value string + }))(obj)).Name)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Name string + + //mt:len32 + Value string + }))(obj)).Name))[:]) + chk(err) + } + if len(([]byte((*(*(struct { + Name string + + //mt:len32 + Value string + }))(obj)).Value))) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len(([]byte((*(*(struct { + Name string + + //mt:len32 + Value string + }))(obj)).Value)))) + write32(w, uint32(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Name string + + //mt:len32 + Value string + }))(obj)).Value))[:]) + chk(err) + } +} + +func (obj *Field) deserialize(r io.Reader) { + var local284 []uint8 + var local285 uint16 + { + p := &local285 + *p = read16(r) + } + (local284) = make([]uint8, local285) + { + _, err := io.ReadFull(r, (local284)[:]) + chk(err) + } + ((*(*(struct { + Name string + + //mt:len32 + Value string + }))(obj)).Name) = string(local284) + var local286 []uint8 + var local287 uint32 + { + p := &local287 + *p = read32(r) + } + (local286) = make([]uint8, local287) + { + _, err := io.ReadFull(r, (local286)[:]) + chk(err) + } + ((*(*(struct { + Name string + + //mt:len32 + Value string + }))(obj)).Value) = string(local286) +} + +func (obj *AuthMethods) serialize(w io.Writer) { + { + x := *(*(uint32))(obj) + write32(w, uint32(x)) + } +} + +func (obj *AuthMethods) deserialize(r io.Reader) { + { + p := &*(*(uint32))(obj) + *p = read32(r) + } +} + +func (obj *Pos) serialize(w io.Writer) { + if err := pcall(func() { + (*(*(Vec))(obj)).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } +} + +func (obj *Pos) deserialize(r io.Reader) { + if err := pcall(func() { + (*(*(Vec))(obj)).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } +} + +func (obj *DiscoReason) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *DiscoReason) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *MapBlk) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).Flags).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.MapBlkFlags", err)) + } + if err := pcall(func() { + ((*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).LitFrom).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.LitFromBlks", err)) + } + { + local288 := uint8(2) // Size of param0 in bytes. + { + x := local288 + write8(w, uint8(x)) + } + } + { + local289 := uint8(1 + 1) // Size of param1 and param2 combined, in bytes. + { + x := local289 + write8(w, uint8(x)) + } + } + { + w := zlib.NewWriter(w) + for local290 := range (*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).Param0 { + if err := pcall(func() { + (((*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).Param0)[local290]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Content", err)) + } + } + { + _, err := w.Write(((*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).Param1)[:]) + chk(err) + } + { + _, err := w.Write(((*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).Param2)[:]) + chk(err) + } + chk(w.Close()) + } + { + x := (*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).NodeMetas + { + w := zlib.NewWriter(w) + if x == nil { + write8(w, 0) + } else { + write8(w, 2) + if len(x) > math.MaxUint16 { + chk(ErrTooLong) + } + write16(w, uint16(len(x))) + keys := make([]uint16, 0, len(x)) + for key := range x { + keys = append(keys, key) + } + sort.Slice(keys, func(i, j int) bool { + i2pos := func(i int) [3]int16 { + return Blkpos2Pos([3]int16{}, keys[i]) + } + p, q := i2pos(i), i2pos(j) + for i := range p { + switch { + case p[i] < q[i]: + return true + case p[i] > q[i]: + return false + } + } + return false + }) + for _, key := range keys { + write16(w, key) + chk(serialize(w, x[key])) + } + } + chk(w.Close()) + } + } + { + local291 := uint8(2) // version + { + x := local291 + write8(w, uint8(x)) + } + } +} + +func (obj *MapBlk) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).Flags).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.MapBlkFlags", err)) + } + if err := pcall(func() { + ((*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).LitFrom).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.LitFromBlks", err)) + } + { + var local292 uint8 + { + p := &local292 + *p = read8(r) + } + if local292 != (2) { + chk(fmt.Errorf("const %v: %v", 2, local292)) + } + } + { + var local293 uint8 + { + p := &local293 + *p = read8(r) + } + if local293 != (2) { + chk(fmt.Errorf("const %v: %v", 2, local293)) + } + } + { + r, err := zlib.NewReader(byteReader{r}) + chk(err) + for local294 := range (*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).Param0 { + if err := pcall(func() { + (((*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).Param0)[local294]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Content", err)) + } + } + { + _, err := io.ReadFull(r, ((*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).Param1)[:]) + chk(err) + } + { + _, err := io.ReadFull(r, ((*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).Param2)[:]) + chk(err) + } + chk(r.Close()) + } + { + p := &(*(*(struct { + Flags MapBlkFlags + LitFrom LitFromBlks + + //mt:zlib + Param0 [4096]Content + Param1 [4096]uint8 + Param2 [4096]uint8 + + NodeMetas map[uint16]*NodeMeta + }))(obj)).NodeMetas + { + r, err := zlib.NewReader(byteReader{r}) + chk(err) + switch ver := read8(r); ver { + case 0: + *p = nil + case 2: + n := read16(r) + *p = make(map[uint16]*NodeMeta, n) + for ; n > 0; n-- { + pos := read16(r) + nm := new(NodeMeta) + chk(deserialize(r, nm)) + (*p)[pos] = nm + } + default: + chk(fmt.Errorf("unsupported nodemetas version: %d", ver)) + } + chk(r.Close()) + } + } + { + var local295 uint8 + { + p := &local295 + *p = read8(r) + } + if local295 != (2) { + chk(fmt.Errorf("const %v: %v", 2, local295)) + } + } +} + +func (obj *Node) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Param0 Content + Param1, Param2 uint8 + }))(obj)).Param0).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Content", err)) + } + { + x := (*(*(struct { + Param0 Content + Param1, Param2 uint8 + }))(obj)).Param1 + write8(w, uint8(x)) + } + { + x := (*(*(struct { + Param0 Content + Param1, Param2 uint8 + }))(obj)).Param2 + write8(w, uint8(x)) + } +} + +func (obj *Node) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Param0 Content + Param1, Param2 uint8 + }))(obj)).Param0).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Content", err)) + } + { + p := &(*(*(struct { + Param0 Content + Param1, Param2 uint8 + }))(obj)).Param1 + *p = read8(r) + } + { + p := &(*(*(struct { + Param0 Content + Param1, Param2 uint8 + }))(obj)).Param2 + *p = read8(r) + } +} + +func (obj *CSMRestrictionFlags) serialize(w io.Writer) { + { + x := *(*(uint64))(obj) + write64(w, uint64(x)) + } +} + +func (obj *CSMRestrictionFlags) deserialize(r io.Reader) { + { + p := &*(*(uint64))(obj) + *p = read64(r) + } +} + +func (obj *Vec) serialize(w io.Writer) { + for local296 := range *(*([3]float32))(obj) { + { + x := (*(*([3]float32))(obj))[local296] + write32(w, math.Float32bits(x)) + } + } +} + +func (obj *Vec) deserialize(r io.Reader) { + for local297 := range *(*([3]float32))(obj) { + { + p := &(*(*([3]float32))(obj))[local297] + *p = math.Float32frombits(read32(r)) + } + } +} + +func (obj *ChatMsgType) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *ChatMsgType) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *AOID) serialize(w io.Writer) { + { + x := *(*(uint16))(obj) + write16(w, uint16(x)) + } +} + +func (obj *AOID) deserialize(r io.Reader) { + { + p := &*(*(uint16))(obj) + *p = read16(r) + } +} + +func (obj *aoType) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *aoType) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *AOInitData) serialize(w io.Writer) { + { + local298 := uint8(1) + { + x := local298 + write8(w, uint8(x)) + } + } + if len(([]byte((*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).Name))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).Name)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).Name))[:]) + chk(err) + } + { + x := (*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).IsPlayer + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if err := pcall(func() { + ((*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).ID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + if err := pcall(func() { + ((*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).Pos).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + for local299 := range (*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).Rot { + { + x := ((*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).Rot)[local299] + write32(w, math.Float32bits(x)) + } + } + { + x := (*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).HP + write16(w, uint16(x)) + } + { + x := (*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).Msgs + { // For AOInitData.Msgs + if len(x) > math.MaxUint8 { + chk(ErrTooLong) + } + write8(w, uint8(len(x))) + for _, msg := range x { + var b bytes.Buffer + chk(writeAOMsg(&b, msg)) + if b.Len() > math.MaxUint32 { + chk(ErrTooLong) + } + write32(w, uint32(b.Len())) + _, err := b.WriteTo(w) + chk(err) + } + } + } +} + +func (obj *AOInitData) deserialize(r io.Reader) { + { + var local300 uint8 + { + p := &local300 + *p = read8(r) + } + if local300 != (1) { + chk(fmt.Errorf("const %v: %v", 1, local300)) + } + } + var local301 []uint8 + var local302 uint16 + { + p := &local302 + *p = read16(r) + } + (local301) = make([]uint8, local302) + { + _, err := io.ReadFull(r, (local301)[:]) + chk(err) + } + ((*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).Name) = string(local301) + { + p := &(*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).IsPlayer + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + if err := pcall(func() { + ((*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).ID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + if err := pcall(func() { + ((*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).Pos).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + for local303 := range (*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).Rot { + { + p := &((*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).Rot)[local303] + *p = math.Float32frombits(read32(r)) + } + } + { + p := &(*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).HP + *p = read16(r) + } + { + p := &(*(*(struct { + + // For players. + Name string + IsPlayer bool + + ID AOID + + Pos + Rot [3]float32 + + HP uint16 + + // See (de)serialize.fmt. + Msgs []AOMsg + }))(obj)).Msgs + { // For AOInitData.Msgs. + *p = make([]AOMsg, read8(r)) + for i := range *p { + r := &io.LimitedReader{r, int64(read32(r))} + msg, err := readAOMsg(r) + chk(err) + (*p)[i] = msg + if r.N > 0 { + chk(fmt.Errorf("%d bytes of trailing data", r.N)) + } + } + } + } +} + +func (obj *IDAOMsg) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + ID AOID + //mt:lenhdr 16 + Msg AOMsg + }))(obj)).ID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + { + ow := w + w := new(bytes.Buffer) + { + x := (*(*(struct { + ID AOID + //mt:lenhdr 16 + Msg AOMsg + }))(obj)).Msg + writeAOMsg(w, x) + } + { + buf := w + w := ow + if len((buf.Bytes())) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len((buf.Bytes()))) + write16(w, uint16(x)) + } + { + _, err := w.Write((buf.Bytes())[:]) + chk(err) + } + } + } +} + +func (obj *IDAOMsg) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + ID AOID + //mt:lenhdr 16 + Msg AOMsg + }))(obj)).ID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + { + var n uint16 + { + p := &n + *p = read16(r) + } + r := &io.LimitedReader{r, int64(n)} + { + p := &(*(*(struct { + ID AOID + //mt:lenhdr 16 + Msg AOMsg + }))(obj)).Msg + { + var err error + *p, err = readAOMsg(r) + chk(err) + } + } + if r.N > 0 { + chk(fmt.Errorf("%d bytes of trailing data", r.N)) + } + } +} + +func (obj *ItemDef) serialize(w io.Writer) { + { + ow := w + w := new(bytes.Buffer) + { + local304 := uint8(6) + { + x := local304 + write8(w, uint8(x)) + } + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Type).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ItemType", err)) + } + if len(([]byte((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Name))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Name)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Name))[:]) + chk(err) + } + if len(([]byte((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Desc))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Desc)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Desc))[:]) + chk(err) + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).InvImg).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).WieldImg).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + for local305 := range (*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).WieldScale { + { + x := ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).WieldScale)[local305] + write32(w, math.Float32bits(x)) + } + } + { + x := (*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).StackMax + write16(w, uint16(x)) + } + { + x := (*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Usable + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).CanPointLiquids + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).ToolCaps).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ToolCaps", err)) + } + if len(((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Groups)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Groups))) + write16(w, uint16(x)) + } + for local306 := range (*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Groups { + if err := pcall(func() { + (((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Groups)[local306]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Group", err)) + } + } + if len(([]byte((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).PlacePredict))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).PlacePredict)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).PlacePredict))[:]) + chk(err) + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).PlaceSnd).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundDef", err)) + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).PlaceFailSnd).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundDef", err)) + } + { + x := (*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).PointRange + write32(w, math.Float32bits(x)) + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Palette).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + { + x := (*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Color + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).InvOverlay).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).WieldOverlay).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if len(([]byte((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).ShortDesc))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).ShortDesc)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).ShortDesc))[:]) + chk(err) + } + { + x := (*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).PlaceParam2 + write8(w, uint8(x)) + } + { + buf := w + w := ow + if len((buf.Bytes())) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len((buf.Bytes()))) + write16(w, uint16(x)) + } + { + _, err := w.Write((buf.Bytes())[:]) + chk(err) + } + } + } +} + +func (obj *ItemDef) deserialize(r io.Reader) { + { + var n uint16 + { + p := &n + *p = read16(r) + } + r := &io.LimitedReader{r, int64(n)} + { + var local307 uint8 + { + p := &local307 + *p = read8(r) + } + if local307 != (6) { + chk(fmt.Errorf("const %v: %v", 6, local307)) + } + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Type).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ItemType", err)) + } + var local308 []uint8 + var local309 uint16 + { + p := &local309 + *p = read16(r) + } + (local308) = make([]uint8, local309) + { + _, err := io.ReadFull(r, (local308)[:]) + chk(err) + } + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Name) = string(local308) + var local310 []uint8 + var local311 uint16 + { + p := &local311 + *p = read16(r) + } + (local310) = make([]uint8, local311) + { + _, err := io.ReadFull(r, (local310)[:]) + chk(err) + } + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Desc) = string(local310) + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).InvImg).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).WieldImg).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + for local312 := range (*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).WieldScale { + { + p := &((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).WieldScale)[local312] + *p = math.Float32frombits(read32(r)) + } + } + { + p := &(*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).StackMax + *p = read16(r) + } + { + p := &(*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Usable + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).CanPointLiquids + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).ToolCaps).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ToolCaps", err)) + } + var local313 uint16 + { + p := &local313 + *p = read16(r) + } + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Groups) = make([]Group, local313) + for local314 := range (*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Groups { + if err := pcall(func() { + (((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Groups)[local314]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Group", err)) + } + } + var local315 []uint8 + var local316 uint16 + { + p := &local316 + *p = read16(r) + } + (local315) = make([]uint8, local316) + { + _, err := io.ReadFull(r, (local315)[:]) + chk(err) + } + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).PlacePredict) = string(local315) + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).PlaceSnd).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundDef", err)) + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).PlaceFailSnd).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.SoundDef", err)) + } + { + p := &(*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).PointRange + *p = math.Float32frombits(read32(r)) + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Palette).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + { + p := &(*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).Color + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).InvOverlay).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).WieldOverlay).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + var local317 []uint8 + var local318 uint16 + { + p := &local318 + *p = read16(r) + } + (local317) = make([]uint8, local318) + { + _, err := io.ReadFull(r, (local317)[:]) + chk(err) + } + ((*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).ShortDesc) = string(local317) + { + p := &(*(*(struct { + Type ItemType + + Name, Desc string + + InvImg, WieldImg Texture + WieldScale [3]float32 + + StackMax uint16 + + Usable bool + CanPointLiquids bool + + ToolCaps ToolCaps + + Groups []Group + + PlacePredict string + + PlaceSnd, PlaceFailSnd SoundDef + + PointRange float32 + + // Set index in Palette with "palette_index" item meta field, + // this overrides Color. + Palette Texture + Color color.NRGBA + + // Texture overlays. + InvOverlay, WieldOverlay Texture + + ShortDesc string + + PlaceParam2 byte + }))(obj)).PlaceParam2 + *p = read8(r) + } + if r.N > 0 { + chk(fmt.Errorf("%d bytes of trailing data", r.N)) + } + } +} + +func (obj *SoundSrcType) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *SoundSrcType) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *TileAnim) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).Type).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AnimType", err)) + } + if !((*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).Type < maxAnim) { + chk(errors.New("assertion failed: %s.Type < maxAnim")) + } + if (*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).Type == SpritesheetAnim { + { + _, err := w.Write(((*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).AspectRatio)[:]) + chk(err) + } + } + if (*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).Type == VerticalFrameAnim { + for local319 := range (*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).NFrames { + { + x := ((*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).NFrames)[local319] + write16(w, uint16(x)) + } + } + } + if (*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).Type != NoAnim { + { + x := (*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).Duration + write32(w, math.Float32bits(x)) + } + } +} + +func (obj *TileAnim) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).Type).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AnimType", err)) + } + if !((*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).Type < maxAnim) { + chk(errors.New("assertion failed: %s.Type < maxAnim")) + } + if (*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).Type == SpritesheetAnim { + { + _, err := io.ReadFull(r, ((*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).AspectRatio)[:]) + chk(err) + } + } + if (*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).Type == VerticalFrameAnim { + for local320 := range (*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).NFrames { + { + p := &((*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).NFrames)[local320] + *p = read16(r) + } + } + } + if (*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).Type != NoAnim { + { + p := &(*(*(struct { + Type AnimType + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + + }))(obj)).Duration + *p = math.Float32frombits(read32(r)) + } + } +} + +func (obj *Content) serialize(w io.Writer) { + { + x := *(*(uint16))(obj) + write16(w, uint16(x)) + } +} + +func (obj *Content) deserialize(r io.Reader) { + { + p := &*(*(uint16))(obj) + *p = read16(r) + } +} + +func (obj *ParticleSpawnerID) serialize(w io.Writer) { + { + x := *(*(uint32))(obj) + write32(w, uint32(x)) + } +} + +func (obj *ParticleSpawnerID) deserialize(r io.Reader) { + { + p := &*(*(uint32))(obj) + *p = read32(r) + } +} + +func (obj *HUDID) serialize(w io.Writer) { + { + x := *(*(uint32))(obj) + write32(w, uint32(x)) + } +} + +func (obj *HUDID) deserialize(r io.Reader) { + { + p := &*(*(uint32))(obj) + *p = read32(r) + } +} + +func (obj *HUDType) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *HUDType) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *HUDField) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *HUDField) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *HUDFlags) serialize(w io.Writer) { + { + x := *(*(uint32))(obj) + write32(w, uint32(x)) + } +} + +func (obj *HUDFlags) deserialize(r io.Reader) { + { + p := &*(*(uint32))(obj) + *p = read32(r) + } +} + +func (obj *HotbarParam) serialize(w io.Writer) { + { + x := *(*(uint16))(obj) + write16(w, uint16(x)) + } +} + +func (obj *HotbarParam) deserialize(r io.Reader) { + { + p := &*(*(uint16))(obj) + *p = read16(r) + } +} + +func (obj *Texture) serialize(w io.Writer) { + if len(([]byte(*(*(string))(obj)))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte(*(*(string))(obj))))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte(*(*(string))(obj)))[:]) + chk(err) + } +} + +func (obj *Texture) deserialize(r io.Reader) { + var local321 []uint8 + var local322 uint16 + { + p := &local322 + *p = read16(r) + } + (local321) = make([]uint8, local322) + { + _, err := io.ReadFull(r, (local321)[:]) + chk(err) + } + (*(*(string))(obj)) = string(local321) +} + +func (obj *PlayerListUpdateType) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *PlayerListUpdateType) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *ModChanSig) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *ModChanSig) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *AOProps) serialize(w io.Writer) { + { + local323 := uint8(4) + { + x := local323 + write8(w, uint8(x)) + } + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).MaxHP + write16(w, uint16(x)) + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).CollideWithNodes + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Weight + write32(w, math.Float32bits(x)) + } + if err := pcall(func() { + ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).ColBox).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + if err := pcall(func() { + ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).SelBox).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Pointable + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if len(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Visual))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Visual)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Visual))[:]) + chk(err) + } + for local324 := range (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).VisualSize { + { + x := ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).VisualSize)[local324] + write32(w, math.Float32bits(x)) + } + } + if len(((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Textures)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Textures))) + write16(w, uint16(x)) + } + for local325 := range (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Textures { + if err := pcall(func() { + (((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Textures)[local325]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + } + for local326 := range (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).SpritesheetSize { + { + x := ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).SpritesheetSize)[local326] + write16(w, uint16(x)) + } + } + for local327 := range (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).SpritePos { + { + x := ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).SpritePos)[local327] + write16(w, uint16(x)) + } + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Visible + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).MakeFootstepSnds + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).RotateSpeed + write32(w, math.Float32bits(x)) + } + if len(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Mesh))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Mesh)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Mesh))[:]) + chk(err) + } + if len(((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Colors)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Colors))) + write16(w, uint16(x)) + } + for local328 := range (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Colors { + { + x := ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Colors)[local328] + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).CollideWithAOs + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).StepHeight + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).FaceRotateDir + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).FaceRotateDirOff + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).BackfaceCull + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if len(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Nametag))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Nametag)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Nametag))[:]) + chk(err) + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).NametagColor + w.Write([]byte{x.A, x.R, x.G, x.B}) + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).FaceRotateSpeed + write32(w, math.Float32bits(x)) + } + if len(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Infotext))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Infotext)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Infotext))[:]) + chk(err) + } + if len(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Itemstring))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Itemstring)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Itemstring))[:]) + chk(err) + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Glow + write8(w, uint8(x)) + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).MaxBreath + write16(w, uint16(x)) + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).EyeHeight + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).ZoomFOV + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).UseTextureAlpha + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + if err := pcall(func() { + ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).DmgTextureMod).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Shaded + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).ShowOnMinimap + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).NametagBG + w.Write([]byte{x.A, x.R, x.G, x.B}) + } +} + +func (obj *AOProps) deserialize(r io.Reader) { + { + var local329 uint8 + { + p := &local329 + *p = read8(r) + } + if local329 != (4) { + chk(fmt.Errorf("const %v: %v", 4, local329)) + } + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).MaxHP + *p = read16(r) + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).CollideWithNodes + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Weight + *p = math.Float32frombits(read32(r)) + } + if err := pcall(func() { + ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).ColBox).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + if err := pcall(func() { + ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).SelBox).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Pointable + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + var local330 []uint8 + var local331 uint16 + { + p := &local331 + *p = read16(r) + } + (local330) = make([]uint8, local331) + { + _, err := io.ReadFull(r, (local330)[:]) + chk(err) + } + ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Visual) = string(local330) + for local332 := range (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).VisualSize { + { + p := &((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).VisualSize)[local332] + *p = math.Float32frombits(read32(r)) + } + } + var local333 uint16 + { + p := &local333 + *p = read16(r) + } + ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Textures) = make([]Texture, local333) + for local334 := range (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Textures { + if err := pcall(func() { + (((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Textures)[local334]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + } + for local335 := range (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).SpritesheetSize { + { + p := &((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).SpritesheetSize)[local335] + *p = int16(read16(r)) + } + } + for local336 := range (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).SpritePos { + { + p := &((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).SpritePos)[local336] + *p = int16(read16(r)) + } + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Visible + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).MakeFootstepSnds + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).RotateSpeed + *p = math.Float32frombits(read32(r)) + } + var local337 []uint8 + var local338 uint16 + { + p := &local338 + *p = read16(r) + } + (local337) = make([]uint8, local338) + { + _, err := io.ReadFull(r, (local337)[:]) + chk(err) + } + ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Mesh) = string(local337) + var local339 uint16 + { + p := &local339 + *p = read16(r) + } + ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Colors) = make([]color.NRGBA, local339) + for local340 := range (*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Colors { + { + p := &((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Colors)[local340] + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).CollideWithAOs + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).StepHeight + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).FaceRotateDir + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).FaceRotateDirOff + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).BackfaceCull + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + var local341 []uint8 + var local342 uint16 + { + p := &local342 + *p = read16(r) + } + (local341) = make([]uint8, local342) + { + _, err := io.ReadFull(r, (local341)[:]) + chk(err) + } + ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Nametag) = string(local341) + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).NametagColor + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).FaceRotateSpeed + *p = math.Float32frombits(read32(r)) + } + var local343 []uint8 + var local344 uint16 + { + p := &local344 + *p = read16(r) + } + (local343) = make([]uint8, local344) + { + _, err := io.ReadFull(r, (local343)[:]) + chk(err) + } + ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Infotext) = string(local343) + var local345 []uint8 + var local346 uint16 + { + p := &local346 + *p = read16(r) + } + (local345) = make([]uint8, local346) + { + _, err := io.ReadFull(r, (local345)[:]) + chk(err) + } + ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Itemstring) = string(local345) + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Glow + *p = int8(read8(r)) + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).MaxBreath + *p = read16(r) + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).EyeHeight + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).ZoomFOV + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).UseTextureAlpha + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + if err := pcall(func() { + ((*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).DmgTextureMod).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).Shaded + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).ShowOnMinimap + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + MaxHP uint16 // Player only. + CollideWithNodes bool + Weight float32 // deprecated + ColBox, SelBox Box + Pointable bool + Visual string + VisualSize [3]float32 + Textures []Texture + SpritesheetSize [2]int16 // in sprites. + SpritePos [2]int16 // in sprite sheet. + Visible bool + MakeFootstepSnds bool + RotateSpeed float32 // in radians per second. + Mesh string + Colors []color.NRGBA + CollideWithAOs bool + StepHeight float32 + FaceRotateDir bool + FaceRotateDirOff float32 // in degrees. + BackfaceCull bool + Nametag string + NametagColor color.NRGBA + FaceRotateSpeed float32 // in degrees per second. + Infotext string + Itemstring string + Glow int8 + MaxBreath uint16 // Player only. + EyeHeight float32 // Player only. + ZoomFOV float32 // in degrees. Player only. + UseTextureAlpha bool + DmgTextureMod Texture // suffix + Shaded bool + ShowOnMinimap bool + NametagBG color.NRGBA + }))(obj)).NametagBG + *p = color.NRGBA{A: read8(r), R: read8(r), G: read8(r), B: read8(r)} + } +} + +func (obj *AOPos) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).Pos).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + if err := pcall(func() { + ((*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).Vel).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } + if err := pcall(func() { + ((*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).Acc).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } + for local347 := range (*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).Rot { + { + x := ((*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).Rot)[local347] + write32(w, math.Float32bits(x)) + } + } + { + x := (*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).Interpolate + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).End + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).UpdateInterval + write32(w, math.Float32bits(x)) + } +} + +func (obj *AOPos) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).Pos).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Pos", err)) + } + if err := pcall(func() { + ((*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).Vel).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } + if err := pcall(func() { + ((*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).Acc).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } + for local348 := range (*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).Rot { + { + p := &((*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).Rot)[local348] + *p = math.Float32frombits(read32(r)) + } + } + { + p := &(*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).Interpolate + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).End + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Pos + Vel, Acc Vec + Rot [3]float32 + + Interpolate bool + End bool + UpdateInterval float32 + }))(obj)).UpdateInterval + *p = math.Float32frombits(read32(r)) + } +} + +func (obj *AOSprite) serialize(w io.Writer) { + for local349 := range (*(*(struct { + Frame0 [2]int16 + Frames uint16 + FrameDuration float32 + ViewAngleFrames bool + }))(obj)).Frame0 { + { + x := ((*(*(struct { + Frame0 [2]int16 + Frames uint16 + FrameDuration float32 + ViewAngleFrames bool + }))(obj)).Frame0)[local349] + write16(w, uint16(x)) + } + } + { + x := (*(*(struct { + Frame0 [2]int16 + Frames uint16 + FrameDuration float32 + ViewAngleFrames bool + }))(obj)).Frames + write16(w, uint16(x)) + } + { + x := (*(*(struct { + Frame0 [2]int16 + Frames uint16 + FrameDuration float32 + ViewAngleFrames bool + }))(obj)).FrameDuration + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + Frame0 [2]int16 + Frames uint16 + FrameDuration float32 + ViewAngleFrames bool + }))(obj)).ViewAngleFrames + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } +} + +func (obj *AOSprite) deserialize(r io.Reader) { + for local350 := range (*(*(struct { + Frame0 [2]int16 + Frames uint16 + FrameDuration float32 + ViewAngleFrames bool + }))(obj)).Frame0 { + { + p := &((*(*(struct { + Frame0 [2]int16 + Frames uint16 + FrameDuration float32 + ViewAngleFrames bool + }))(obj)).Frame0)[local350] + *p = int16(read16(r)) + } + } + { + p := &(*(*(struct { + Frame0 [2]int16 + Frames uint16 + FrameDuration float32 + ViewAngleFrames bool + }))(obj)).Frames + *p = read16(r) + } + { + p := &(*(*(struct { + Frame0 [2]int16 + Frames uint16 + FrameDuration float32 + ViewAngleFrames bool + }))(obj)).FrameDuration + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + Frame0 [2]int16 + Frames uint16 + FrameDuration float32 + ViewAngleFrames bool + }))(obj)).ViewAngleFrames + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } +} + +func (obj *Group) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + Name string + Rating int16 + }))(obj)).Name))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Name string + Rating int16 + }))(obj)).Name)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Name string + Rating int16 + }))(obj)).Name))[:]) + chk(err) + } + { + x := (*(*(struct { + Name string + Rating int16 + }))(obj)).Rating + write16(w, uint16(x)) + } +} + +func (obj *Group) deserialize(r io.Reader) { + var local351 []uint8 + var local352 uint16 + { + p := &local352 + *p = read16(r) + } + (local351) = make([]uint8, local352) + { + _, err := io.ReadFull(r, (local351)[:]) + chk(err) + } + ((*(*(struct { + Name string + Rating int16 + }))(obj)).Name) = string(local351) + { + p := &(*(*(struct { + Name string + Rating int16 + }))(obj)).Rating + *p = int16(read16(r)) + } +} + +func (obj *AOAnim) serialize(w io.Writer) { + for local353 := range (*(*(struct { + Frames [2]int32 + Speed float32 + Blend float32 + NoLoop bool + }))(obj)).Frames { + { + x := ((*(*(struct { + Frames [2]int32 + Speed float32 + Blend float32 + NoLoop bool + }))(obj)).Frames)[local353] + write32(w, uint32(x)) + } + } + { + x := (*(*(struct { + Frames [2]int32 + Speed float32 + Blend float32 + NoLoop bool + }))(obj)).Speed + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + Frames [2]int32 + Speed float32 + Blend float32 + NoLoop bool + }))(obj)).Blend + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + Frames [2]int32 + Speed float32 + Blend float32 + NoLoop bool + }))(obj)).NoLoop + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } +} + +func (obj *AOAnim) deserialize(r io.Reader) { + for local354 := range (*(*(struct { + Frames [2]int32 + Speed float32 + Blend float32 + NoLoop bool + }))(obj)).Frames { + { + p := &((*(*(struct { + Frames [2]int32 + Speed float32 + Blend float32 + NoLoop bool + }))(obj)).Frames)[local354] + *p = int32(read32(r)) + } + } + { + p := &(*(*(struct { + Frames [2]int32 + Speed float32 + Blend float32 + NoLoop bool + }))(obj)).Speed + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + Frames [2]int32 + Speed float32 + Blend float32 + NoLoop bool + }))(obj)).Blend + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + Frames [2]int32 + Speed float32 + Blend float32 + NoLoop bool + }))(obj)).NoLoop + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } +} + +func (obj *AOBonePos) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Pos Vec + Rot [3]float32 + }))(obj)).Pos).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } + for local355 := range (*(*(struct { + Pos Vec + Rot [3]float32 + }))(obj)).Rot { + { + x := ((*(*(struct { + Pos Vec + Rot [3]float32 + }))(obj)).Rot)[local355] + write32(w, math.Float32bits(x)) + } + } +} + +func (obj *AOBonePos) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Pos Vec + Rot [3]float32 + }))(obj)).Pos).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } + for local356 := range (*(*(struct { + Pos Vec + Rot [3]float32 + }))(obj)).Rot { + { + p := &((*(*(struct { + Pos Vec + Rot [3]float32 + }))(obj)).Rot)[local356] + *p = math.Float32frombits(read32(r)) + } + } +} + +func (obj *AOAttach) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).ParentID).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + if len(([]byte((*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).Bone))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).Bone)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).Bone))[:]) + chk(err) + } + if err := pcall(func() { + ((*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).Pos).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } + for local357 := range (*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).Rot { + { + x := ((*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).Rot)[local357] + write32(w, math.Float32bits(x)) + } + } + { + x := (*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).ForceVisible + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } +} + +func (obj *AOAttach) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).ParentID).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AOID", err)) + } + var local358 []uint8 + var local359 uint16 + { + p := &local359 + *p = read16(r) + } + (local358) = make([]uint8, local359) + { + _, err := io.ReadFull(r, (local358)[:]) + chk(err) + } + ((*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).Bone) = string(local358) + if err := pcall(func() { + ((*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).Pos).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } + for local360 := range (*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).Rot { + { + p := &((*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).Rot)[local360] + *p = math.Float32frombits(read32(r)) + } + } + { + p := &(*(*(struct { + ParentID AOID + Bone string + Pos Vec + Rot [3]float32 + ForceVisible bool + }))(obj)).ForceVisible + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } +} + +func (obj *AOPhysOverride) serialize(w io.Writer) { + { + x := (*(*(struct { + Walk, Jump, Gravity float32 + + // Player only. + NoSneak, NoSneakGlitch, OldSneak bool + }))(obj)).Walk + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + Walk, Jump, Gravity float32 + + // Player only. + NoSneak, NoSneakGlitch, OldSneak bool + }))(obj)).Jump + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + Walk, Jump, Gravity float32 + + // Player only. + NoSneak, NoSneakGlitch, OldSneak bool + }))(obj)).Gravity + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + Walk, Jump, Gravity float32 + + // Player only. + NoSneak, NoSneakGlitch, OldSneak bool + }))(obj)).NoSneak + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Walk, Jump, Gravity float32 + + // Player only. + NoSneak, NoSneakGlitch, OldSneak bool + }))(obj)).NoSneakGlitch + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + { + x := (*(*(struct { + Walk, Jump, Gravity float32 + + // Player only. + NoSneak, NoSneakGlitch, OldSneak bool + }))(obj)).OldSneak + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } +} + +func (obj *AOPhysOverride) deserialize(r io.Reader) { + { + p := &(*(*(struct { + Walk, Jump, Gravity float32 + + // Player only. + NoSneak, NoSneakGlitch, OldSneak bool + }))(obj)).Walk + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + Walk, Jump, Gravity float32 + + // Player only. + NoSneak, NoSneakGlitch, OldSneak bool + }))(obj)).Jump + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + Walk, Jump, Gravity float32 + + // Player only. + NoSneak, NoSneakGlitch, OldSneak bool + }))(obj)).Gravity + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + Walk, Jump, Gravity float32 + + // Player only. + NoSneak, NoSneakGlitch, OldSneak bool + }))(obj)).NoSneak + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Walk, Jump, Gravity float32 + + // Player only. + NoSneak, NoSneakGlitch, OldSneak bool + }))(obj)).NoSneakGlitch + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + { + p := &(*(*(struct { + Walk, Jump, Gravity float32 + + // Player only. + NoSneak, NoSneakGlitch, OldSneak bool + }))(obj)).OldSneak + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } +} + +func (obj *NodeMetaField) serialize(w io.Writer) { + if err := pcall(func() { + ((*(*(struct { + Field + Private bool + }))(obj)).Field).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Field", err)) + } + { + x := (*(*(struct { + Field + Private bool + }))(obj)).Private + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } +} + +func (obj *NodeMetaField) deserialize(r io.Reader) { + if err := pcall(func() { + ((*(*(struct { + Field + Private bool + }))(obj)).Field).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Field", err)) + } + { + p := &(*(*(struct { + Field + Private bool + }))(obj)).Private + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } +} + +func (obj *MinimapType) serialize(w io.Writer) { + { + x := *(*(uint16))(obj) + write16(w, uint16(x)) + } +} + +func (obj *MinimapType) deserialize(r io.Reader) { + { + p := &*(*(uint16))(obj) + *p = read16(r) + } +} + +func (obj *Param1Type) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *Param1Type) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *Param2Type) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *Param2Type) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *DrawType) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *DrawType) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *TileDef) serialize(w io.Writer) { + { + local361 := uint8(6) + { + x := local361 + write8(w, uint8(x)) + } + } + if err := pcall(func() { + ((*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Texture).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Anim).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileAnim", err)) + } + if err := pcall(func() { + ((*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Flags).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileFlags", err)) + } + if (*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Flags&TileColor != 0 { + { + x := (*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).R + write8(w, uint8(x)) + } + { + x := (*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).G + write8(w, uint8(x)) + } + { + x := (*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).B + write8(w, uint8(x)) + } + } + if (*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Flags&TileScale != 0 { + { + x := (*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Scale + write8(w, uint8(x)) + } + } + if (*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Flags&TileAlign != 0 { + if err := pcall(func() { + ((*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Align).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AlignType", err)) + } + } +} + +func (obj *TileDef) deserialize(r io.Reader) { + { + var local362 uint8 + { + p := &local362 + *p = read8(r) + } + if local362 != (6) { + chk(fmt.Errorf("const %v: %v", 6, local362)) + } + } + if err := pcall(func() { + ((*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Texture).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Texture", err)) + } + if err := pcall(func() { + ((*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Anim).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileAnim", err)) + } + if err := pcall(func() { + ((*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Flags).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.TileFlags", err)) + } + if (*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Flags&TileColor != 0 { + { + p := &(*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).R + *p = read8(r) + } + { + p := &(*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).G + *p = read8(r) + } + { + p := &(*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).B + *p = read8(r) + } + } + if (*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Flags&TileScale != 0 { + { + p := &(*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Scale + *p = read8(r) + } + } + if (*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Flags&TileAlign != 0 { + if err := pcall(func() { + ((*(*(struct { + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + }))(obj)).Align).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.AlignType", err)) + } + } +} + +func (obj *WaveType) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *WaveType) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *LiquidType) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *LiquidType) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *NodeBox) serialize(w io.Writer) { + { + local363 := uint8(6) + { + x := local363 + write8(w, uint8(x)) + } + } + if err := pcall(func() { + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Type).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.NodeBoxType", err)) + } + if !((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Type < maxBox) { + chk(errors.New("assertion failed: %s.Type < maxBox")) + } + if (*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Type == MountedBox { + if err := pcall(func() { + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).WallTop).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + if err := pcall(func() { + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).WallBot).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + if err := pcall(func() { + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).WallSides).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + if t := (*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Type; t == FixedBox || t == LeveledBox || t == ConnectedBox { + if len(((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Fixed)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Fixed))) + write16(w, uint16(x)) + } + for local364 := range (*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Fixed { + if err := pcall(func() { + (((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Fixed)[local364]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + } + if (*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Type == ConnectedBox { + if err := pcall(func() { + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).ConnDirs).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.DirBoxes", err)) + } + if err := pcall(func() { + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoDirs).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.DirBoxes", err)) + } + if len(((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoAll)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoAll))) + write16(w, uint16(x)) + } + for local365 := range (*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoAll { + if err := pcall(func() { + (((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoAll)[local365]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + if len(((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoSides)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoSides))) + write16(w, uint16(x)) + } + for local366 := range (*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoSides { + if err := pcall(func() { + (((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoSides)[local366]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + } +} + +func (obj *NodeBox) deserialize(r io.Reader) { + { + var local367 uint8 + { + p := &local367 + *p = read8(r) + } + if local367 != (6) { + chk(fmt.Errorf("const %v: %v", 6, local367)) + } + } + if err := pcall(func() { + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Type).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.NodeBoxType", err)) + } + if !((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Type < maxBox) { + chk(errors.New("assertion failed: %s.Type < maxBox")) + } + if (*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Type == MountedBox { + if err := pcall(func() { + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).WallTop).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + if err := pcall(func() { + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).WallBot).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + if err := pcall(func() { + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).WallSides).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + if t := (*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Type; t == FixedBox || t == LeveledBox || t == ConnectedBox { + var local368 uint16 + { + p := &local368 + *p = read16(r) + } + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Fixed) = make([]Box, local368) + for local369 := range (*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Fixed { + if err := pcall(func() { + (((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Fixed)[local369]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + } + if (*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).Type == ConnectedBox { + if err := pcall(func() { + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).ConnDirs).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.DirBoxes", err)) + } + if err := pcall(func() { + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoDirs).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.DirBoxes", err)) + } + var local370 uint16 + { + p := &local370 + *p = read16(r) + } + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoAll) = make([]Box, local370) + for local371 := range (*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoAll { + if err := pcall(func() { + (((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoAll)[local371]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + var local372 uint16 + { + p := &local372 + *p = read16(r) + } + ((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoSides) = make([]Box, local372) + for local373 := range (*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoSides { + if err := pcall(func() { + (((*(*(struct { + Type NodeBoxType + + //mt:if %s.Type == MountedBox + WallTop, WallBot, WallSides Box + + //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox + Fixed []Box + + //mt:if %s.Type == ConnectedBox + ConnDirs, DiscoDirs DirBoxes + DiscoAll, DiscoSides []Box + }))(obj)).DiscoSides)[local373]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + } +} + +func (obj *SoundDef) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + Name string + Gain, Pitch, Fade float32 + }))(obj)).Name))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Name string + Gain, Pitch, Fade float32 + }))(obj)).Name)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Name string + Gain, Pitch, Fade float32 + }))(obj)).Name))[:]) + chk(err) + } + { + x := (*(*(struct { + Name string + Gain, Pitch, Fade float32 + }))(obj)).Gain + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + Name string + Gain, Pitch, Fade float32 + }))(obj)).Pitch + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + Name string + Gain, Pitch, Fade float32 + }))(obj)).Fade + write32(w, math.Float32bits(x)) + } +} + +func (obj *SoundDef) deserialize(r io.Reader) { + var local374 []uint8 + var local375 uint16 + { + p := &local375 + *p = read16(r) + } + (local374) = make([]uint8, local375) + { + _, err := io.ReadFull(r, (local374)[:]) + chk(err) + } + ((*(*(struct { + Name string + Gain, Pitch, Fade float32 + }))(obj)).Name) = string(local374) + { + p := &(*(*(struct { + Name string + Gain, Pitch, Fade float32 + }))(obj)).Gain + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + Name string + Gain, Pitch, Fade float32 + }))(obj)).Pitch + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + Name string + Gain, Pitch, Fade float32 + }))(obj)).Fade + *p = math.Float32frombits(read32(r)) + } +} + +func (obj *AlphaUse) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *AlphaUse) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *Keys) serialize(w io.Writer) { + { + x := *(*(uint32))(obj) + write32(w, uint32(x)) + } +} + +func (obj *Keys) deserialize(r io.Reader) { + { + p := &*(*(uint32))(obj) + *p = read32(r) + } +} + +func (obj *MapBlkFlags) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *MapBlkFlags) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *LitFromBlks) serialize(w io.Writer) { + { + x := *(*(uint16))(obj) + write16(w, uint16(x)) + } +} + +func (obj *LitFromBlks) deserialize(r io.Reader) { + { + p := &*(*(uint16))(obj) + *p = read16(r) + } +} + +func (obj *ItemType) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *ItemType) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *ToolCaps) serialize(w io.Writer) { + if _ = (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)); false { + { + x := (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).NonNil + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + } + { + ow := w + w := new(bytes.Buffer) + /* + if r.N > 0 { (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).NonNil = true}; /**/{ + if (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).NonNil { + { + local376 := uint8(5) + { + x := local376 + write8(w, uint8(x)) + } + } + { + x := (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).AttackCooldown + write32(w, math.Float32bits(x)) + } + { + x := (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).MaxDropLvl + write16(w, uint16(x)) + } + if len(((*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).GroupCaps)) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len(((*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).GroupCaps))) + write32(w, uint32(x)) + } + for local377 := range (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).GroupCaps { + if err := pcall(func() { + (((*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).GroupCaps)[local377]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ToolGroupCaps", err)) + } + } + if len(((*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).DmgGroups)) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len(((*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).DmgGroups))) + write32(w, uint32(x)) + } + for local378 := range (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).DmgGroups { + if err := pcall(func() { + (((*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).DmgGroups)[local378]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Group", err)) + } + } + { + x := (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).AttackUses + write16(w, uint16(x)) + } + } + } + { + buf := w + w := ow + if len((buf.Bytes())) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len((buf.Bytes()))) + write16(w, uint16(x)) + } + { + _, err := w.Write((buf.Bytes())[:]) + chk(err) + } + } + } +} + +func (obj *ToolCaps) deserialize(r io.Reader) { + if _ = (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)); false { + { + p := &(*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).NonNil + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + } + { + var n uint16 + { + p := &n + *p = read16(r) + } + r := &io.LimitedReader{r, int64(n)} + if r.N > 0 { + (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).NonNil = true + } /**/ + { + if (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).NonNil { + { + var local379 uint8 + { + p := &local379 + *p = read8(r) + } + if local379 != (5) { + chk(fmt.Errorf("const %v: %v", 5, local379)) + } + } + { + p := &(*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).AttackCooldown + *p = math.Float32frombits(read32(r)) + } + { + p := &(*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).MaxDropLvl + *p = int16(read16(r)) + } + var local380 uint32 + { + p := &local380 + *p = read32(r) + } + ((*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).GroupCaps) = make([]ToolGroupCaps, local380) + for local381 := range (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).GroupCaps { + if err := pcall(func() { + (((*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).GroupCaps)[local381]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.ToolGroupCaps", err)) + } + } + var local382 uint32 + { + p := &local382 + *p = read32(r) + } + ((*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).DmgGroups) = make([]Group, local382) + for local383 := range (*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).DmgGroups { + if err := pcall(func() { + (((*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).DmgGroups)[local383]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Group", err)) + } + } + { + p := &(*(*(struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + }))(obj)).AttackUses + *p = read16(r) + } + } + } + if r.N > 0 { + chk(fmt.Errorf("%d bytes of trailing data", r.N)) + } + } +} + +func (obj *AnimType) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *AnimType) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *Box) serialize(w io.Writer) { + for local384 := range *(*([2]Vec))(obj) { + if err := pcall(func() { + ((*(*([2]Vec))(obj))[local384]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } + } +} + +func (obj *Box) deserialize(r io.Reader) { + for local385 := range *(*([2]Vec))(obj) { + if err := pcall(func() { + ((*(*([2]Vec))(obj))[local385]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Vec", err)) + } + } +} + +func (obj *TileFlags) serialize(w io.Writer) { + { + x := *(*(uint16))(obj) + write16(w, uint16(x)) + } +} + +func (obj *TileFlags) deserialize(r io.Reader) { + { + p := &*(*(uint16))(obj) + *p = read16(r) + } +} + +func (obj *AlignType) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *AlignType) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *NodeBoxType) serialize(w io.Writer) { + { + x := *(*(uint8))(obj) + write8(w, uint8(x)) + } +} + +func (obj *NodeBoxType) deserialize(r io.Reader) { + { + p := &*(*(uint8))(obj) + *p = read8(r) + } +} + +func (obj *DirBoxes) serialize(w io.Writer) { + if len(((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Top)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Top))) + write16(w, uint16(x)) + } + for local386 := range (*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Top { + if err := pcall(func() { + (((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Top)[local386]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + if len(((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Bot)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Bot))) + write16(w, uint16(x)) + } + for local387 := range (*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Bot { + if err := pcall(func() { + (((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Bot)[local387]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + if len(((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Front)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Front))) + write16(w, uint16(x)) + } + for local388 := range (*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Front { + if err := pcall(func() { + (((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Front)[local388]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + if len(((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Left)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Left))) + write16(w, uint16(x)) + } + for local389 := range (*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Left { + if err := pcall(func() { + (((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Left)[local389]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + if len(((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Back)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Back))) + write16(w, uint16(x)) + } + for local390 := range (*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Back { + if err := pcall(func() { + (((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Back)[local390]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + if len(((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Right)) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Right))) + write16(w, uint16(x)) + } + for local391 := range (*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Right { + if err := pcall(func() { + (((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Right)[local391]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } +} + +func (obj *DirBoxes) deserialize(r io.Reader) { + var local392 uint16 + { + p := &local392 + *p = read16(r) + } + ((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Top) = make([]Box, local392) + for local393 := range (*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Top { + if err := pcall(func() { + (((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Top)[local393]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + var local394 uint16 + { + p := &local394 + *p = read16(r) + } + ((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Bot) = make([]Box, local394) + for local395 := range (*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Bot { + if err := pcall(func() { + (((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Bot)[local395]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + var local396 uint16 + { + p := &local396 + *p = read16(r) + } + ((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Front) = make([]Box, local396) + for local397 := range (*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Front { + if err := pcall(func() { + (((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Front)[local397]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + var local398 uint16 + { + p := &local398 + *p = read16(r) + } + ((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Left) = make([]Box, local398) + for local399 := range (*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Left { + if err := pcall(func() { + (((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Left)[local399]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + var local400 uint16 + { + p := &local400 + *p = read16(r) + } + ((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Back) = make([]Box, local400) + for local401 := range (*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Back { + if err := pcall(func() { + (((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Back)[local401]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } + var local402 uint16 + { + p := &local402 + *p = read16(r) + } + ((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Right) = make([]Box, local402) + for local403 := range (*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Right { + if err := pcall(func() { + (((*(*(struct { + Top, Bot []Box + Front, Left, Back, Right []Box + }))(obj)).Right)[local403]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.Box", err)) + } + } +} + +func (obj *ToolGroupCaps) serialize(w io.Writer) { + if len(([]byte((*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).Name))) > math.MaxUint16 { + chk(ErrTooLong) + } + { + x := uint16(len(([]byte((*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).Name)))) + write16(w, uint16(x)) + } + { + _, err := w.Write(([]byte((*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).Name))[:]) + chk(err) + } + { + x := (*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).Uses + write16(w, uint16(x)) + } + { + x := (*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).MaxLvl + write16(w, uint16(x)) + } + if len(((*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).Times)) > math.MaxUint32 { + chk(ErrTooLong) + } + { + x := uint32(len(((*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).Times))) + write32(w, uint32(x)) + } + for local404 := range (*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).Times { + if err := pcall(func() { + (((*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).Times)[local404]).serialize(w) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.DigTime", err)) + } + } +} + +func (obj *ToolGroupCaps) deserialize(r io.Reader) { + var local405 []uint8 + var local406 uint16 + { + p := &local406 + *p = read16(r) + } + (local405) = make([]uint8, local406) + { + _, err := io.ReadFull(r, (local405)[:]) + chk(err) + } + ((*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).Name) = string(local405) + { + p := &(*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).Uses + *p = int16(read16(r)) + } + { + p := &(*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).MaxLvl + *p = int16(read16(r)) + } + var local407 uint32 + { + p := &local407 + *p = read32(r) + } + ((*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).Times) = make([]DigTime, local407) + for local408 := range (*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).Times { + if err := pcall(func() { + (((*(*(struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime + }))(obj)).Times)[local408]).deserialize(r) + }); err != nil { + if err == io.EOF { + chk(io.EOF) + } + chk(fmt.Errorf("%s: %w", "github.com/anon55555/mt.DigTime", err)) + } + } +} + +func (obj *DigTime) serialize(w io.Writer) { + { + x := (*(*(struct { + Rating int16 + Time float32 + }))(obj)).Rating + write16(w, uint16(x)) + } + { + x := (*(*(struct { + Rating int16 + Time float32 + }))(obj)).Time + write32(w, math.Float32bits(x)) + } +} + +func (obj *DigTime) deserialize(r io.Reader) { + { + p := &(*(*(struct { + Rating int16 + Time float32 + }))(obj)).Rating + *p = int16(read16(r)) + } + { + p := &(*(*(struct { + Rating int16 + Time float32 + }))(obj)).Time + *p = math.Float32frombits(read32(r)) + } +} diff --git a/sound.go b/sound.go new file mode 100644 index 0000000..953677c --- /dev/null +++ b/sound.go @@ -0,0 +1,16 @@ +package mt + +type SoundID int32 + +type SoundSrcType uint8 + +const ( + NoSrc SoundSrcType = iota + PosSrc + AOSrc +) + +type SoundDef struct { + Name string + Gain, Pitch, Fade float32 +} diff --git a/stack.go b/stack.go index 4e7cc18..d930604 100644 --- a/stack.go +++ b/stack.go @@ -1,5 +1,8 @@ -// In this file, JSON refers to WTF-JSON, a variant of JSON used by Minetest +// In this file, JSON refers to WTF-JSON. +// +// BUG(mt): Itemstrings use variant of JSON called WTF-JSON // where \u00XX escapes in string literals act like Go's \xXX escapes. +// This should not be fixed because it would break existing items. package mt @@ -22,6 +25,10 @@ type Item struct { ItemMeta } +// String returns the Stack's itemstring. +// +// BUG(mt): The term itemstring is somewhat misleading, because +// an itemstring represents a stack of items, not a single item. func (s Stack) String() string { if s.Count == 0 { return "" @@ -83,6 +90,7 @@ func jsonStr(s string) string { return b.String() } +// Scan scans an itemstring, implementing the fmt.Scanner interface. func (stk *Stack) Scan(state fmt.ScanState, verb rune) (err error) { *stk = Stack{} diff --git a/texture.go b/texture.go new file mode 100644 index 0000000..450cfa1 --- /dev/null +++ b/texture.go @@ -0,0 +1,3 @@ +package mt + +type Texture string diff --git a/tileanim.go b/tileanim.go new file mode 100644 index 0000000..bc6d6dd --- /dev/null +++ b/tileanim.go @@ -0,0 +1,27 @@ +package mt + +type AnimType uint8 + +const ( + NoAnim AnimType = iota + VerticalFrameAnim + SpritesheetAnim + maxAnim +) + +type TileAnim struct { + Type AnimType + //mt:assert %s.Type < maxAnim + + //mt:if %s.Type == SpritesheetAnim + AspectRatio [2]uint8 + //mt:end + + //mt:if %s.Type == VerticalFrameAnim + NFrames [2]uint16 + //mt:end + + //mt:if %s.Type != NoAnim + Duration float32 // in seconds + //mt:end +} diff --git a/tiledef.go b/tiledef.go new file mode 100644 index 0000000..9a5714d --- /dev/null +++ b/tiledef.go @@ -0,0 +1,40 @@ +package mt + +type AlignType uint8 + +const ( + NoAlign AlignType = iota + WorldAlign + UserAlign +) + +type TileFlags uint16 + +const ( + TileBackfaceCull TileFlags = 1 << iota + TileAbleH + TileAbleV + TileColor + TileScale + TileAlign +) + +type TileDef struct { + //mt:const uint8(6) + + Texture + Anim TileAnim + Flags TileFlags + + //mt:if %s.Flags&TileColor != 0 + R, G, B uint8 + //mt:end + + //mt:if %s.Flags&TileScale != 0 + Scale uint8 + //mt:end + + //mt:if %s.Flags&TileAlign != 0 + Align AlignType + //mt:end +} diff --git a/tocltcmds b/tocltcmds new file mode 100644 index 0000000..0dd5e7d --- /dev/null +++ b/tocltcmds @@ -0,0 +1,57 @@ +2 Hello +3 AcceptAuth +4 AcceptSudoMode +5 DenySudoMode +10 Disco +32 BlkData +33 AddNode +34 RemoveNode +39 Inv +41 TimeOfDay +42 CSMRestrictionFlags +43 AddPlayerVel +44 MediaPush +47 ChatMsg +49 AORmAdd +50 AOMsgs +51 HP +52 MovePlayer +53 DiscoLegacy +54 FOV +55 DeathScreen +56 Media +58 NodeDefs +60 AnnounceMedia +61 ItemDefs +63 PlaySound +64 StopSound +65 Privs +66 InvFormspec +67 DetachedInv +68 ShowFormspec +69 Movement +70 SpawnParticle +71 AddParticleSpawner +73 AddHUD +74 RmHUD +75 ChangeHUD +76 HUDFlags +77 SetHotbarParam +78 Breath +79 SkyParams +80 OverrideDayNightRatio +81 LocalPlayerAnim +82 EyeOffset +83 DelParticleSpawner +84 CloudParams +85 FadeSound +86 UpdatePlayerList +87 ModChanMsg +88 ModChanSig +89 NodeMetasChanged +90 SunParams +91 MoonParams +92 StarParams +96 SRPBytesSaltB +97 FormspecPrepend +98 MinimapModes diff --git a/tocltcmds.go b/tocltcmds.go new file mode 100644 index 0000000..6af4f09 --- /dev/null +++ b/tocltcmds.go @@ -0,0 +1,766 @@ +//go:generate ./cmdno.sh tocltcmds ToClt toClt uint16 Cmd newToCltCmd + +package mt + +import ( + "crypto/sha1" + "fmt" + "image/color" + "io" + "math" +) + +type ToCltCmd interface { + Cmd + toCltCmdNo() uint16 +} + +// ToCltHello is sent as a response to ToSrvInit. +// The client responds to ToCltHello by authenticating. +type ToCltHello struct { + SerializeVer uint8 + Compression CompressionModes + ProtoVer uint16 + AuthMethods + Username string +} + +// ToCltAcceptAuth is sent after the client successfully authenticates. +// The client responds to ToCltAcceptAuth with ToSrvInit2. +type ToCltAcceptAuth struct { + // The client does the equivalent of + // PlayerPos[1] -= 5 + // before using PlayerPos. + PlayerPos Pos + + MapSeed uint64 + SendInterval float32 + SudoAuthMethods AuthMethods +} + +type ToCltAcceptSudoMode struct{} + +type ToCltDenySudoMode struct{} + +// ToCltDisco tells that the client that it has been disconnected by the server. +type ToCltDisco struct { + Reason DiscoReason + //mt:assert %s.Reason < maxDiscoReason + + //mt:if dr := %s.Reason; dr == Custom || dr == Shutdown || dr == Crash + Custom string + //mt:end + + //mt:if dr := %s.Reason; dr == Shutdown || dr == Crash + Reconnect bool + //mt:end +} + +type DiscoReason uint8 + +const ( + WrongPasswd DiscoReason = iota + UnexpectedData + SrvIsSingleplayer + UnsupportedVer + BadNameChars + BadName + TooManyClts + EmptyPasswd + AlreadyConnected + SrvErr + Custom + Shutdown + Crash + maxDiscoReason +) + +func (cmd ToCltDisco) String() (msg string) { + switch cmd.Reason { + case WrongPasswd: + return "wrong password" + case UnexpectedData: + return "unexpected data" + case SrvIsSingleplayer: + return "server is singleplayer" + case UnsupportedVer: + return "unsupported client version" + case BadNameChars: + return "disallowed character(s) in player name" + case BadName: + return "disallowed player name" + case TooManyClts: + return "too many clients" + case EmptyPasswd: + return "empty password" + case AlreadyConnected: + return "another client is already connected with the same name" + case SrvErr: + return "server error" + case Custom: + return cmd.Custom + case Shutdown: + msg = "server shutdown" + case Crash: + msg = "server crash" + default: + msg = fmt.Sprintf("DiscoReason(%d)", cmd.Reason) + } + + if cmd.Custom != "" { + msg += ": " + cmd.Custom + } + + return +} + +// ToCltBlkData tells the client the contents of a nearby MapBlk. +type ToCltBlkData struct { + Blkpos [3]int16 + Blk MapBlk +} + +// ToCltAddNode tells the client that a nearby node changed +// to something other than air. +type ToCltAddNode struct { + Pos [3]int16 + Node + KeepMeta bool +} + +// ToCltRemoveNode tells the client that a nearby node changed to air. +type ToCltRemoveNode struct { + Pos [3]int16 +} + +// ToCltInv updates the client's inventory. +type ToCltInv struct { + //mt:raw + Inv string +} + +// ToCltTimeOfDay updates the client's in-game time of day. +type ToCltTimeOfDay struct { + Time uint16 // %24000 + Speed float32 // Speed times faster than real time +} + +// ToCltCSMRestrictionFlags tells the client how use of CSMs should be restricted. +type ToCltCSMRestrictionFlags struct { + Flags CSMRestrictionFlags + + // MapRange is the maximum distance from the player CSMs can read the map + // if Flags&LimitMapRange != 0. + MapRange uint32 +} + +type CSMRestrictionFlags uint64 + +const ( + NoCSMs CSMRestrictionFlags = 1 << iota + NoChatMsgs + NoItemDefs + NoNodeDefs + LimitMapRange + NoPlayerList +) + +// ToCltAddPlayerVel tells the client to add Vel to the player's velocity. +type ToCltAddPlayerVel struct { + Vel Vec +} + +// ToCltMediaPush is sent when a media file is dynamically added. +type ToCltMediaPush struct { + //mt:const uint16(sha1.Size) + SHA1 [sha1.Size]byte + Filename string + ShouldCache bool + + //mt:len32 + Data []byte +} + +// ToCltChatMsg tells the client that is has received a chat message. +type ToCltChatMsg struct { + //mt:const uint8(1) + + Type ChatMsgType + + //mt:utf16 + Sender, Text string + + Timestamp int64 // Unix time. +} + +type ChatMsgType uint8 + +const ( + RawMsg ChatMsgType = iota + NormalMsg + AnnounceMsg + SysMsg + maxMsg +) + +func (t ChatMsgType) String() string { + if t >= maxMsg { + return fmt.Sprintf("ChatMsgType(%d)", t) + } + + return [...]string{ + "raw", + "normal", + "announce", + "sys", + }[t] +} + +// ToCltAORmAdd tells the client that AOs have been removed from and/or added to +// the AOs that it can see. +type ToCltAORmAdd struct { + Remove []AOID + Add []struct { + ID AOID + //mt:const genericCAO + //mt:lenhdr 32 + InitData AOInitData + //mt:end + } +} + +// ToCltAOMsgs updates the client about nearby AOs. +type ToCltAOMsgs struct { + //mt:raw + Msgs []IDAOMsg +} + +// ToCltHP updates the player's HP on the client. +type ToCltHP struct { + HP uint16 +} + +// ToCltMovePlayer tells the client that the player has been moved server-side. +type ToCltMovePlayer struct { + Pos + Pitch, Yaw float32 +} + +type ToCltDiscoLegacy struct { + //mt:utf16 + Reason string +} + +// ToCltFOV tells the client to change its FOV. +type ToCltFOV struct { + FOV float32 + Multiplier bool + TransitionTime float32 +} + +// ToCltDeathScreen tells the client to show the death screen. +type ToCltDeathScreen struct { + PointCam bool + PointAt Pos +} + +// ToCltMedia responds to a ToSrvMedia packet with the requested media files. +type ToCltMedia struct { + // N is the total number of ToCltMedia packets. + // I is the index of this packet. + N, I uint16 + + //mt:len32 + Files []struct { + Name string + + //mt:len32 + Data []byte + } +} + +// ToCltNodeDefs tells the client the definitions of nodes. +type ToCltNodeDefs struct { + //mt:lenhdr 32 + //mt:zlib + + // Version. + //mt:const uint8(1) + + // See (de)serialize.fmt. + Defs []NodeDef + + //mt:end + //mt:end +} + +// ToCltAnnounceMedia tells the client what media is available on request. +// See ToSrvReqMedia. +type ToCltAnnounceMedia struct { + Files []struct { + Name string + Base64SHA1 string + } + URL string +} + +// ToCltItemDefs tells the client the definitions of items. +type ToCltItemDefs struct { + //mt:lenhdr 32 + //mt:zlib + + //mt:const uint8(0) + + Defs []ItemDef + Aliases []struct{ Alias, Orig string } + + //mt:end + //mt:end +} + +// ToCltPlaySound tells the client to play a sound. +type ToCltPlaySound struct { + ID SoundID + Name string + Gain float32 + SrcType SoundSrcType + Pos + SrcAOID AOID + Loop bool + Fade float32 + Pitch float32 + Ephemeral bool +} + +// ToCltStopSound tells the client to stop playing a sound. +type ToCltStopSound struct { + ID SoundID +} + +// ToCltPrivs tells the client its privs. +type ToCltPrivs struct { + Privs []string +} + +// ToCltInvFormspec tells the client its inventory formspec. +type ToCltInvFormspec struct { + //mt:len32 + Formspec string +} + +// ToCltDetachedInv updates a detached inventory on the client. +type ToCltDetachedInv struct { + Name string + Keep bool + Len uint16 // deprecated + + //mt:raw + Inv string +} + +// ToCltShowFormspec tells the client to show a formspec. +type ToCltShowFormspec struct { + //mt:len32 + Formspec string + + Formname string +} + +// ToCltMovement tells the client how to move. +type ToCltMovement struct { + DefaultAccel, AirAccel, FastAccel, + WalkSpeed, CrouchSpeed, FastSpeed, ClimbSpeed, JumpSpeed, + Fluidity, Smoothing, Sink, // liquids + Gravity float32 +} + +// ToCltSpawnParticle tells the client to spawn a particle. +type ToCltSpawnParticle struct { + Pos, Vel, Acc [3]float32 + ExpirationTime float32 // in seconds. + Size float32 + Collide bool + + //mt:len32 + Texture + + Vertical bool + CollisionRm bool + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 +} + +type ParticleSpawnerID uint32 + +// ToCltAddParticleSpawner tells the client to add a particle spawner. +type ToCltAddParticleSpawner struct { + Amount uint16 + Duration float32 + Pos, Vel, Acc [2][3]float32 + ExpirationTime [2]float32 // in seconds. + Size [2]float32 + Collide bool + + //mt:len32 + Texture + + ID ParticleSpawnerID + Vertical bool + CollisionRm bool + AttachedAOID AOID + AnimParams TileAnim + Glow uint8 + AOCollision bool + NodeParam0 Content + NodeParam2 uint8 + NodeTile uint8 +} + +type HUDID uint32 + +// ToCltHUDAdd tells the client to add a HUD. +type ToCltAddHUD struct { + ID HUDID + + Type HUDType + + Pos [2]float32 + Name string + Scale [2]float32 + Text string + Number uint32 + Item uint32 + Dir uint32 + Align [2]float32 + Offset [2]float32 + WorldPos Pos + Size [2]int32 + ZIndex int16 + Text2 string +} + +type HUDType uint8 + +const ( + ImgHUD HUDType = iota + TextHUD + StatbarHUD + InvHUD + WaypointHUD + ImgWaypointHUD +) + +// ToCltRmHUD tells the client to remove a HUD. +type ToCltRmHUD struct { + ID HUDID +} + +// ToCltChangeHUD tells the client to change a field in a HUD. +type ToCltChangeHUD struct { + ID HUDID + + Field HUDField + + //mt:assert %s.Field < hudMax + + //mt:if %s.Field == HUDPos + Pos [2]float32 + //mt:end + + //mt:if %s.Field == HUDName + Name string + //mt:end + + //mt:if %s.Field == HUDScale + Scale [2]float32 + //mt:end + + //mt:if %s.Field == HUDText + Text string + //mt:end + + //mt:if %s.Field == HUDNumber + Number uint32 + //mt:end + + //mt:if %s.Field == HUDItem + Item uint32 + //mt:end + + //mt:if %s.Field == HUDDir + Dir uint32 + //mt:end + + //mt:if %s.Field == HUDAlign + Align [2]float32 + //mt:end + + //mt:if %s.Field == HUDOffset + Offset [2]float32 + //mt:end + + //mt:if %s.Field == HUDWorldPos + WorldPos Pos + //mt:end + + //mt:if %s.Field == HUDSize + Size [2]int32 + //mt:end + + //mt:if %s.Field == HUDZIndex + ZIndex uint32 + //mt:end + + //mt:if %s.Field == HUDText2 + Text2 string + //mt:end +} + +type HUDField uint8 + +const ( + HUDPos HUDField = iota + HUDName + HUDScale + HUDText + HUDNumber + HUDItem + HUDDir + HUDAlign + HUDOffset + HUDWorldPos + HUDSize + HUDZIndex + HUDText2 + hudMax +) + +// ToCltHUDFlags tells the client to update its HUD flags. +type ToCltHUDFlags struct { + // &^= Mask + // |= Flags + Flags, Mask HUDFlags +} + +type HUDFlags uint32 + +const ( + ShowHotbar HUDFlags = 1 << iota + ShowHealthBar + ShowCrosshair + ShowWieldedItem + ShowBreathBar + ShowMinimap + ShowRadarMinimap +) + +// ToCltSetHotbarParam tells the client to set a hotbar parameter. +type ToCltSetHotbarParam struct { + Param HotbarParam + + //mt:if %s.Param == HotbarSize + //mt:const uint16(4) // Size of Size field. + Size int32 + //mt:end + + //mt:if %s.Param != HotbarSize + Img Texture + //mt:end +} + +type HotbarParam uint16 + +const ( + HotbarSize HotbarParam = 1 + iota + HotbarImg + HotbarSelImg +) + +// ToCltBreath tells the client how much breath it has. +type ToCltBreath struct { + Breath uint16 +} + +// ToCltSkyParams tells the client how to render the sky. +type ToCltSkyParams struct { + BgColor color.NRGBA + Type string + Clouds bool + SunFogTint color.NRGBA + MoonFogTint color.NRGBA + FogTintType string + + //mt:if %s.Type == "skybox" + Textures []Texture + //mt:end + + //mt:if %s.Type == "regular" + DaySky, DayHorizon, + DawnSky, DawnHorizon, + NightSky, NightHorizon, + Indoor color.NRGBA + //mt:end +} + +// ToCltOverrideDayNightRatio overrides the client's day-night ratio +type ToCltOverrideDayNightRatio struct { + Override bool + Ratio uint16 +} + +// ToCltLocalPlayerAnim tells the client how to animate the player. +type ToCltLocalPlayerAnim struct { + Idle, Walk, Dig, WalkDig [2]int32 + Speed float32 +} + +// ToCltEyeOffset tells the client where to position the camera +// relative to the player. +type ToCltEyeOffset struct { + First, Third Vec +} + +// ToCltDelParticleSpawner tells the client to delete a particle spawner. +type ToCltDelParticleSpawner struct { + ID ParticleSpawnerID +} + +// ToCltCloudParams tells the client how to render the clouds. +type ToCltCloudParams struct { + Density float32 + DiffuseColor color.NRGBA + AmbientColor color.NRGBA + Height float32 + Thickness float32 + Speed [2]float32 +} + +// ToCltFadeSound tells the client to fade a sound. +type ToCltFadeSound struct { + ID SoundID + Step float32 + Gain float32 +} + +// ToCltUpdatePlayerList informs the client of players leaving or joining. +type ToCltUpdatePlayerList struct { + Type PlayerListUpdateType + Players []string +} + +type PlayerListUpdateType uint8 + +const ( + InitPlayers PlayerListUpdateType = iota + AddPlayers + RemovePlayers +) + +// ToCltModChanMsg tells the client it has been sent a message on a mod channel. +type ToCltModChanMsg struct { + Channel string + Sender string + Msg string +} + +// ToCltModChanMsg tells the client it has received a signal on a mod channel. +type ToCltModChanSig struct { + Signal ModChanSig + Channel string +} + +type ModChanSig uint8 + +const ( + JoinOK ModChanSig = iota + JoinFail + LeaveOK + LeaveFail + NotRegistered + SetState +) + +// ToCltModChanMsg is sent when node metadata near the client changes. +type ToCltNodeMetasChanged struct { + //mt:lenhdr 32 + Changed map[[3]int16]*NodeMeta + //mt:end +} + +// ToCltSunParams tells the client how to render the sun. +type ToCltSunParams struct { + Visible bool + Texture + ToneMap Texture + Rise Texture + Rising bool + Size float32 +} + +// ToCltMoonParams tells the client how to render the moon. +type ToCltMoonParams struct { + Visible bool + Texture + ToneMap Texture + Size float32 +} + +// ToCltStarParams tells the client how to render the stars. +type ToCltStarParams struct { + Visible bool + Count uint32 + Color color.NRGBA + Size float32 +} + +type ToCltSRPBytesSaltB struct { + Salt, B []byte +} + +// ToCltFormspecPrepend tells the client to prepend a string to all formspecs. +type ToCltFormspecPrepend struct { + Prepend string +} + +// ToCltMinimapModes tells the client the set of available minimap modes. +type ToCltMinimapModes struct { + Current uint16 + Modes []MinimapMode +} + +func (cmd *ToCltMinimapModes) serialize(w io.Writer) error { + buf := make([]byte, 4) + if len(cmd.Modes) > math.MaxUint16 { + return ErrTooLong + } + be.PutUint16(buf[0:2], uint16(len(cmd.Modes))) + be.PutUint16(buf[2:4], cmd.Current) + if _, err := w.Write(buf); err != nil { + return err + } + for i := range cmd.Modes { + if err := serialize(w, &cmd.Modes[i]); err != nil { + return err + } + } + return nil +} + +func (cmd *ToCltMinimapModes) deserialize(r io.Reader) error { + buf := make([]byte, 4) + if _, err := io.ReadFull(r, buf); err != nil { + return err + } + cmd.Modes = make([]MinimapMode, be.Uint16(buf[0:2])) + cmd.Current = be.Uint16(buf[2:4]) + for i := range cmd.Modes { + if err := deserialize(r, &cmd.Modes[i]); err != nil { + return err + } + } + return nil +} diff --git a/tocltcmds_cmdno.go b/tocltcmds_cmdno.go new file mode 100644 index 0000000..8999717 --- /dev/null +++ b/tocltcmds_cmdno.go @@ -0,0 +1,121 @@ +// Code generated by cmdno.sh. DO NOT EDIT. + +package mt + +func (*ToCltHello) toCltCmdNo() uint16 { return 2 } +func (*ToCltAcceptAuth) toCltCmdNo() uint16 { return 3 } +func (*ToCltAcceptSudoMode) toCltCmdNo() uint16 { return 4 } +func (*ToCltDenySudoMode) toCltCmdNo() uint16 { return 5 } +func (*ToCltDisco) toCltCmdNo() uint16 { return 10 } +func (*ToCltBlkData) toCltCmdNo() uint16 { return 32 } +func (*ToCltAddNode) toCltCmdNo() uint16 { return 33 } +func (*ToCltRemoveNode) toCltCmdNo() uint16 { return 34 } +func (*ToCltInv) toCltCmdNo() uint16 { return 39 } +func (*ToCltTimeOfDay) toCltCmdNo() uint16 { return 41 } +func (*ToCltCSMRestrictionFlags) toCltCmdNo() uint16 { return 42 } +func (*ToCltAddPlayerVel) toCltCmdNo() uint16 { return 43 } +func (*ToCltMediaPush) toCltCmdNo() uint16 { return 44 } +func (*ToCltChatMsg) toCltCmdNo() uint16 { return 47 } +func (*ToCltAORmAdd) toCltCmdNo() uint16 { return 49 } +func (*ToCltAOMsgs) toCltCmdNo() uint16 { return 50 } +func (*ToCltHP) toCltCmdNo() uint16 { return 51 } +func (*ToCltMovePlayer) toCltCmdNo() uint16 { return 52 } +func (*ToCltDiscoLegacy) toCltCmdNo() uint16 { return 53 } +func (*ToCltFOV) toCltCmdNo() uint16 { return 54 } +func (*ToCltDeathScreen) toCltCmdNo() uint16 { return 55 } +func (*ToCltMedia) toCltCmdNo() uint16 { return 56 } +func (*ToCltNodeDefs) toCltCmdNo() uint16 { return 58 } +func (*ToCltAnnounceMedia) toCltCmdNo() uint16 { return 60 } +func (*ToCltItemDefs) toCltCmdNo() uint16 { return 61 } +func (*ToCltPlaySound) toCltCmdNo() uint16 { return 63 } +func (*ToCltStopSound) toCltCmdNo() uint16 { return 64 } +func (*ToCltPrivs) toCltCmdNo() uint16 { return 65 } +func (*ToCltInvFormspec) toCltCmdNo() uint16 { return 66 } +func (*ToCltDetachedInv) toCltCmdNo() uint16 { return 67 } +func (*ToCltShowFormspec) toCltCmdNo() uint16 { return 68 } +func (*ToCltMovement) toCltCmdNo() uint16 { return 69 } +func (*ToCltSpawnParticle) toCltCmdNo() uint16 { return 70 } +func (*ToCltAddParticleSpawner) toCltCmdNo() uint16 { return 71 } +func (*ToCltAddHUD) toCltCmdNo() uint16 { return 73 } +func (*ToCltRmHUD) toCltCmdNo() uint16 { return 74 } +func (*ToCltChangeHUD) toCltCmdNo() uint16 { return 75 } +func (*ToCltHUDFlags) toCltCmdNo() uint16 { return 76 } +func (*ToCltSetHotbarParam) toCltCmdNo() uint16 { return 77 } +func (*ToCltBreath) toCltCmdNo() uint16 { return 78 } +func (*ToCltSkyParams) toCltCmdNo() uint16 { return 79 } +func (*ToCltOverrideDayNightRatio) toCltCmdNo() uint16 { return 80 } +func (*ToCltLocalPlayerAnim) toCltCmdNo() uint16 { return 81 } +func (*ToCltEyeOffset) toCltCmdNo() uint16 { return 82 } +func (*ToCltDelParticleSpawner) toCltCmdNo() uint16 { return 83 } +func (*ToCltCloudParams) toCltCmdNo() uint16 { return 84 } +func (*ToCltFadeSound) toCltCmdNo() uint16 { return 85 } +func (*ToCltUpdatePlayerList) toCltCmdNo() uint16 { return 86 } +func (*ToCltModChanMsg) toCltCmdNo() uint16 { return 87 } +func (*ToCltModChanSig) toCltCmdNo() uint16 { return 88 } +func (*ToCltNodeMetasChanged) toCltCmdNo() uint16 { return 89 } +func (*ToCltSunParams) toCltCmdNo() uint16 { return 90 } +func (*ToCltMoonParams) toCltCmdNo() uint16 { return 91 } +func (*ToCltStarParams) toCltCmdNo() uint16 { return 92 } +func (*ToCltSRPBytesSaltB) toCltCmdNo() uint16 { return 96 } +func (*ToCltFormspecPrepend) toCltCmdNo() uint16 { return 97 } +func (*ToCltMinimapModes) toCltCmdNo() uint16 { return 98 } + +var newToCltCmd = map[uint16]func() Cmd{ + 2: func() Cmd { return new(ToCltHello) }, + 3: func() Cmd { return new(ToCltAcceptAuth) }, + 4: func() Cmd { return new(ToCltAcceptSudoMode) }, + 5: func() Cmd { return new(ToCltDenySudoMode) }, + 10: func() Cmd { return new(ToCltDisco) }, + 32: func() Cmd { return new(ToCltBlkData) }, + 33: func() Cmd { return new(ToCltAddNode) }, + 34: func() Cmd { return new(ToCltRemoveNode) }, + 39: func() Cmd { return new(ToCltInv) }, + 41: func() Cmd { return new(ToCltTimeOfDay) }, + 42: func() Cmd { return new(ToCltCSMRestrictionFlags) }, + 43: func() Cmd { return new(ToCltAddPlayerVel) }, + 44: func() Cmd { return new(ToCltMediaPush) }, + 47: func() Cmd { return new(ToCltChatMsg) }, + 49: func() Cmd { return new(ToCltAORmAdd) }, + 50: func() Cmd { return new(ToCltAOMsgs) }, + 51: func() Cmd { return new(ToCltHP) }, + 52: func() Cmd { return new(ToCltMovePlayer) }, + 53: func() Cmd { return new(ToCltDiscoLegacy) }, + 54: func() Cmd { return new(ToCltFOV) }, + 55: func() Cmd { return new(ToCltDeathScreen) }, + 56: func() Cmd { return new(ToCltMedia) }, + 58: func() Cmd { return new(ToCltNodeDefs) }, + 60: func() Cmd { return new(ToCltAnnounceMedia) }, + 61: func() Cmd { return new(ToCltItemDefs) }, + 63: func() Cmd { return new(ToCltPlaySound) }, + 64: func() Cmd { return new(ToCltStopSound) }, + 65: func() Cmd { return new(ToCltPrivs) }, + 66: func() Cmd { return new(ToCltInvFormspec) }, + 67: func() Cmd { return new(ToCltDetachedInv) }, + 68: func() Cmd { return new(ToCltShowFormspec) }, + 69: func() Cmd { return new(ToCltMovement) }, + 70: func() Cmd { return new(ToCltSpawnParticle) }, + 71: func() Cmd { return new(ToCltAddParticleSpawner) }, + 73: func() Cmd { return new(ToCltAddHUD) }, + 74: func() Cmd { return new(ToCltRmHUD) }, + 75: func() Cmd { return new(ToCltChangeHUD) }, + 76: func() Cmd { return new(ToCltHUDFlags) }, + 77: func() Cmd { return new(ToCltSetHotbarParam) }, + 78: func() Cmd { return new(ToCltBreath) }, + 79: func() Cmd { return new(ToCltSkyParams) }, + 80: func() Cmd { return new(ToCltOverrideDayNightRatio) }, + 81: func() Cmd { return new(ToCltLocalPlayerAnim) }, + 82: func() Cmd { return new(ToCltEyeOffset) }, + 83: func() Cmd { return new(ToCltDelParticleSpawner) }, + 84: func() Cmd { return new(ToCltCloudParams) }, + 85: func() Cmd { return new(ToCltFadeSound) }, + 86: func() Cmd { return new(ToCltUpdatePlayerList) }, + 87: func() Cmd { return new(ToCltModChanMsg) }, + 88: func() Cmd { return new(ToCltModChanSig) }, + 89: func() Cmd { return new(ToCltNodeMetasChanged) }, + 90: func() Cmd { return new(ToCltSunParams) }, + 91: func() Cmd { return new(ToCltMoonParams) }, + 92: func() Cmd { return new(ToCltStarParams) }, + 96: func() Cmd { return new(ToCltSRPBytesSaltB) }, + 97: func() Cmd { return new(ToCltFormspecPrepend) }, + 98: func() Cmd { return new(ToCltMinimapModes) }, +} diff --git a/toolcaps.go b/toolcaps.go new file mode 100644 index 0000000..c414607 --- /dev/null +++ b/toolcaps.go @@ -0,0 +1,45 @@ +package mt + +type ToolCaps struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + //mt:end + + //mt:lenhdr 16 + + //mt:ifde + //mt:if r.N > 0 { %s.NonNil = true}; /**/ + //mt:if %s.NonNil + + //mt:const uint8(5) + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + + //mt:end + //mt:end + + //mt:end +} + +type ToolGroupCaps struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime +} + +type DigTime struct { + Rating int16 + Time float32 +} diff --git a/tosrvcmds b/tosrvcmds new file mode 100644 index 0000000..08d880f --- /dev/null +++ b/tosrvcmds @@ -0,0 +1,23 @@ +0 Nil +2 Init +17 Init2 +23 ModChanJoin +24 ModChanLeave +25 ModChanMsg +35 PlayerPos +36 GotBlks +37 DeletedBlks +49 InvAction +50 ChatMsg +53 FallDmg +55 SelectItem +56 Respawn +57 Interact +58 RemovedSounds +59 NodeMetaFields +60 InvFields +64 ReqMedia +67 CltReady +80 FirstSRP +81 SRPBytesA +82 SRPBytesM diff --git a/tosrvcmds.go b/tosrvcmds.go new file mode 100644 index 0000000..4f60600 --- /dev/null +++ b/tosrvcmds.go @@ -0,0 +1,155 @@ +//go:generate ./cmdno.sh tosrvcmds ToSrv toSrv uint16 Cmd newToSrvCmd + +package mt + +type ToSrvCmd interface { + Cmd + toSrvCmdNo() uint16 +} + +// ToSrvNil is the first packet sent in a connection. +type ToSrvNil struct{} + +// ToSrvInit is sent as unreliable after ToSrvNil and is re-sent repeatedly +// until either the server replies with ToCltHello or 10 seconds pass and +// the connection times out. +type ToSrvInit struct { + SerializeVer uint8 + SupportedCompression CompressionModes + MinProtoVer, MaxProtoVer uint16 + PlayerName string + + //mt:opt + SendFullItemMeta bool +} + +// ToSrvInit2 is sent after ToCltAcceptAuth is received. +// The server responds to ToSrvInit2 by sending ToCltItemDefs, ToCltNodeDefs, +// ToCltAnnounceMedia, ToCltMovement and ToCltCSMRestrictionFlags. +type ToSrvInit2 struct { + Lang string +} + +// ToSrvModChanJoin attempts to join a mod channel. +type ToSrvModChanJoin struct { + Channel string +} + +// ToSrvModChanJoin attempts to leave a mod channel. +type ToSrvModChanLeave struct { + Channel string +} + +// ToSrvModChanJoin sends a message on a mod channel. +type ToSrvModChanMsg struct { + Channel string + Msg string +} + +// ToSrvPlayerPos tells the server that the client's PlayerPos has changed. +type ToSrvPlayerPos struct { + Pos PlayerPos +} + +// ToSrvGotBlks tells the server that the client has received Blks. +type ToSrvGotBlks struct { + //mt:len8 + Blks [][3]int16 +} + +// ToSrvDeletedBlks tells the server that the client has deleted Blks. +type ToSrvDeletedBlks struct { + //mt:len8 + Blks [][3]int16 +} + +// ToSrvInvAction tells the server that the client has performed an inventory action. +type ToSrvInvAction struct { + //mt:raw + Action string +} + +// ToSrvChatMsg tells the server that the client has sent a chat message. +type ToSrvChatMsg struct { + //mt:utf16 + Msg string +} + +// ToSrvFallDmg tells the server that the client has taken fall damage. +type ToSrvFallDmg struct { + Amount uint16 +} + +// ToSrvSelectItem tells the server the selected item in the client's hotbar. +type ToSrvSelectItem struct { + Slot uint16 +} + +// ToSrvRespawn tells the server that the player has respawned. +type ToSrvRespawn struct{} + +// ToSrvInteract tells the server that a node or AO has been interacted with. +type ToSrvInteract struct { + Action Interaction + ItemSlot uint16 + //mt:lenhdr 32 + Pointed PointedThing + //mt:end + Pos PlayerPos +} + +type Interaction uint8 + +const ( + Dig Interaction = iota + StopDigging + Dug + Place + Use // Left click snowball-like. + Activate // Right click air. +) + +// ToSrvRemovedSounds tells the server that the client has finished playing +// the sounds with the given IDs. +type ToSrvRemovedSounds struct { + IDs []SoundID +} + +type ToSrvNodeMetaFields struct { + Pos [3]int16 + Formname string + Fields []Field +} + +type ToSrvInvFields struct { + Formname string + Fields []Field +} + +// ToSrvReqMedia requests media files from the server. +type ToSrvReqMedia struct { + Filenames []string +} + +type ToSrvCltReady struct { + // Version information. + Major, Minor, Patch uint8 + Reserved uint8 + Version string + Formspec uint16 +} + +type ToSrvFirstSRP struct { + Salt []byte + Verifier []byte + EmptyPasswd bool +} + +type ToSrvSRPBytesA struct { + A []byte + NoSHA1 bool +} + +type ToSrvSRPBytesM struct { + M []byte +} diff --git a/tosrvcmds_cmdno.go b/tosrvcmds_cmdno.go new file mode 100644 index 0000000..04e6530 --- /dev/null +++ b/tosrvcmds_cmdno.go @@ -0,0 +1,53 @@ +// Code generated by cmdno.sh. DO NOT EDIT. + +package mt + +func (*ToSrvNil) toSrvCmdNo() uint16 { return 0 } +func (*ToSrvInit) toSrvCmdNo() uint16 { return 2 } +func (*ToSrvInit2) toSrvCmdNo() uint16 { return 17 } +func (*ToSrvModChanJoin) toSrvCmdNo() uint16 { return 23 } +func (*ToSrvModChanLeave) toSrvCmdNo() uint16 { return 24 } +func (*ToSrvModChanMsg) toSrvCmdNo() uint16 { return 25 } +func (*ToSrvPlayerPos) toSrvCmdNo() uint16 { return 35 } +func (*ToSrvGotBlks) toSrvCmdNo() uint16 { return 36 } +func (*ToSrvDeletedBlks) toSrvCmdNo() uint16 { return 37 } +func (*ToSrvInvAction) toSrvCmdNo() uint16 { return 49 } +func (*ToSrvChatMsg) toSrvCmdNo() uint16 { return 50 } +func (*ToSrvFallDmg) toSrvCmdNo() uint16 { return 53 } +func (*ToSrvSelectItem) toSrvCmdNo() uint16 { return 55 } +func (*ToSrvRespawn) toSrvCmdNo() uint16 { return 56 } +func (*ToSrvInteract) toSrvCmdNo() uint16 { return 57 } +func (*ToSrvRemovedSounds) toSrvCmdNo() uint16 { return 58 } +func (*ToSrvNodeMetaFields) toSrvCmdNo() uint16 { return 59 } +func (*ToSrvInvFields) toSrvCmdNo() uint16 { return 60 } +func (*ToSrvReqMedia) toSrvCmdNo() uint16 { return 64 } +func (*ToSrvCltReady) toSrvCmdNo() uint16 { return 67 } +func (*ToSrvFirstSRP) toSrvCmdNo() uint16 { return 80 } +func (*ToSrvSRPBytesA) toSrvCmdNo() uint16 { return 81 } +func (*ToSrvSRPBytesM) toSrvCmdNo() uint16 { return 82 } + +var newToSrvCmd = map[uint16]func() Cmd{ + 0: func() Cmd { return new(ToSrvNil) }, + 2: func() Cmd { return new(ToSrvInit) }, + 17: func() Cmd { return new(ToSrvInit2) }, + 23: func() Cmd { return new(ToSrvModChanJoin) }, + 24: func() Cmd { return new(ToSrvModChanLeave) }, + 25: func() Cmd { return new(ToSrvModChanMsg) }, + 35: func() Cmd { return new(ToSrvPlayerPos) }, + 36: func() Cmd { return new(ToSrvGotBlks) }, + 37: func() Cmd { return new(ToSrvDeletedBlks) }, + 49: func() Cmd { return new(ToSrvInvAction) }, + 50: func() Cmd { return new(ToSrvChatMsg) }, + 53: func() Cmd { return new(ToSrvFallDmg) }, + 55: func() Cmd { return new(ToSrvSelectItem) }, + 56: func() Cmd { return new(ToSrvRespawn) }, + 57: func() Cmd { return new(ToSrvInteract) }, + 58: func() Cmd { return new(ToSrvRemovedSounds) }, + 59: func() Cmd { return new(ToSrvNodeMetaFields) }, + 60: func() Cmd { return new(ToSrvInvFields) }, + 64: func() Cmd { return new(ToSrvReqMedia) }, + 67: func() Cmd { return new(ToSrvCltReady) }, + 80: func() Cmd { return new(ToSrvFirstSRP) }, + 81: func() Cmd { return new(ToSrvSRPBytesA) }, + 82: func() Cmd { return new(ToSrvSRPBytesM) }, +} diff --git a/vec.go b/vec.go new file mode 100644 index 0000000..08422c6 --- /dev/null +++ b/vec.go @@ -0,0 +1,20 @@ +package mt + +// A Vec is a 3D vector in units of 0.1 nodes. +type Vec [3]float32 + +// Add returns v+w. +func (v Vec) Add(w Vec) Vec { + for i := range v { + v[i] += w[i] + } + return v +} + +// Sub returns v-w. +func (v Vec) Sub(w Vec) Vec { + for i := range v { + v[i] -= w[i] + } + return v +} diff --git a/zerialize.go b/zerialize.go new file mode 100644 index 0000000..0e07bec --- /dev/null +++ b/zerialize.go @@ -0,0 +1,56 @@ +// This file is called zerialize.go so the following go:generate runs last. + +//go:generate ./mkserialize.sh + +package mt + +import ( + "encoding/binary" + "errors" + "io" +) + +// ErrTooLong reports a length that is too long to serialize. +var ErrTooLong = errors.New("len too long") + +var be = binary.BigEndian + +type serializer interface { + serialize(w io.Writer) +} + +func serialize(w io.Writer, s interface{}) error { + return pcall(func() { s.(serializer).serialize(w) }) +} + +type deserializer interface { + deserialize(r io.Reader) +} + +func deserialize(r io.Reader, d interface{}) error { + return pcall(func() { d.(deserializer).deserialize(r) }) +} + +type serializationError struct { + error +} + +func pcall(f func()) (rerr error) { + defer func() { + switch r := recover().(type) { + case serializationError: + rerr = r.error + case nil: + default: + panic(r) + } + }() + f() + return +} + +func chk(err error) { + if err != nil { + panic(serializationError{err}) + } +} -- 2.44.0