playroom优化

This commit is contained in:
hahwu 2025-07-16 18:37:12 +08:00
parent f125c77a0d
commit 7a2f4de850
5 changed files with 12 additions and 5 deletions

View File

@ -149,6 +149,8 @@ func (f *FriendMgr) SetVarUserData(m *msg.Msg) (interface{}, error) {
data.Upvote++ data.Upvote++
case VAR_OP_CHIP: case VAR_OP_CHIP:
data.Chip += VarOp.Data.(int) data.Chip += VarOp.Data.(int)
case VAR_OP_CHIP_SET:
data.Chip = VarOp.Data.(int)
case VAR_OP_KISS: case VAR_OP_KISS:
data.Kiss = VarOp.Data.(int) data.Kiss = VarOp.Data.(int)
} }

View File

@ -320,7 +320,7 @@ func ReqGmCommand_(player *Player, Command string) error {
PlayroomBackData(player) PlayroomBackData(player)
case "addChip": case "addChip":
PlayroomMod := player.PlayMod.getPlayroomMod() PlayroomMod := player.PlayMod.getPlayroomMod()
PlayroomMod.AddChip(1, 1, 0) PlayroomMod.AddChip(100100001, 1, 0)
player.PushClientRes(PlayroomMod.NotifyLose()) player.PushClientRes(PlayroomMod.NotifyLose())
case "save": case "save":
player.PlayMod.ClearData(player) player.PlayMod.ClearData(player)

View File

@ -3526,7 +3526,7 @@ func ReqPlayroomChip(player *Player, buf []byte) error {
"uid": req.Uid, "uid": req.Uid,
}) })
G_GameLogicPtr.SetUserData(int(player.M_DwUin), VAR_OP_CHIP, -ChipNum) G_GameLogicPtr.SetUserData(int(player.M_DwUin), VAR_OP_CHIP_SET, len(PlayroomMod.ChipList))
player.PlayMod.save() player.PlayMod.save()
PlayroomBackData(player) PlayroomBackData(player)
player.PushClientRes(&msg.ResPlayroomChip{ player.PushClientRes(&msg.ResPlayroomChip{

View File

@ -89,4 +89,8 @@ func init() {
gob.Register(&msg.HandbookMsg{}) gob.Register(&msg.HandbookMsg{})
gob.Register(&limitedTimeEvent.CatTrick{}) gob.Register(&limitedTimeEvent.CatTrick{})
gob.Register(&VarOpration{}) gob.Register(&VarOpration{})
gob.Register(&VarUserData{})
gob.Register(&ActivityInfo{})
gob.Register(&ChargeExtra{})
gob.Register(&GameResult{})
} }

View File

@ -25,9 +25,10 @@ const (
) )
const ( const (
VAR_OP_UPVOTE = 1 VAR_OP_UPVOTE = 1
VAR_OP_CHIP = 2 VAR_OP_CHIP = 2
VAR_OP_KISS = 3 VAR_OP_KISS = 3
VAR_OP_CHIP_SET = 4
) )
func (f *VarMgr) Init() { func (f *VarMgr) Init() {