summaryrefslogtreecommitdiff
path: root/classic/ext_env_map_aspect.go
blob: 0c2f5e14920dcfd831c9f3c7cde942be0b7494a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package classic

import "bytes"

type DoubleString [128]byte

func PadDString(str string) DoubleString {
	var pstr DoubleString
	copy(pstr[:], []byte(str))
	if len(str) < 64 {
		copy(pstr[len(str):], bytes.Repeat([]byte(" "), 128 - len(str)))
	}
	return pstr
}

func UnpadDString(pstr DoubleString) string {
	return string(bytes.TrimRight(pstr[:], " "))
}

func (s DoubleString) String() string {
	return UnpadDString(s)
}

type SetMapEnvUrl struct {
	TexturePackUrl DoubleString
}
func (p *SetMapEnvUrl) PacketId() byte {
	return 0x28
}

const (
	SideBlock = iota
	HorizonBlock
	EdgeHeight
	CloudsHeight
	ViewDistance
	CloudsSpeed
	WeatherSpeed
	WeatherFad
	ExpFog
	SidesEdgeOffset
)

type SetMapEnvProperty struct {
	PropertyType byte
	PropertyVal int
}
func (p *SetMapEnvProperty) PacketId() byte {
	return 0x29
}