猴拳结算结果做异或操作

This commit is contained in:
meixiongfeng 2023-12-13 09:52:06 +08:00
parent 7e1c0cdb51
commit c3ff4f2f65
2 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ type apiComp struct {
module *Dispatch module *Dispatch
} }
func(this *apiComp) Init(service core.IService, module core.IModule,comp core.IModuleComp, options core.IModuleOptions) (err error){ func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
_ = this.MCompGate.Init(service, module, comp, options) _ = this.MCompGate.Init(service, module, comp, options)
this.module = module.(*Dispatch) this.module = module.(*Dispatch)
return return

View File

@ -52,11 +52,11 @@ func (this *apiComp) UpdateStar(session comm.IUserSession, req *pb.MonkeyUpdateS
req.Stage: req.Star, req.Stage: req.Star,
}, },
} }
update["data"] = info.Data update["data"] = info.Data
} else { } else {
if info.Data[conf.Chapter].Award[req.Stage] != req.Star { if info.Data[conf.Chapter].Award[req.Stage] != req.Star {
info.Data[conf.Chapter].Award[req.Stage] = req.Star curStar := info.Data[conf.Chapter].Award[req.Stage] // 当前的星
info.Data[conf.Chapter].Award[req.Stage] = (req.Star ^ curStar) // 做异或操作
update["data"] = info.Data update["data"] = info.Data
} }
} }