by default, the server only expect udp on 51000 and 51001; let's keep to that by default (#1209)

This commit is contained in:
Fate-JH 2024-07-02 13:01:35 -04:00 committed by GitHub
parent 6d1530c311
commit 5990f247c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 8 deletions

View file

@ -20,7 +20,7 @@ login {
world { world {
# UDP listening port # UDP listening port
port = 51001 port = 51001
ports = [51003, 51004, 51005, 51006, 51007, 51008, 51009, 51010] ports = []
# The name of the server as displayed in the server browser. # The name of the server as displayed in the server browser.
server-name = PSForever server-name = PSForever

View file

@ -27,11 +27,11 @@ import scala.concurrent.duration._
import scala.util.matching.Regex import scala.util.matching.Regex
import scala.util.{Failure, Success} import scala.util.{Failure, Success}
object LoginActor { object LoginActor {
sealed trait Command sealed trait Command
private case object UpdateServerList extends Command
final case class ReceptionistListing(listing: Receptionist.Listing) extends Command final case class ReceptionistListing(listing: Receptionist.Listing) extends Command
} }
@ -41,8 +41,6 @@ class LoginActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], conne
import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.ExecutionContext.Implicits.global
private case class UpdateServerList()
val usernameRegex: Regex = """[A-Za-z0-9]{3,}""".r val usernameRegex: Regex = """[A-Za-z0-9]{3,}""".r
var leftRef: ActorRef = Default.Actor var leftRef: ActorRef = Default.Actor
@ -83,7 +81,7 @@ class LoginActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], conne
canonicalHostName = address.CanonicalHostName canonicalHostName = address.CanonicalHostName
port = address.Port port = address.Port
case UpdateServerList() => case LoginActor.UpdateServerList =>
updateServerList() updateServerList()
case packet: PlanetSideGamePacket => case packet: PlanetSideGamePacket =>
@ -213,7 +211,7 @@ class LoginActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], conne
} }
loginSuccessfulResponse(username, newToken) loginSuccessfulResponse(username, newToken)
updateServerListTask = updateServerListTask =
context.system.scheduler.scheduleWithFixedDelay(0 seconds, 5 seconds, self, UpdateServerList()) context.system.scheduler.scheduleWithFixedDelay(0 seconds, 5 seconds, self, LoginActor.UpdateServerList)
future future
case (_, false) => case (_, false) =>
@ -271,7 +269,7 @@ class LoginActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], conne
) )
loginSuccessfulResponseToken(account.username, token, newToken) loginSuccessfulResponseToken(account.username, token, newToken)
updateServerListTask = updateServerListTask =
context.system.scheduler.scheduleWithFixedDelay(0 seconds, 5 seconds, self, UpdateServerList()) context.system.scheduler.scheduleWithFixedDelay(0 seconds, 5 seconds, self, LoginActor.UpdateServerList)
future future
case (_, false) => case (_, false) =>