diff --git a/patch-schema/05-gacha-roll-name.sql b/patch-schema/05-gacha-roll-name.sql new file mode 100644 index 000000000..ee4b11269 --- /dev/null +++ b/patch-schema/05-gacha-roll-name.sql @@ -0,0 +1,6 @@ +BEGIN; + +ALTER TABLE IF EXISTS public.gacha_entries + ADD COLUMN name text; + +END; \ No newline at end of file diff --git a/server/channelserver/handlers_shop_gacha.go b/server/channelserver/handlers_shop_gacha.go index 1341e341c..0fe48ac03 100644 --- a/server/channelserver/handlers_shop_gacha.go +++ b/server/channelserver/handlers_shop_gacha.go @@ -40,13 +40,14 @@ type GachaEntry struct { EntryType uint8 `db:"entry_type"` ID uint32 `db:"id"` ItemType uint8 `db:"item_type"` - ItemNumber uint16 `db:"item_number"` + ItemNumber uint32 `db:"item_number"` ItemQuantity uint16 `db:"item_quantity"` Weight float64 `db:"weight"` Rarity uint8 `db:"rarity"` Rolls uint8 `db:"rolls"` FrontierPoints uint16 `db:"frontier_points"` DailyLimit uint8 `db:"daily_limit"` + Name string `db:"name"` } type GachaItem struct { @@ -151,7 +152,7 @@ func handleMsgMhfEnumerateShop(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint32(pkt.ShopID) var gachaType int s.server.db.QueryRow(`SELECT gacha_type FROM gacha_shop WHERE id = $1`, pkt.ShopID).Scan(&gachaType) - entries, err := s.server.db.Queryx(`SELECT entry_type, id, item_type, item_number, item_quantity, weight, rarity, rolls, daily_limit, frontier_points FROM gacha_entries WHERE gacha_id = $1 ORDER BY weight DESC`, pkt.ShopID) + entries, err := s.server.db.Queryx(`SELECT entry_type, id, item_type, item_number, item_quantity, weight, rarity, rolls, daily_limit, frontier_points, name FROM gacha_entries WHERE gacha_id = $1 ORDER BY weight DESC`, pkt.ShopID) if err != nil { doAckBufSucceed(s, pkt.AckHandle, make([]byte, 4)) return @@ -168,8 +169,7 @@ func handleMsgMhfEnumerateShop(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint8(gachaEntry.EntryType) bf.WriteUint32(gachaEntry.ID) bf.WriteUint8(gachaEntry.ItemType) - bf.WriteUint16(0) - bf.WriteUint16(gachaEntry.ItemNumber) + bf.WriteUint32(gachaEntry.ItemNumber) bf.WriteUint16(gachaEntry.ItemQuantity) if gachaType >= 4 { // If box bf.WriteUint16(1) @@ -197,7 +197,11 @@ func handleMsgMhfEnumerateShop(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint16(gachaEntry.FrontierPoints) bf.WriteUint8(gachaEntry.DailyLimit) - bf.WriteUint8(0) + if gachaEntry.EntryType < 10 { + ps.Uint8(bf, gachaEntry.Name, true) + } else { + bf.WriteUint8(0) + } bf.WriteBytes(temp.Data()) } bf.Seek(4, 0)