mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 15:34:38 +01:00
fix enumerate client and handle type L stages
This commit is contained in:
@@ -24,7 +24,11 @@ func handleMsgSysEnumerateClient(s *Session, p mhfpacket.MHFPacket) {
|
||||
resp := byteframe.NewByteFrame()
|
||||
stage.RLock()
|
||||
var clients []uint32
|
||||
switch pkt.Unk1 {
|
||||
switch pkt.Get {
|
||||
case 0: // All
|
||||
for _, cid := range stage.clients {
|
||||
clients = append(clients, cid)
|
||||
}
|
||||
case 1: // Not ready
|
||||
for cid, ready := range stage.reservedClientSlots {
|
||||
if !ready {
|
||||
|
||||
@@ -121,7 +121,7 @@ func destructEmptyStages(s *Session) {
|
||||
defer s.server.Unlock()
|
||||
for _, stage := range s.server.stages {
|
||||
// Destroy empty Quest/My series/Guild stages.
|
||||
if stage.id[3:5] == "Qs" || stage.id[3:5] == "Ms" || stage.id[3:5] == "Gs" {
|
||||
if stage.id[3:5] == "Qs" || stage.id[3:5] == "Ms" || stage.id[3:5] == "Gs" || stage.id[3:5] == "Ls" {
|
||||
if len(stage.reservedClientSlots) == 0 && len(stage.clients) == 0 {
|
||||
delete(s.server.stages, stage.id)
|
||||
s.logger.Debug("Destructed stage", zap.String("stage.id", stage.id))
|
||||
@@ -367,7 +367,7 @@ func handleMsgSysEnumerateStage(s *Session, p mhfpacket.MHFPacket) {
|
||||
}
|
||||
|
||||
// Check for valid stage type
|
||||
if sid[3:5] != "Qs" && sid[3:5] != "Ms" {
|
||||
if sid[3:5] != "Qs" && sid[3:5] != "Ms" && sid[3:5] != "Ls" {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user