This commit is contained in:
wh_zcy 2023-04-12 17:02:52 +08:00
parent 5e26c30c53
commit 1e32d18a54
8 changed files with 11 additions and 23 deletions

View File

@ -4,5 +4,5 @@ Website = "http://legu.cc"
Icon = "app.png" Icon = "app.png"
Name = "RobotGUI" Name = "RobotGUI"
ID = "cc.legu.app" ID = "cc.legu.app"
Version = "1.2.15" Version = "1.2.17"
Build = 49 Build = 50

View File

@ -55,6 +55,7 @@ func NewMainWindow(ui *UIImpl, parent fyne.Window) MainWindow {
ui.obs.AddListener(observer.EVENT_PING, observer.Listener{ ui.obs.AddListener(observer.EVENT_PING, observer.Listener{
OnNotify: func(data interface{}, args ...interface{}) { OnNotify: func(data interface{}, args ...interface{}) {
ui.obs.Remove(observer.EVENT_PING)
logrus.Debug("即将与服务器断开链接") logrus.Debug("即将与服务器断开链接")
conf := dialog.NewConfirm("链接中断", data.(error).Error(), func( conf := dialog.NewConfirm("链接中断", data.(error).Error(), func(
b bool) { b bool) {
@ -65,6 +66,7 @@ func NewMainWindow(ui *UIImpl, parent fyne.Window) MainWindow {
conf.Show() conf.Show()
}, },
}) })
return mw return mw
} }

View File

@ -321,8 +321,8 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) (err error) {
} }
stime := time.Now() stime := time.Now()
// this.gateway.Debugf("----------3 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) // 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.WithTimeout(context.Background(), time.Second*5)
// ctx := context.Background() ctx := context.Background()
if len(serviceTag) == 0 { if len(serviceTag) == 0 {
// this.gateway.Debugf("----------4 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) // 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 { if err = this.gateway.Service().RpcCall(ctx, servicePath, string(comm.Rpc_GatewayRoute), req, reply); err != nil {

View File

@ -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) { 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 { if code = this.ApplyCheck(session, req); code != pb.ErrorCode_Success {
return return
} }

View File

@ -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) { 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 { if code = this.CreateCheck(session, req); code != pb.ErrorCode_Success {
return return
} }

View File

@ -24,7 +24,7 @@ func (this *apiComp) Search(session comm.IUserSession, req *pb.SociatySearchReq)
rsp := &pb.SociatySearchResp{} rsp := &pb.SociatySearchResp{}
sociaty := this.module.modelSociaty.findByName(req.Name) sociaty := this.module.modelSociaty.findByName(req.Name)
if sociaty == nil { if sociaty != nil {
rsp.List = append(rsp.List, sociaty) rsp.List = append(rsp.List, sociaty)
} }

View File

@ -11,7 +11,7 @@ import (
// 公会设置 // 公会设置
func (this *apiComp) SettingCheck(session comm.IUserSession, req *pb.SociatySettingReq) (code pb.ErrorCode) { 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 code = pb.ErrorCode_ReqParameterError
this.module.Error("公会设置参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) this.module.Error("公会设置参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()})
} }
@ -43,7 +43,7 @@ func (this *apiComp) Setting(session comm.IUserSession, req *pb.SociatySettingRe
sociaty.IsApplyCheck = req.IsApplyCheck sociaty.IsApplyCheck = req.IsApplyCheck
sociaty.ApplyLv = req.ApplyLv sociaty.ApplyLv = req.ApplyLv
// 设置 // 更新设置
if err := this.module.modelSociaty.setting(sociaty); err != nil { if err := this.module.modelSociaty.setting(sociaty); err != nil {
code = pb.ErrorCode_SociatySetting code = pb.ErrorCode_SociatySetting
this.module.Error("公会修改", this.module.Error("公会修改",

View File

@ -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.ModuleHero.NoLoginDay(user.Uid, int32(utils.DiffDays(lastLoginTime, configure.Now().Unix())))
this.module.modelExpand.updateLoginDay(user.Uid, lastLoginTime) 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.ModuleFriend.ResetFriend(user.Uid)
this.module.modelSign.UserSign(session) this.module.modelSign.UserSign(session)