User & Medal 添加更多字段

This commit is contained in:
Akiba
2022-05-14 12:07:27 +08:00
parent 9193a688b1
commit 1081db0728
2 changed files with 18 additions and 10 deletions

View File

@@ -74,15 +74,19 @@ func (d *Danmaku) Parse(data []byte) {
}
d.Content = info.Get("1").String()
d.Sender = &User{
Uid: int(info.Get("2.0").Int()),
Uname: info.Get("2.1").String(),
GuardLevel: int(info.Get("7").Int()),
Uid: int(info.Get("2.0").Int()),
Uname: info.Get("2.1").String(),
Admin: info.Get("2.2").Bool(),
Urank: int(info.Get("2.5").Int()),
MobileVerify: info.Get("2.6").Bool(),
GuardLevel: int(info.Get("7").Int()),
Medal: &Medal{
Name: info.Get("3.1").String(),
Level: int(info.Get("3.0").Int()),
UpUid: int(info.Get("3.12").Int()),
UpRoomId: int(info.Get("3.3").Int()),
Name: info.Get("3.1").String(),
UpName: info.Get("3.2").String(),
UpRoomId: int(info.Get("3.3").Int()),
Color: int(info.Get("3.4").Int()),
UpUid: int(info.Get("3.12").Int()),
},
}
d.Extra = ext

View File

@@ -1,15 +1,19 @@
package message
type User struct {
Uid int
Uname string
Medal *Medal
GuardLevel int
Uid int
Uname string
Admin bool
Urank int
MobileVerify bool
Medal *Medal
GuardLevel int
}
type Medal struct {
Name string
Level int
Color int
UpRoomId int
UpUid int
UpName string