增加playroominfo 点赞次数

This commit is contained in:
hahwu 2025-04-28 17:32:52 +08:00
parent 5ac7ba79aa
commit 3a86736040
4 changed files with 14 additions and 2 deletions

View File

@ -806,6 +806,7 @@ func (p *Player) UpdateUserInfo() {
simple.PetName = p.PlayMod.getBaseMod().PetName
simple.Emoji = p.PlayMod.getEmojiMod().Set
simple.Friend = p.PlayMod.getFriendMod().GetSimpleFriendList()
simple.Upvote = p.PlayMod.getPlayroomMod().Upvote
value, _ := json.Marshal(simple)
IdStr := strconv.Itoa(int(p.M_DwUin))
db.RedisSetKey(IdStr, string(value), 0)

View File

@ -133,5 +133,6 @@ func PlayroomVisit(p *Player, Uid int) {
r.Upvote = GoUtil.InArray(Uid, PlayroomMod.UpvoteList)
r.Items = Items
r.Status = int32(PlayroomMod.GameStatus)
r.UpvoteCount = int32(PlayerData.Upvote)
p.PushClientRes(r)
}

View File

@ -25,6 +25,7 @@ type PlayerSimpleData struct {
PetName string
Emoji map[int]int
Friend []int
Upvote int
}
type VarGoldCard struct {

View File

@ -19974,6 +19974,7 @@ type ResPlayroomInfo struct {
PetName string `protobuf:"bytes,12,opt,name=PetName,proto3" json:"PetName,omitempty"` // 宠物名
Emoji map[int32]int32 `protobuf:"bytes,13,rep,name=Emoji,proto3" json:"Emoji,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` // 表情
Upvote bool `protobuf:"varint,14,opt,name=Upvote,proto3" json:"Upvote,omitempty"` // 是否点赞
UpvoteCount int32 `protobuf:"varint,15,opt,name=UpvoteCount,proto3" json:"UpvoteCount,omitempty"` // 点赞次数
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@ -20106,6 +20107,13 @@ func (x *ResPlayroomInfo) GetUpvote() bool {
return false
}
func (x *ResPlayroomInfo) GetUpvoteCount() int32 {
if x != nil {
return x.UpvoteCount
}
return 0
}
// 请求翻牌
type ReqPlayroomFlip struct {
state protoimpl.MessageState `protogen:"open.v1"`
@ -23984,7 +23992,7 @@ const file_proto_Gameapi_proto_rawDesc = "" +
"\x06Avatar\x18\x04 \x01(\x05R\x06Avatar\x12\x1a\n" +
"\bLastTime\x18\x05 \x01(\x05R\bLastTime\"#\n" +
"\x0fReqPlayroomInfo\x12\x10\n" +
"\x03Uid\x18\x01 \x01(\x03R\x03Uid\"\xfb\x05\n" +
"\x03Uid\x18\x01 \x01(\x03R\x03Uid\"\x9d\x06\n" +
"\x0fResPlayroomInfo\x12\x10\n" +
"\x03Uid\x18\x01 \x01(\x03R\x03Uid\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" +
@ -24000,7 +24008,8 @@ const file_proto_Gameapi_proto_rawDesc = "" +
"\x04Chip\x18\v \x03(\v2\x12.tutorial.ChipInfoR\x04Chip\x12\x18\n" +
"\aPetName\x18\f \x01(\tR\aPetName\x12:\n" +
"\x05Emoji\x18\r \x03(\v2$.tutorial.ResPlayroomInfo.EmojiEntryR\x05Emoji\x12\x16\n" +
"\x06Upvote\x18\x0e \x01(\bR\x06Upvote\x1a;\n" +
"\x06Upvote\x18\x0e \x01(\bR\x06Upvote\x12 \n" +
"\vUpvoteCount\x18\x0f \x01(\x05R\vUpvoteCount\x1a;\n" +
"\rPlayroomEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n" +
"\x05value\x18\x02 \x01(\x05R\x05value:\x028\x01\x1aL\n" +