This commit is contained in:
@@ -92,28 +92,8 @@ func JoinPeakQueue(p *player.Player, requestedMode uint32) errorcode.ErrorCode {
|
||||
return err
|
||||
}
|
||||
|
||||
m := Default()
|
||||
runtimeServerID := localRuntimeServerID()
|
||||
ticket := &localQueueTicket{
|
||||
playerID: p.Info.UserID,
|
||||
runtimeServerID: runtimeServerID,
|
||||
fightMode: fightMode,
|
||||
status: status,
|
||||
stop: make(chan struct{}),
|
||||
}
|
||||
|
||||
m.mu.Lock()
|
||||
if old := m.localQueues[p.Info.UserID]; old != nil {
|
||||
old.Stop()
|
||||
}
|
||||
m.localQueues[p.Info.UserID] = ticket
|
||||
delete(m.userSession, p.Info.UserID)
|
||||
m.mu.Unlock()
|
||||
|
||||
p.Fightinfo.Mode = fightMode
|
||||
p.Fightinfo.Status = status
|
||||
|
||||
go m.queueHeartbeatLoop(p, ticket)
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -129,15 +109,19 @@ func CancelPeakQueue(p *player.Player) {
|
||||
m.mu.Unlock()
|
||||
if ticket != nil {
|
||||
ticket.Stop()
|
||||
_ = publishServerMessage(pvpwire.CoordinatorTopicPrefix, pvpwire.MessageTypeQueueCancel, pvpwire.QueueCancelPayload{
|
||||
RuntimeServerID: ticket.runtimeServerID,
|
||||
UserID: ticket.playerID,
|
||||
})
|
||||
}
|
||||
atomic.StoreUint32(&p.Fightinfo.Mode, 0)
|
||||
atomic.StoreUint32(&p.Fightinfo.Status, 0)
|
||||
}
|
||||
|
||||
func NormalizePeakMode(requested uint32) (fightMode uint32, status uint32, err errorcode.ErrorCode) {
|
||||
return normalizePeakMode(requested)
|
||||
}
|
||||
|
||||
func AvailableCatchTimes(pets []model.PetInfo) []uint32 {
|
||||
return filterAvailableCatchTimes(pets)
|
||||
}
|
||||
|
||||
func SubmitBanPick(p *player.Player, selected, banned []uint32) errorcode.ErrorCode {
|
||||
if p == nil {
|
||||
return errorcode.ErrorCodes.ErrSystemBusyTryLater
|
||||
|
||||
Reference in New Issue
Block a user