Skip to content

Commit

Permalink
by default, the server only expect udp on 51000 and 51001; let's keep…
Browse files Browse the repository at this point in the history
… to that by default
  • Loading branch information
Fate-JH committed Jul 2, 2024
1 parent 6d1530c commit 0455226
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ login {
world {
# UDP listening port
port = 51001
ports = [51003, 51004, 51005, 51006, 51007, 51008, 51009, 51010]
ports = []

# The name of the server as displayed in the server browser.
server-name = PSForever
Expand Down
12 changes: 5 additions & 7 deletions src/main/scala/net/psforever/actors/net/LoginActor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import scala.concurrent.duration._
import scala.util.matching.Regex
import scala.util.{Failure, Success}



object LoginActor {
sealed trait Command

private case object UpdateServerList extends Command

final case class ReceptionistListing(listing: Receptionist.Listing) extends Command
}

Expand All @@ -41,8 +41,6 @@ class LoginActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], conne

import scala.concurrent.ExecutionContext.Implicits.global

private case class UpdateServerList()

val usernameRegex: Regex = """[A-Za-z0-9]{3,}""".r

var leftRef: ActorRef = Default.Actor
Expand Down Expand Up @@ -83,7 +81,7 @@ class LoginActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], conne
canonicalHostName = address.CanonicalHostName
port = address.Port

case UpdateServerList() =>
case LoginActor.UpdateServerList =>
updateServerList()

case packet: PlanetSideGamePacket =>
Expand Down Expand Up @@ -213,7 +211,7 @@ class LoginActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], conne
}
loginSuccessfulResponse(username, newToken)
updateServerListTask =
context.system.scheduler.scheduleWithFixedDelay(0 seconds, 5 seconds, self, UpdateServerList())
context.system.scheduler.scheduleWithFixedDelay(0 seconds, 5 seconds, self, LoginActor.UpdateServerList)
future

case (_, false) =>
Expand Down Expand Up @@ -271,7 +269,7 @@ class LoginActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], conne
)
loginSuccessfulResponseToken(account.username, token, newToken)
updateServerListTask =
context.system.scheduler.scheduleWithFixedDelay(0 seconds, 5 seconds, self, UpdateServerList())
context.system.scheduler.scheduleWithFixedDelay(0 seconds, 5 seconds, self, LoginActor.UpdateServerList)
future

case (_, false) =>
Expand Down

0 comments on commit 0455226

Please sign in to comment.