diff --git a/answer/game_notices.go b/answer/game_notices.go index 42c444d..e9c1fbb 100644 --- a/answer/game_notices.go +++ b/answer/game_notices.go @@ -21,9 +21,16 @@ func GameNotices(buffer *[]byte, client *connection.Client) (int, int, error) { for i, notice := range notices { response.NoticeList[i] = &protobuf.NOTICEINFO{ - Id: proto.Uint32(uint32(notice.ID)), - Title: proto.String(notice.Title), - Content: proto.String(notice.Content), + Id: proto.Uint32(uint32(notice.ID)), + Version: proto.String(fmt.Sprint(notice.Version)), + BtnTitle: proto.String(notice.BtnTitle), + Title: proto.String(notice.Title), + TitleImage: proto.String(notice.TitleImage), + TimeDesc: proto.String(notice.TimeDesc), + Content: proto.String(notice.Content), + TagType: proto.Uint32(uint32(notice.TagType)), + Icon: proto.Uint32(uint32(notice.Icon)), + Track: proto.String(notice.Track), } } return client.SendMessage(11300, &response) diff --git a/consts/notice.go b/consts/notice.go new file mode 100644 index 0000000..835fc1d --- /dev/null +++ b/consts/notice.go @@ -0,0 +1,20 @@ +package consts + +// Refer to https://github.com/ggmolly/belfast/blob/main/protobuf/NOTICEINFO.pb.go +var ( + // Notice.TagType + TAG_TYPE_EVENT = 1 + TAG_TYPE_SYSTEM = 2 + TAG_TYPE_NEWS = 3 + + // Notice.Icon + ICON_ACTIVITY_COMMON = 1 + ICON_ACTIVITY_SUMMARY = 2 + ICON_ACTIVITY_TIME_LIMIT = 3 + ICON_BUILD_TIME_LIMIT = 4 + ICON_EQUIBMENT_SKIN_NEW = 5 + ICON_FURNITURE_NEW = 6 + ICON_INFO_COMMON = 7 + ICON_SKIN_NEW = 8 + ICON_SYSTEM_COMMON = 9 +) diff --git a/orm/notice.go b/orm/notice.go index 7d88a3e..a532712 100644 --- a/orm/notice.go +++ b/orm/notice.go @@ -1,13 +1,16 @@ package orm type Notice struct { - ID int `gorm:"primary_key"` - Version int `gorm:"type:smallint;default:1;not_null"` - BtnTitle string `gorm:"size:128;not_null"` - Title string `gorm:"size:256;not_null"` - TitleImageURL string `gorm:"type:text;not_null"` - TimeDesc string `gorm:"size:10;not_null"` - Content string `gorm:"type:text;not_null"` + ID int `gorm:"primary_key"` + Version string `gorm:"default:'1';not_null"` + BtnTitle string `gorm:"type:varchar(48);not_null"` + Title string `gorm:"type:varchar(48);not_null"` + TitleImage string `gorm:"type:text;not_null"` + TimeDesc string `gorm:"type:varchar(10);not_null"` + Content string `gorm:"type:text;not_null"` + TagType int `gorm:"not_null;default:1"` + Icon int `gorm:"not_null;default:1"` + Track string `gorm:"type:varchar(10);not_null"` } // Inserts or updates a notice in the database (based on the primary key)