This commit is contained in:
meixiongfeng 2023-03-16 19:16:50 +08:00
commit 283b7382c4
12 changed files with 80 additions and 60 deletions

View File

@ -180,6 +180,10 @@ func (this *SociatyMineView) CreateView(t *model.TestCase) fyne.CanvasObject {
return return
} }
if this.master == nil {
logrus.Errorf("会长数据是空,公会ID:%v", this.sociaty.Id)
return
}
//会长信息 //会长信息
pName := widget.NewEntry() pName := widget.NewEntry()
pName.Text = this.master.Name pName.Text = this.master.Name

View File

@ -427,6 +427,7 @@ func (this *modelDispatch) updateNotice(uid string, dispatch *pb.DBDispatch) err
} }
if nextConf != nil { if nextConf != nil {
dispatch.Nb.Lv++ dispatch.Nb.Lv++
dispatch.Nb.TaskCount = 0
} }
} }
//累计任务数 //累计任务数

View File

@ -30,6 +30,7 @@ func (this *apiComp) Expulsion(session comm.IUserSession, req *pb.PracticeExpuls
tconfigure *cfg.GamePandamasJxData tconfigure *cfg.GamePandamasJxData
pconfigure *cfg.GamePandamasJxData pconfigure *cfg.GamePandamasJxData
_session comm.IUserSession _session comm.IUserSession
minutes int32
filed string filed string
exp int32 exp int32
exp1 int32 exp1 int32
@ -66,10 +67,10 @@ func (this *apiComp) Expulsion(session comm.IUserSession, req *pb.PracticeExpuls
//计算经验收益 //计算经验收益
if configure.Now().After(time.Unix(pillar.Expend, 0)) { if configure.Now().After(time.Unix(pillar.Expend, 0)) {
minutes := int32(time.Unix(pillar.Expend, 0).Sub(time.Unix(pillar.Start, 0)).Minutes()) minutes = int32(time.Unix(pillar.Expend, 0).Sub(time.Unix(pillar.Start, 0)).Minutes())
exp = minutes * pillarconfigure.MinExp exp = minutes * pillarconfigure.MinExp
} else { } else {
minutes := int32(configure.Now().Sub(time.Unix(pillar.Start, 0)).Minutes()) minutes = int32(configure.Now().Sub(time.Unix(pillar.Start, 0)).Minutes())
exp = minutes * pillarconfigure.MinExp exp = minutes * pillarconfigure.MinExp
} }
exp1 += exp exp1 += exp
@ -83,7 +84,7 @@ func (this *apiComp) Expulsion(session comm.IUserSession, req *pb.PracticeExpuls
if hero, code := this.module.ModuleHero.GetHeroByObjID(session.GetUserId(), pillar.Hero); code == pb.ErrorCode_Success { if hero, code := this.module.ModuleHero.GetHeroByObjID(session.GetUserId(), pillar.Hero); code == pb.ErrorCode_Success {
if heroconf := this.module.configure.GetHeroConfig(hero.HeroID); heroconf != nil { if heroconf := this.module.configure.GetHeroConfig(hero.HeroID); heroconf != nil {
if (conf.Camp == 0 || (conf.Camp != 0 && heroconf.Race == conf.Camp)) && (conf.Occupation == 0 || (conf.Occupation != 0 && heroconf.Job == conf.Occupation)) { if (conf.Camp == 0 || (conf.Camp != 0 && heroconf.Race == conf.Camp)) && (conf.Occupation == 0 || (conf.Occupation != 0 && heroconf.Job == conf.Occupation)) {
exp1 += int32(math.Floor(float64(v/conf.Register) * float64(conf.ExpBonus) / float64(100) * float64(exp))) exp1 += minutes * int32(math.Floor(float64(v/conf.Register)*float64(conf.ExpBonus))) * exp
} }
} }
} }

View File

@ -29,6 +29,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR
pillarconfigure *cfg.GamePandamasMzData pillarconfigure *cfg.GamePandamasMzData
tconfigure *cfg.GamePandamasJxData tconfigure *cfg.GamePandamasJxData
pconfigure *cfg.GamePandamasJxData pconfigure *cfg.GamePandamasJxData
minutes int32
filed string filed string
exp int32 exp int32
exp1 int32 exp1 int32
@ -93,10 +94,10 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR
} }
//计算经验收益 //计算经验收益
if configure.Now().After(time.Unix(pillar.Expend, 0)) { if configure.Now().After(time.Unix(pillar.Expend, 0)) {
minutes := int32(time.Unix(pillar.Expend, 0).Sub(time.Unix(pillar.Start, 0)).Minutes()) minutes = int32(time.Unix(pillar.Expend, 0).Sub(time.Unix(pillar.Start, 0)).Minutes())
exp = minutes * pillarconfigure.MinExp exp = minutes * pillarconfigure.MinExp
} else { } else {
minutes := int32(configure.Now().Sub(time.Unix(pillar.Start, 0)).Minutes()) minutes = int32(configure.Now().Sub(time.Unix(pillar.Start, 0)).Minutes())
exp = minutes * pillarconfigure.MinExp exp = minutes * pillarconfigure.MinExp
} }
exp1 += exp exp1 += exp
@ -110,7 +111,8 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR
if hero, code := this.module.ModuleHero.GetHeroByObjID(session.GetUserId(), pillar.Hero); code == pb.ErrorCode_Success { if hero, code := this.module.ModuleHero.GetHeroByObjID(session.GetUserId(), pillar.Hero); code == pb.ErrorCode_Success {
if heroconf := this.module.configure.GetHeroConfig(hero.HeroID); heroconf != nil { if heroconf := this.module.configure.GetHeroConfig(hero.HeroID); heroconf != nil {
if (conf.Camp == 0 || (conf.Camp != 0 && heroconf.Race == conf.Camp)) && (conf.Occupation == 0 || (conf.Occupation != 0 && heroconf.Job == conf.Occupation)) { if (conf.Camp == 0 || (conf.Camp != 0 && heroconf.Race == conf.Camp)) && (conf.Occupation == 0 || (conf.Occupation != 0 && heroconf.Job == conf.Occupation)) {
exp1 += int32(math.Floor(float64(v/conf.Register) * float64(conf.ExpBonus) / float64(100) * float64(exp))) // exp1 += int32(math.Floor(float64(v/conf.Register) * float64(conf.ExpBonus) / float64(100) * float64(exp)))
exp1 += minutes * int32(math.Floor(float64(v/conf.Register)*float64(conf.ExpBonus))) * exp
} }
} }
} }

View File

@ -49,10 +49,10 @@ func (this *apiComp) Get(session comm.IUserSession, req *pb.ReddotGetReq) (code
for k, v := range this.module.arena.Reddot(session, _rid) { for k, v := range this.module.arena.Reddot(session, _rid) {
reddot[int32(k)] = v reddot[int32(k)] = v
} }
case comm.Reddot23, comm.Reddot24, comm.Reddot25: // case comm.Reddot23, comm.Reddot24, comm.Reddot25:
for k, v := range this.module.martialhall.Reddot(session, _rid) { // for k, v := range this.module.martialhall.Reddot(session, _rid) {
reddot[int32(k)] = v // reddot[int32(k)] = v
} // }
case comm.Reddot20, comm.Reddot21, comm.Reddot22: case comm.Reddot20, comm.Reddot21, comm.Reddot22:
for k, v := range this.module.gourmet.Reddot(session, _rid) { for k, v := range this.module.gourmet.Reddot(session, _rid) {
reddot[int32(k)] = v reddot[int32(k)] = v

View File

@ -34,9 +34,9 @@ func (this *apiComp) GetAll(session comm.IUserSession, req *pb.ReddotGetAllReq)
for k, v := range this.module.horoscope.Reddot(session, comm.Reddot17) { for k, v := range this.module.horoscope.Reddot(session, comm.Reddot17) {
reddot[int32(k)] = v reddot[int32(k)] = v
} }
for k, v := range this.module.martialhall.Reddot(session, comm.Reddot23, comm.Reddot24, comm.Reddot25) { // for k, v := range this.module.martialhall.Reddot(session, comm.Reddot23, comm.Reddot24, comm.Reddot25) {
reddot[int32(k)] = v // reddot[int32(k)] = v
} // }
for k, v := range this.module.arena.Reddot(session, comm.Reddot19) { for k, v := range this.module.arena.Reddot(session, comm.Reddot19) {
reddot[int32(k)] = v reddot[int32(k)] = v
} }

View File

@ -22,7 +22,7 @@ type Reddot struct {
service base.IRPCXService service base.IRPCXService
pagoda comm.IPagoda pagoda comm.IPagoda
martialhall comm.IMartialhall // martialhall comm.IMartialhall
horoscope comm.IHoroscope horoscope comm.IHoroscope
arena comm.IArena arena comm.IArena
gourmet comm.IGourmet gourmet comm.IGourmet
@ -56,10 +56,10 @@ func (this *Reddot) Start() (err error) {
return return
} }
this.pagoda = module.(comm.IPagoda) this.pagoda = module.(comm.IPagoda)
if module, err = this.service.GetModule(comm.ModuleMartialhall); err != nil { // if module, err = this.service.GetModule(comm.ModuleMartialhall); err != nil {
return // return
} // }
this.martialhall = module.(comm.IMartialhall) // this.martialhall = module.(comm.IMartialhall)
if module, err = this.service.GetModule(comm.ModuleHoroscope); err != nil { if module, err = this.service.GetModule(comm.ModuleHoroscope); err != nil {
return return
} }

View File

@ -45,12 +45,19 @@ func (this *ModelSession) getUserSession(uid string) (user *pb.CacheUser) {
// 设置用户session // 设置用户session
func (this *ModelSession) addUserSession(uid string, session comm.IUserSession) (err error) { func (this *ModelSession) addUserSession(uid string, session comm.IUserSession) (err error) {
if err = this.AddList(comm.RDS_EMPTY, uid, map[string]interface{}{ // if err = this.AddList(comm.RDS_EMPTY, uid, map[string]interface{}{
"uid": uid, // "uid": uid,
"sessionId": session.GetSessionId(), // "sessionId": session.GetSessionId(),
"serviceTag": session.GetServiecTag(), // "serviceTag": session.GetServiecTag(),
"gatewayServiceId": session.GetGatewayServiceId(), // "gatewayServiceId": session.GetGatewayServiceId(),
"ip": session.GetIP(), // "ip": session.GetIP(),
// }, db.SetDBMgoLog(false)); err != nil {
if err = this.AddList(comm.RDS_EMPTY, uid, &pb.CacheUser{
Uid: uid,
SessionId: session.GetSessionId(),
ServiceTag: session.GetServiecTag(),
GatewayServiceId: session.GetGatewayServiceId(),
Ip: session.GetIP(),
}, db.SetDBMgoLog(false)); err != nil { }, db.SetDBMgoLog(false)); err != nil {
log.Debug("setUserSession err:%v", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err}) log.Debug("setUserSession err:%v", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err})
return return

View File

@ -110,7 +110,7 @@ func (this *User) GetUser(uid string) (user *pb.DBUser) {
if this.IsCross() { if this.IsCross() {
user, err = this.getRemoteUser(uid) user, err = this.getRemoteUser(uid)
if err != nil { if err != nil {
this.Errorln("查询远程玩家信息", err) this.Errorf("查询远程玩家信息 tag:%v err:%v", this.service.GetTag(), err)
return nil return nil
} }
} else { } else {

View File

@ -196,12 +196,19 @@ func (this *SCompGateRoute) NoticeUserLogin(ctx context.Context, args *pb.Notice
return err return err
} }
model := db.NewDBModel(comm.TableSession, 0, conn) model := db.NewDBModel(comm.TableSession, 0, conn)
model.AddList(comm.RDS_EMPTY, args.UserId, map[string]interface{}{ // model.AddList(comm.RDS_EMPTY, args.UserId, map[string]interface{}{
"uid": args.UserId, // "uid": args.UserId,
"sessionId": args.UserSessionId, // "sessionId": args.UserSessionId,
"serviceTag": args.ServiceTag, // "serviceTag": args.ServiceTag,
"gatewayServiceId": args.GatewayServiceId, // "gatewayServiceId": args.GatewayServiceId,
"ip": args.Ip, // "ip": args.Ip,
// }, db.SetDBMgoLog(false))
model.AddList(comm.RDS_EMPTY, args.UserId, &pb.CacheUser{
Uid: args.UserId,
SessionId: args.UserSessionId,
ServiceTag: args.ServiceTag,
GatewayServiceId: args.GatewayServiceId,
Ip: args.Ip,
}, db.SetDBMgoLog(false)) }, db.SetDBMgoLog(false))
session := this.pools.Get().(comm.IUserSession) session := this.pools.Get().(comm.IUserSession)
session.SetSession(args.Ip, args.UserSessionId, args.ServiceTag, args.GatewayServiceId, args.UserId) session.SetSession(args.Ip, args.UserSessionId, args.ServiceTag, args.GatewayServiceId, args.UserId)

View File

@ -24,7 +24,6 @@ import (
"go_dreamfactory/modules/library" "go_dreamfactory/modules/library"
"go_dreamfactory/modules/linestory" "go_dreamfactory/modules/linestory"
"go_dreamfactory/modules/mail" "go_dreamfactory/modules/mail"
"go_dreamfactory/modules/martialhall"
"go_dreamfactory/modules/mline" "go_dreamfactory/modules/mline"
"go_dreamfactory/modules/moonfantasy" "go_dreamfactory/modules/moonfantasy"
"go_dreamfactory/modules/notify" "go_dreamfactory/modules/notify"
@ -90,7 +89,7 @@ func main() {
forum.NewModule(), forum.NewModule(),
pagoda.NewModule(), pagoda.NewModule(),
gourmet.NewModule(), gourmet.NewModule(),
martialhall.NewModule(), // martialhall.NewModule(),
rtask.NewModule(), rtask.NewModule(),
viking.NewModule(), viking.NewModule(),
smithy.NewModule(), smithy.NewModule(),

View File

@ -175,7 +175,6 @@ func (this *DB) ServerDBConn(stage string) (conn *DBConn, err error) {
if !ok { if !ok {
err = fmt.Errorf("DBConn:%s on init", stage) err = fmt.Errorf("DBConn:%s on init", stage)
} }
log.Debug("servers", log.Field{Key: stage, Value: this.servers[stage]})
return return
} }