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