Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
82f1f44917
@ -40,7 +40,7 @@ type Selector struct {
|
|||||||
updateServerEvent func(map[string]*ServiceNode)
|
updateServerEvent func(map[string]*ServiceNode)
|
||||||
servers map[string]*ServiceNode
|
servers map[string]*ServiceNode
|
||||||
serversType map[string][]*ServiceNode
|
serversType map[string][]*ServiceNode
|
||||||
lock sync.Mutex
|
lock sync.RWMutex
|
||||||
i map[string]int
|
i map[string]int
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +51,9 @@ func (this *Selector) Select(ctx context.Context, servicePath, serviceMethod str
|
|||||||
leng := len(service)
|
leng := len(service)
|
||||||
if leng == 1 {
|
if leng == 1 {
|
||||||
if nodes, ok := this.serversType[service[0]]; ok {
|
if nodes, ok := this.serversType[service[0]]; ok {
|
||||||
|
this.lock.RLock()
|
||||||
i, ok := this.i[service[0]]
|
i, ok := this.i[service[0]]
|
||||||
|
this.lock.RUnlock()
|
||||||
if !ok {
|
if !ok {
|
||||||
i = 0
|
i = 0
|
||||||
}
|
}
|
||||||
|
@ -132,6 +132,6 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.PracticeAcceptReq
|
|||||||
this.module.SendMsgToUser(string(this.module.GetType()), "qiecuonotify",
|
this.module.SendMsgToUser(string(this.module.GetType()), "qiecuonotify",
|
||||||
&pb.PracticeQiecuonotifyPush{Uid: session.GetUserId(), NotifyType: 2}, req.Uid)
|
&pb.PracticeQiecuonotifyPush{Uid: session.GetUserId(), NotifyType: 2}, req.Uid)
|
||||||
_session, _ := this.module.GetUserSession(req.Uid)
|
_session, _ := this.module.GetUserSession(req.Uid)
|
||||||
go this.module.ModuleBuried.TriggerBuried(_session, comm.GetBuriedParam(comm.Rtype183, 1))
|
go this.module.ModuleBuried.TriggerBuried(_session.Clone(), comm.GetBuriedParam(comm.Rtype183, 1))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (errdata
|
|||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_DBError,
|
Code: pb.ErrorCode_DBError,
|
||||||
Title: pb.ErrorCode_DBError.ToString(),
|
Title: pb.ErrorCode_DBError.ToString(),
|
||||||
Message: err.Error(),
|
Message: "no found shop !",
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtla
|
|||||||
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype165, 1))
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype165, 1))
|
||||||
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype166, int32(len(atlas.Collect))))
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype166, int32(len(atlas.Collect))))
|
||||||
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype167, atlas.Score))
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype167, atlas.Score))
|
||||||
this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
|
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
|
||||||
session.SendMsg(string(this.module.GetType()), "atlasactivate", &pb.SmithyAtlasActivateResp{Data: atlas})
|
session.SendMsg(string(this.module.GetType()), "atlasactivate", &pb.SmithyAtlasActivateResp{Data: atlas})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -295,7 +295,7 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
|||||||
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype177, 1))
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype177, 1))
|
||||||
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype179, 1, nextProficiency.Value1))
|
szTask = append(szTask, comm.GetBuriedParam(comm.Rtype179, 1, nextProficiency.Value1))
|
||||||
|
|
||||||
this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
|
go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...)
|
||||||
}
|
}
|
||||||
// 是否解锁新套装
|
// 是否解锁新套装
|
||||||
if nextProficiency.Type == comm.SmithyReelType4 {
|
if nextProficiency.Type == comm.SmithyReelType4 {
|
||||||
@ -348,7 +348,7 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
|||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype189, req.Count)) // 进行N次定制打造
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype189, req.Count)) // 进行N次定制打造
|
||||||
}
|
}
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype148, req.Count))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype148, req.Count))
|
||||||
this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
|
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ func (this *apiComp) Rise(session comm.IUserSession, req *pb.SmithyRiseReq) (err
|
|||||||
}
|
}
|
||||||
tasks := make([]*pb.BuriedParam, 0)
|
tasks := make([]*pb.BuriedParam, 0)
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype175, stove.Temperature))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype175, stove.Temperature))
|
||||||
this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
|
go this.module.ModuleBuried.TriggerBuried(session.Clone(), tasks...)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user