点赞优化
This commit is contained in:
parent
158b7a840a
commit
5354e1bca0
@ -3800,7 +3800,7 @@ func ReqPlayroomInteract(player *Player, buf []byte) error {
|
||||
return err
|
||||
}
|
||||
if GoUtil.InArray(int(req.Id), playroomCfg.GetInteractIdBath()) {
|
||||
player.SetPlayroomKiss(0)
|
||||
player.SetPlayroomKiss(0, int(player.M_DwUin))
|
||||
}
|
||||
PExp := playroomCfg.GetInteractPExp(int(req.Id))
|
||||
_, err = player.GetPlayerBaseMod().AddExp(player, 0, PExp)
|
||||
@ -4269,7 +4269,7 @@ func ReqPlayroomUpvote(player *Player, buf []byte) error {
|
||||
SendT: GoUtil.Now(),
|
||||
})
|
||||
player.AddPlayroomUpvote(int(req.Id))
|
||||
player.SetPlayroomKiss(1)
|
||||
player.SetPlayroomKiss(1, int(req.Id))
|
||||
player.TeLog("visit_like", map[string]interface{}{
|
||||
"user_id": req.Id,
|
||||
})
|
||||
|
||||
@ -51,9 +51,9 @@ func (p *Player) GetUserVarData(key string) interface{} {
|
||||
// return data.Extra
|
||||
// }
|
||||
|
||||
func (p *Player) OpVarDataAsync(key string, value interface{}, opType int) {
|
||||
func (p *Player) OpVarDataAsync(PlayerId int, key string, value interface{}, opType int) {
|
||||
SendMsgToCenterAsync(&msg.Msg{
|
||||
From: int(p.M_DwUin),
|
||||
From: PlayerId,
|
||||
HandleType: msg.HANDLE_MOD_USER_VAR_SET,
|
||||
Extra: msg.VarData{
|
||||
Key: key,
|
||||
@ -63,9 +63,9 @@ func (p *Player) OpVarDataAsync(key string, value interface{}, opType int) {
|
||||
})
|
||||
}
|
||||
|
||||
func (p *Player) OpVarDataSync(key string, value interface{}, opType int) (*msg.Msg, error) {
|
||||
func (p *Player) OpVarDataSync(PlayerId int, key string, value interface{}, opType int) (*msg.Msg, error) {
|
||||
return SendMsgToCenterSync(&msg.Msg{
|
||||
From: int(p.M_DwUin),
|
||||
From: PlayerId,
|
||||
HandleType: msg.HANDLE_MOD_USER_VAR_SET,
|
||||
Extra: msg.VarData{
|
||||
Key: key,
|
||||
@ -89,31 +89,28 @@ func (p *Player) OpServerVarDataSync(key string, Value interface{}, opType int)
|
||||
})
|
||||
}
|
||||
|
||||
func (p *Player) SetVarDataAsync(key string, value interface{}) {
|
||||
p.OpVarDataAsync(key, value, msg.VAR_OP_SET)
|
||||
func (p *Player) SetVarDataAsync(key string, value interface{}, PlayerId int) {
|
||||
p.OpVarDataAsync(PlayerId, key, value, msg.VAR_OP_SET)
|
||||
}
|
||||
|
||||
func (p *Player) AddVarDataAsync(key string) {
|
||||
p.OpVarDataAsync(key, nil, msg.VAR_OP_ADD)
|
||||
func (p *Player) AddVarDataAsync(key string, PlayerId int) {
|
||||
p.OpVarDataAsync(PlayerId, key, nil, msg.VAR_OP_ADD)
|
||||
}
|
||||
|
||||
func (p *Player) SubVarDataAsync(key string) {
|
||||
p.OpVarDataAsync(key, nil, msg.VAR_OP_SUB)
|
||||
func (p *Player) SubVarDataAsync(key string, PlayerId int) {
|
||||
p.OpVarDataAsync(PlayerId, key, nil, msg.VAR_OP_SUB)
|
||||
}
|
||||
|
||||
func (p *Player) AddPlayroomUpvote(PlayerId int) {
|
||||
newP := &Player{
|
||||
M_DwUin: int64(PlayerId),
|
||||
}
|
||||
newP.AddVarDataAsync(VAR_PLAYROOM_UPVOTE)
|
||||
p.AddVarDataAsync(VAR_PLAYROOM_UPVOTE, PlayerId)
|
||||
}
|
||||
|
||||
func (p *Player) AddPlayroomChip(PlayerId int) {
|
||||
p.AddVarDataAsync(VAR_PLAYROOM_CHIP)
|
||||
p.AddVarDataAsync(VAR_PLAYROOM_CHIP, PlayerId)
|
||||
}
|
||||
|
||||
func (p *Player) SubPlayroomChip(PlayerId int) {
|
||||
p.SubVarDataAsync(VAR_PLAYROOM_CHIP)
|
||||
p.SubVarDataAsync(VAR_PLAYROOM_CHIP, PlayerId)
|
||||
}
|
||||
|
||||
func (p *Player) GetPlayroomUpvote() int {
|
||||
@ -132,8 +129,8 @@ func (p *Player) GetPlayroomChip() int {
|
||||
return data.(int)
|
||||
}
|
||||
|
||||
func (p *Player) SetPlayroomKiss(Kiss int) {
|
||||
p.SetVarDataAsync(VAR_PLAYROOM_KISS, Kiss)
|
||||
func (p *Player) SetPlayroomKiss(Kiss int, PlayerId int) {
|
||||
p.SetVarDataAsync(VAR_PLAYROOM_KISS, Kiss, PlayerId)
|
||||
}
|
||||
|
||||
func (p *Player) GetPlayroomKiss() int {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user