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"
Name = "RobotGUI"
ID = "cc.legu.app"
Version = "1.2.15"
Build = 49
Version = "1.2.17"
Build = 50

View File

@ -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
}

View File

@ -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()},
)

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) {
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
}

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) {
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
}

View File

@ -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)
}

View File

@ -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("公会修改",

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.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)