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

Commit 29f2b0a

Browse files
author
ggmolly
committedJul 21, 2024·
update: game notices are up-to-date
1 parent cf54df7 commit 29f2b0a

File tree

3 files changed

+40
-10
lines changed

3 files changed

+40
-10
lines changed
 

‎answer/game_notices.go

+10-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,16 @@ func GameNotices(buffer *[]byte, client *connection.Client) (int, int, error) {
2121

2222
for i, notice := range notices {
2323
response.NoticeList[i] = &protobuf.NOTICEINFO{
24-
Id: proto.Uint32(uint32(notice.ID)),
25-
Title: proto.String(notice.Title),
26-
Content: proto.String(notice.Content),
24+
Id: proto.Uint32(uint32(notice.ID)),
25+
Version: proto.String(fmt.Sprint(notice.Version)),
26+
BtnTitle: proto.String(notice.BtnTitle),
27+
Title: proto.String(notice.Title),
28+
TitleImage: proto.String(notice.TitleImage),
29+
TimeDesc: proto.String(notice.TimeDesc),
30+
Content: proto.String(notice.Content),
31+
TagType: proto.Uint32(uint32(notice.TagType)),
32+
Icon: proto.Uint32(uint32(notice.Icon)),
33+
Track: proto.String(notice.Track),
2734
}
2835
}
2936
return client.SendMessage(11300, &response)

‎consts/notice.go

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package consts
2+
3+
// Refer to https://github.com/ggmolly/belfast/blob/main/protobuf/NOTICEINFO.pb.go
4+
var (
5+
// Notice.TagType
6+
TAG_TYPE_EVENT = 1
7+
TAG_TYPE_SYSTEM = 2
8+
TAG_TYPE_NEWS = 3
9+
10+
// Notice.Icon
11+
ICON_ACTIVITY_COMMON = 1
12+
ICON_ACTIVITY_SUMMARY = 2
13+
ICON_ACTIVITY_TIME_LIMIT = 3
14+
ICON_BUILD_TIME_LIMIT = 4
15+
ICON_EQUIBMENT_SKIN_NEW = 5
16+
ICON_FURNITURE_NEW = 6
17+
ICON_INFO_COMMON = 7
18+
ICON_SKIN_NEW = 8
19+
ICON_SYSTEM_COMMON = 9
20+
)

‎orm/notice.go

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
package orm
22

33
type Notice struct {
4-
ID int `gorm:"primary_key"`
5-
Version int `gorm:"type:smallint;default:1;not_null"`
6-
BtnTitle string `gorm:"size:128;not_null"`
7-
Title string `gorm:"size:256;not_null"`
8-
TitleImageURL string `gorm:"type:text;not_null"`
9-
TimeDesc string `gorm:"size:10;not_null"`
10-
Content string `gorm:"type:text;not_null"`
4+
ID int `gorm:"primary_key"`
5+
Version string `gorm:"default:'1';not_null"`
6+
BtnTitle string `gorm:"type:varchar(48);not_null"`
7+
Title string `gorm:"type:varchar(48);not_null"`
8+
TitleImage string `gorm:"type:text;not_null"`
9+
TimeDesc string `gorm:"type:varchar(10);not_null"`
10+
Content string `gorm:"type:text;not_null"`
11+
TagType int `gorm:"not_null;default:1"`
12+
Icon int `gorm:"not_null;default:1"`
13+
Track string `gorm:"type:varchar(10);not_null"`
1114
}
1215

1316
// Inserts or updates a notice in the database (based on the primary key)

0 commit comments

Comments
 (0)
This repository has been archived.