Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
update: game notices are up-to-date
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmolly committed Jul 21, 2024
1 parent cf54df7 commit 29f2b0a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 10 deletions.
13 changes: 10 additions & 3 deletions answer/game_notices.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 20 additions & 0 deletions consts/notice.go
Original file line number Diff line number Diff line change
@@ -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
)
17 changes: 10 additions & 7 deletions orm/notice.go
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 29f2b0a

Please sign in to comment.