refactor: 优化玩家信息处理和注册检查逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
移除不必要的IsReg方法,简化玩家信息获取流程 调整抢先服玩家登录时间检查逻辑
This commit is contained in:
@@ -61,16 +61,16 @@ func (c *BaseSysUserController) GetSession(ctx context.Context, req *SessionReq)
|
||||
}
|
||||
|
||||
res = &SessionRes{}
|
||||
|
||||
|
||||
t1 := service.NewBaseSysUserService().GetPerson(uint32(t.UserId))
|
||||
|
||||
res.UserID = int(t1.ID)
|
||||
playerinfo := blazing.NewUserService(uint32(t1.ID))
|
||||
if playerinfo.Info.IsReg() {
|
||||
playerinfo := blazing.NewUserService(uint32(t1.ID)).Info.Person(uint32(t1.ID))
|
||||
if playerinfo != nil {
|
||||
res.IsReg = 1
|
||||
if t1.DepartmentID == 35 { ///抢先服玩家,3天没登录衰退
|
||||
r := playerinfo.Info.Person(uint32(t1.ID))
|
||||
if r.UpdateTime.AddDate(0, 0, 3).Before(gtime.Now()) {
|
||||
|
||||
if playerinfo.UpdateTime.AddDate(0, 0, 3).Before(gtime.Now()) {
|
||||
t1.DepartmentID = 1
|
||||
service.NewBaseSysUserService().SetdepartmentId(uint32(t1.ID), 1)
|
||||
}
|
||||
|
||||
@@ -20,15 +20,6 @@ import (
|
||||
csmap "github.com/mhmtszr/concurrent-swiss-map"
|
||||
)
|
||||
|
||||
func (s *InfoService) IsReg() bool {
|
||||
|
||||
m := s.dbm_fix(s.Model)
|
||||
|
||||
record, _ := m.Exist()
|
||||
|
||||
return record
|
||||
}
|
||||
|
||||
// 是否注册,如果注册过,那么就会产生用户player信息
|
||||
|
||||
// 实现注册,id+昵称+颜色
|
||||
|
||||
Reference in New Issue
Block a user