diff --git a/cmd/v2/FyneApp.toml b/cmd/v2/FyneApp.toml index 7444f50c4..bf714e5e9 100644 --- a/cmd/v2/FyneApp.toml +++ b/cmd/v2/FyneApp.toml @@ -4,5 +4,5 @@ Website = "http://legu.cc" Icon = "app.png" Name = "RobotGUI" ID = "cc.legu.app" - Version = "1.2.15" - Build = 49 + Version = "1.2.17" + Build = 50 diff --git a/cmd/v2/ui/mainwindow.go b/cmd/v2/ui/mainwindow.go index 156142df4..1f6b26b99 100644 --- a/cmd/v2/ui/mainwindow.go +++ b/cmd/v2/ui/mainwindow.go @@ -55,6 +55,7 @@ func NewMainWindow(ui *UIImpl, parent fyne.Window) MainWindow { ui.obs.AddListener(observer.EVENT_PING, observer.Listener{ OnNotify: func(data interface{}, args ...interface{}) { + ui.obs.Remove(observer.EVENT_PING) logrus.Debug("即将与服务器断开链接") conf := dialog.NewConfirm("链接中断", data.(error).Error(), func( b bool) { @@ -65,6 +66,7 @@ func NewMainWindow(ui *UIImpl, parent fyne.Window) MainWindow { conf.Show() }, }) + return mw } diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index 9db3b14ad..7727988be 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -321,15 +321,15 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) (err error) { } stime := time.Now() // this.gateway.Debugf("----------3 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) - ctx, _ := context.WithTimeout(context.Background(), time.Second*5) - // ctx := context.Background() + // ctx, _ := context.WithTimeout(context.Background(), time.Second*5) + ctx := context.Background() if len(serviceTag) == 0 { // this.gateway.Debugf("----------4 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) if err = this.gateway.Service().RpcCall(ctx, servicePath, string(comm.Rpc_GatewayRoute), req, reply); err != nil { this.gateway.Error("[UserResponse]", log.Field{Key: "uid", Value: this.uId}, log.Field{Key: "serviceTag", Value: serviceTag}, - log.Field{Key: "servicePath", Value: servicePath}, + log.Field{Key: "servicePath", Value: servicePath}, log.Field{Key: "req", Value: fmt.Sprintf("%s:%s %v", req.MainType, req.SubType, req.Message.String())}, log.Field{Key: "err", Value: err.Error()}, ) diff --git a/modules/sociaty/api_cross_apply.go b/modules/sociaty/api_cross_apply.go index debae6de7..677568ed8 100644 --- a/modules/sociaty/api_cross_apply.go +++ b/modules/sociaty/api_cross_apply.go @@ -21,9 +21,6 @@ func (this *apiComp) ApplyCheck(session comm.IUserSession, req *pb.SociatyApplyR } func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (code pb.ErrorCode, data proto.Message) { - if code = this.module.ModuleSys.IsAccess(comm.Guild, session.GetUserId()); code != pb.ErrorCode_Success { - return - } if code = this.ApplyCheck(session, req); code != pb.ErrorCode_Success { return } diff --git a/modules/sociaty/api_cross_create.go b/modules/sociaty/api_cross_create.go index 7ca0abe18..15e008564 100644 --- a/modules/sociaty/api_cross_create.go +++ b/modules/sociaty/api_cross_create.go @@ -24,9 +24,6 @@ func (this *apiComp) CreateCheck(session comm.IUserSession, req *pb.SociatyCreat } func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq) (code pb.ErrorCode, data proto.Message) { - if code = this.module.ModuleSys.IsAccess(comm.Guild, session.GetUserId()); code != pb.ErrorCode_Success { - return - } if code = this.CreateCheck(session, req); code != pb.ErrorCode_Success { return } diff --git a/modules/sociaty/api_cross_search.go b/modules/sociaty/api_cross_search.go index 30c611008..9eb9d83f9 100644 --- a/modules/sociaty/api_cross_search.go +++ b/modules/sociaty/api_cross_search.go @@ -24,7 +24,7 @@ func (this *apiComp) Search(session comm.IUserSession, req *pb.SociatySearchReq) rsp := &pb.SociatySearchResp{} sociaty := this.module.modelSociaty.findByName(req.Name) - if sociaty == nil { + if sociaty != nil { rsp.List = append(rsp.List, sociaty) } diff --git a/modules/sociaty/api_cross_setting.go b/modules/sociaty/api_cross_setting.go index 3937ea86e..01dc758dc 100644 --- a/modules/sociaty/api_cross_setting.go +++ b/modules/sociaty/api_cross_setting.go @@ -11,7 +11,7 @@ import ( // 公会设置 func (this *apiComp) SettingCheck(session comm.IUserSession, req *pb.SociatySettingReq) (code pb.ErrorCode) { - if req.ApplyLv == 0 || req.Icon == "" { + if len(req.Notice) > 150 || req.ApplyLv == 0 || req.Icon == "" { code = pb.ErrorCode_ReqParameterError this.module.Error("公会设置参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) } @@ -25,7 +25,7 @@ func (this *apiComp) Setting(session comm.IUserSession, req *pb.SociatySettingRe uid := session.GetUserId() sociaty := this.module.modelSociaty.getUserSociaty(uid) - if sociaty == nil { + if sociaty == nil { code = pb.ErrorCode_SociatyNoFound this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid}) return @@ -43,7 +43,7 @@ func (this *apiComp) Setting(session comm.IUserSession, req *pb.SociatySettingRe sociaty.IsApplyCheck = req.IsApplyCheck sociaty.ApplyLv = req.ApplyLv - // 设置 + // 更新设置 if err := this.module.modelSociaty.setting(sociaty); err != nil { code = pb.ErrorCode_SociatySetting this.module.Error("公会修改", diff --git a/modules/user/api_login.go b/modules/user/api_login.go index 66f49f5e1..e6a4ee288 100644 --- a/modules/user/api_login.go +++ b/modules/user/api_login.go @@ -110,14 +110,6 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod this.module.ModuleHero.NoLoginDay(user.Uid, int32(utils.DiffDays(lastLoginTime, configure.Now().Unix()))) this.module.modelExpand.updateLoginDay(user.Uid, lastLoginTime) - //清空日常 - this.module.ModuleTask.ResetTask(user.Uid, comm.TASK_DAILY) - this.module.ModuleTask.InitTaskByTag(user.Uid, comm.TASK_DAILY) - //清周常 - if utils.IsAfterWeek(lastLoginTime) { - this.module.ModuleTask.ResetTask(user.Uid, comm.TASK_WEEKLY) - this.module.ModuleTask.InitTaskByTag(user.Uid, comm.TASK_WEEKLY) - } // 清理点赞 this.module.ModuleFriend.ResetFriend(user.Uid) this.module.modelSign.UserSign(session)