PSF-LoginServer/server/src/test/scala/PacketCodingActorTest.scala

892 lines
42 KiB
Scala
Raw Normal View History

Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
package net.psforever.pslogin
Networking The game uses a UDP-based protocol. Unlike TCP, UDP does not guarantee that packets arrive, or that they arrive in the correct order. For this reason, the game protocol implements those features using the following: * All packets have a sequence number that is utilized for reordering * Important packets are wrapped in a SlottedMetaPacket with a subslot number * RelatedA packets ae used to request lost packets using the subslot number * RelatedB packets are used to confirm received SlottedMetaPackets All of these go both ways, server <-> client. We used to only partially implement these features: Outgoing packet bundles used SMPs and could be resent, but not all packets were bundled and there was no logic for requesting lost packets from the client and there was no packet reordering, which resulted in dire consequences in the case of packet loss (zoning failures, crashes and many other odd bugs). This patch addresses all of these issues. * Packet bundling: Packets are now automatically bundled and sent as SlottedMetaPackets using a recurring timer. All manual bundling functionality was removed. * Packet reordering: Incoming packets, if received out of order, are stashed and reordered. The maximum wait time for reordering is 20ms. * Packet requesting: Missing SlottedMetaPackets are requested from the client. * PacketCoding refactor: Dropped confusing packet container types. Fixes #5. * Crypto rewrite: PSCrypto is based on a ancient buggy version of cryptopp. Updating to a current version was not possible because it removed the MD5-MAC algorithm. For more details, see Md5Mac.scala. This patch replaces PSCrypto with native Scala code. * Added two new actors: * SocketActor: A simple typed UDP socket actor * MiddlewareActor: The old session pipeline greatly simplified into a typed actor that does most of the things mentioned above. * Begun work on a headless client * Fixed anniversary gun breaking stamina regen * Resolved a few sentry errors
2020-09-17 17:04:06 +02:00
/*
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
import actor.base.ActorTest
import akka.actor.{ActorRef, Props}
import akka.testkit.TestProbe
Networking The game uses a UDP-based protocol. Unlike TCP, UDP does not guarantee that packets arrive, or that they arrive in the correct order. For this reason, the game protocol implements those features using the following: * All packets have a sequence number that is utilized for reordering * Important packets are wrapped in a SlottedMetaPacket with a subslot number * RelatedA packets ae used to request lost packets using the subslot number * RelatedB packets are used to confirm received SlottedMetaPackets All of these go both ways, server <-> client. We used to only partially implement these features: Outgoing packet bundles used SMPs and could be resent, but not all packets were bundled and there was no logic for requesting lost packets from the client and there was no packet reordering, which resulted in dire consequences in the case of packet loss (zoning failures, crashes and many other odd bugs). This patch addresses all of these issues. * Packet bundling: Packets are now automatically bundled and sent as SlottedMetaPackets using a recurring timer. All manual bundling functionality was removed. * Packet reordering: Incoming packets, if received out of order, are stashed and reordered. The maximum wait time for reordering is 20ms. * Packet requesting: Missing SlottedMetaPackets are requested from the client. * PacketCoding refactor: Dropped confusing packet container types. Fixes #5. * Crypto rewrite: PSCrypto is based on a ancient buggy version of cryptopp. Updating to a current version was not possible because it removed the MD5-MAC algorithm. For more details, see Md5Mac.scala. This patch replaces PSCrypto with native Scala code. * Added two new actors: * SocketActor: A simple typed UDP socket actor * MiddlewareActor: The old session pipeline greatly simplified into a typed actor that does most of the things mentioned above. * Begun work on a headless client * Fixed anniversary gun breaking stamina regen * Resolved a few sentry errors
2020-09-17 17:04:06 +02:00
import net.psforever.actors.net.MiddlewareActor
import net.psforever.objects.avatar.Certification
Networking The game uses a UDP-based protocol. Unlike TCP, UDP does not guarantee that packets arrive, or that they arrive in the correct order. For this reason, the game protocol implements those features using the following: * All packets have a sequence number that is utilized for reordering * Important packets are wrapped in a SlottedMetaPacket with a subslot number * RelatedA packets ae used to request lost packets using the subslot number * RelatedB packets are used to confirm received SlottedMetaPackets All of these go both ways, server <-> client. We used to only partially implement these features: Outgoing packet bundles used SMPs and could be resent, but not all packets were bundled and there was no logic for requesting lost packets from the client and there was no packet reordering, which resulted in dire consequences in the case of packet loss (zoning failures, crashes and many other odd bugs). This patch addresses all of these issues. * Packet bundling: Packets are now automatically bundled and sent as SlottedMetaPackets using a recurring timer. All manual bundling functionality was removed. * Packet reordering: Incoming packets, if received out of order, are stashed and reordered. The maximum wait time for reordering is 20ms. * Packet requesting: Missing SlottedMetaPackets are requested from the client. * PacketCoding refactor: Dropped confusing packet container types. Fixes #5. * Crypto rewrite: PSCrypto is based on a ancient buggy version of cryptopp. Updating to a current version was not possible because it removed the MD5-MAC algorithm. For more details, see Md5Mac.scala. This patch replaces PSCrypto with native Scala code. * Added two new actors: * SocketActor: A simple typed UDP socket actor * MiddlewareActor: The old session pipeline greatly simplified into a typed actor that does most of the things mentioned above. * Begun work on a headless client * Fixed anniversary gun breaking stamina regen * Resolved a few sentry errors
2020-09-17 17:04:06 +02:00
import net.psforever.packet.control.{ControlSync, SlottedMetaPacket}
import net.psforever.packet.{GamePacketOpcode, PacketCoding}
import net.psforever.packet.game._
import net.psforever.packet.game.objectcreate.ObjectClass
import net.psforever.types._
import scodec.bits._
import scala.concurrent.duration._
class PacketCodingActor1Test extends ActorTest {
"PacketCodingActor" should {
"construct" in {
Networking The game uses a UDP-based protocol. Unlike TCP, UDP does not guarantee that packets arrive, or that they arrive in the correct order. For this reason, the game protocol implements those features using the following: * All packets have a sequence number that is utilized for reordering * Important packets are wrapped in a SlottedMetaPacket with a subslot number * RelatedA packets ae used to request lost packets using the subslot number * RelatedB packets are used to confirm received SlottedMetaPackets All of these go both ways, server <-> client. We used to only partially implement these features: Outgoing packet bundles used SMPs and could be resent, but not all packets were bundled and there was no logic for requesting lost packets from the client and there was no packet reordering, which resulted in dire consequences in the case of packet loss (zoning failures, crashes and many other odd bugs). This patch addresses all of these issues. * Packet bundling: Packets are now automatically bundled and sent as SlottedMetaPackets using a recurring timer. All manual bundling functionality was removed. * Packet reordering: Incoming packets, if received out of order, are stashed and reordered. The maximum wait time for reordering is 20ms. * Packet requesting: Missing SlottedMetaPackets are requested from the client. * PacketCoding refactor: Dropped confusing packet container types. Fixes #5. * Crypto rewrite: PSCrypto is based on a ancient buggy version of cryptopp. Updating to a current version was not possible because it removed the MD5-MAC algorithm. For more details, see Md5Mac.scala. This patch replaces PSCrypto with native Scala code. * Added two new actors: * SocketActor: A simple typed UDP socket actor * MiddlewareActor: The old session pipeline greatly simplified into a typed actor that does most of the things mentioned above. * Begun work on a headless client * Fixed anniversary gun breaking stamina regen * Resolved a few sentry errors
2020-09-17 17:04:06 +02:00
system.actorOf(Props[MiddlewareActor](), "pca")
//just construct without failing
}
}
}
class PacketCodingActor4Test extends ActorTest {
val string_hex = RawPacket(hex"2A 9F05 D405 86")
val string_obj = ObjectAttachMessage(PlanetSideGUID(1439), PlanetSideGUID(1492), 6)
"PacketCodingActor" should {
"translate r-originating game packet into l-facing hexadecimal data" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
val msg = MDCGamePacket(PacketCoding.CreateGamePacket(0, string_obj))
probe2 ! msg
val reply1 = receiveOne(300 milli) //we get a MdcMsg message back
probe2 ! reply1 //by feeding the MdcMsg into the actor, we get normal output on the probe
probe1.expectMsg(string_hex)
}
}
}
class PacketCodingActor5Test extends ActorTest {
val string_hex = RawPacket(hex"2A 9F05 D405 86")
val string_obj = ObjectAttachMessage(PlanetSideGUID(1439), PlanetSideGUID(1492), 6)
"PacketCodingActor" should {
"translate l-originating hexadecimal data into r-facing game packet" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
pca ! string_hex
val reply = probe1.receiveOne(300 milli)
reply match {
case GamePacket(_, _, msg) => ;
assert(msg == string_obj)
case _ =>
assert(false)
}
}
}
}
class PacketCodingActor6Test extends ActorTest {
val string_obj = ObjectAttachMessage(PlanetSideGUID(1439), PlanetSideGUID(1492), 6)
"PacketCodingActor" should {
"permit l-originating game packet to pass through as an r-facing game packet" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
val msg = PacketCoding.CreateGamePacket(0, string_obj)
pca ! msg
probe1.expectMsg(msg)
}
}
}
class PacketCodingActor7Test extends ActorTest {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val string_hex = RawPacket(
hex"0007 5268 0000004D 00000052 0000004D 0000007C 0000004D 0000000000000276 0000000000000275"
)
val string_obj = ControlSync(21096, 0x4d, 0x52, 0x4d, 0x7c, 0x4d, 0x276, 0x275)
"PacketCodingActor" should {
"translate r-originating control packet into l-facing hexadecimal data" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
val msg = MDCControlPacket(PacketCoding.CreateControlPacket(string_obj))
probe2 ! msg
val reply1 = receiveOne(300 milli) //we get a MdcMsg message back
probe2 ! reply1 //by feeding the MdcMsg into the actor, we get normal output on the probe
probe1.expectMsg(string_hex)
}
}
}
class PacketCodingActor8Test extends ActorTest {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val string_hex = RawPacket(
hex"0007 5268 0000004D 00000052 0000004D 0000007C 0000004D 0000000000000276 0000000000000275"
)
val string_obj = ControlSync(21096, 0x4d, 0x52, 0x4d, 0x7c, 0x4d, 0x276, 0x275)
"PacketCodingActor" should {
"translate l-originating hexadecimal data into r-facing control packet" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
pca ! string_hex
val reply = probe1.receiveOne(300 milli)
reply match {
case ControlPacket(_, msg) => ;
assert(msg == string_obj)
case _ =>
assert(false)
}
}
}
}
class PacketCodingActor9Test extends ActorTest {
val string_obj = ControlSync(21096, 0x4d, 0x52, 0x4d, 0x7c, 0x4d, 0x276, 0x275)
"PacketCodingActor" should {
"permit l-originating control packet to pass through as an r-facing control packet" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
val msg = PacketCoding.CreateControlPacket(string_obj)
pca ! msg
probe1.expectMsg(msg)
}
}
}
class PacketCodingActorATest extends ActorTest {
"PacketCodingActor" should {
"permit l-originating unhandled message to pass through as an r-facing unhandled message" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
pca ! "unhandled message"
probe1.expectMsg("unhandled message")
}
}
}
class PacketCodingActorBTest extends ActorTest {
"PacketCodingActor" should {
"permit r-originating unhandled message to pass through as an l-facing unhandled message" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
probe2 ! "unhandled message"
val reply1 = receiveOne(300 milli) //we get a MdcMsg message back
probe2 ! reply1 //by feeding the MdcMsg into the actor, we get normal output on the probe
probe1.expectMsg("unhandled message")
}
}
}
class PacketCodingActorCTest extends ActorTest {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val string_hex =
hex"D5 0B 00 00 00 01 0A E4 0C 02 48 70 75 72 63 68 61 73 65 5F 65 78 65 6D 70 74 5F 76 73 80 92 70 75 72 63 68 61 73 65 5F 65 78 65 6D 70 74 5F 74 72 80 92 70 75 72 63 68 61 73 65 5F 65 78 65 6D 70 74 5F 6E 63 80 11 00 01 14 A4 04 02 1C 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 12 00 01 14 A4 04 02 1C 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 13 00 01 14 A4 04 02 1C 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 14 00 01 14 A4 04 02 1C 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 15 00 01 14 A4 04 02 1C 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 16 00 01 14 A4 04 02 1C 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 1D 00 15 0A 60 04 02 1C 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 54 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 76 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 87 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 C7 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 C8 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 26 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 52 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 AD 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 B0 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 B9 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 CE 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 D6 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 2C 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 82 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 83 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 B9 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 CA 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 61 60 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 9B 60 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 DA 60 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 1E 00 15 0A 60 04 02 1C 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 54 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 76 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 87 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 C7 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 C8 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 26 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 52 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 AD 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 B0 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 B9 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 CE 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 D6 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 2C 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 82 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 83 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 B9 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 CA 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 61 60 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 9B 60 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 DA 60 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 1F 00 15 0A 60 04 02 1C 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 54 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 76 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 87 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 C7 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 C8 00 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 26 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 52 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 AD 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 B0 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 B9 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 CE 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 D6 20 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 2C 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 82 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 83 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 B9 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 CA 40 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 61 60 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 9B 60 20 10 E0 61 6C 6C 6F 77 65 64 85 66 61 6C 73 65 DA 60 20 10 E0 61 6C 6C 6F 77 65 64 85 66
"PacketCodingActor" should {
"should split r-originating hexadecimal data if it is larger than the MTU limit" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
val msg = RawPacket(string_hex)
probe2 ! msg
receiveN(4)
//msg4.foreach(str => { probe2 ! str })
//probe1.receiveN(4)
}
}
}
class PacketCodingActorDTest extends ActorTest {
val string_obj = PropertyOverrideMessage(
List(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
GamePropertyScope(
0,
GamePropertyTarget(
GamePropertyTarget.game_properties,
List(
"purchase_exempt_vs" -> "",
"purchase_exempt_tr" -> "",
"purchase_exempt_nc" -> ""
)
)
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
GamePropertyScope(17, GamePropertyTarget(ObjectClass.katana, "allowed" -> "false")),
GamePropertyScope(18, GamePropertyTarget(ObjectClass.katana, "allowed" -> "false")),
GamePropertyScope(19, GamePropertyTarget(ObjectClass.katana, "allowed" -> "false")),
GamePropertyScope(20, GamePropertyTarget(ObjectClass.katana, "allowed" -> "false")),
GamePropertyScope(21, GamePropertyTarget(ObjectClass.katana, "allowed" -> "false")),
GamePropertyScope(22, GamePropertyTarget(ObjectClass.katana, "allowed" -> "false")),
GamePropertyScope(
29,
List(
GamePropertyTarget(ObjectClass.aphelion_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aphelion_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aurora, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.battlewagon, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.flail, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.galaxy_gunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lasher, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.liberator, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lightgunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.maelstrom, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.magrider, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.mini_chaingun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.prowler, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.r_shotgun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.thunderer, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vanguard, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vulture, "allowed" -> "false")
)
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
GamePropertyScope(
30,
List(
GamePropertyTarget(ObjectClass.aphelion_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aphelion_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aurora, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.battlewagon, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.flail, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.galaxy_gunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lasher, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.liberator, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lightgunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.maelstrom, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.magrider, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.mini_chaingun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.prowler, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.r_shotgun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.thunderer, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vanguard, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vulture, "allowed" -> "false")
)
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
GamePropertyScope(
31,
List(
GamePropertyTarget(ObjectClass.aphelion_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aphelion_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aurora, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.battlewagon, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.flail, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.galaxy_gunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lasher, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.liberator, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lightgunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.maelstrom, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.magrider, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.mini_chaingun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.prowler, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.r_shotgun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.thunderer, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vanguard, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vulture, "allowed" -> "false")
)
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
GamePropertyScope(
32,
List(
GamePropertyTarget(ObjectClass.aphelion_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aphelion_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aurora, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.battlewagon, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.flail, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.galaxy_gunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lasher, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.liberator, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lightgunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.maelstrom, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.magrider, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.mini_chaingun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.prowler, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.r_shotgun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.thunderer, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vanguard, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vulture, "allowed" -> "false")
)
)
)
)
"PacketCodingActor" should {
"should split r-originating game packet if it is larger than the MTU limit" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
val msg = MDCGamePacket(PacketCoding.CreateGamePacket(0, string_obj))
probe2 ! msg
receiveN(4)
}
}
}
class PacketCodingActorETest extends ActorTest {
"PacketCodingActor" should {
"unwind l-originating hexadecimal data into multiple r-facing packets (MultiPacket -> 2 PlayerStateMessageUpstream)" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val string_hex = RawPacket(
hex"00 03 18 BD E8 04 5C 02 60 E3 F9 19 0E C1 41 27 00 04 02 60 20 0C 58 0B 20 00 00 18 BD E8 04 86 02 62 13 F9 19 0E D8 40 4D 00 04 02 60 20 0C 78 0A 80 00 00"
)
val string_obj1 = GamePacket(
GamePacketOpcode.PlayerStateMessageUpstream,
0,
PlayerStateMessageUpstream(
PlanetSideGUID(1256),
Vector3(3076.7188f, 4734.1094f, 56.390625f),
Some(Vector3(4.0625f, 4.59375f, 0.0f)),
36.5625f,
-2.8125f,
0.0f,
866,
0,
false,
false,
false,
false,
178,
0
)
)
val string_obj2 = GamePacket(
GamePacketOpcode.PlayerStateMessageUpstream,
0,
PlayerStateMessageUpstream(
PlanetSideGUID(1256),
Vector3(3077.0469f, 4734.258f, 56.390625f),
Some(Vector3(5.5f, 1.1875f, 0.0f)),
36.5625f,
-2.8125f,
0.0f,
867,
0,
false,
false,
false,
false,
168,
0
)
)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
pca ! string_hex
val reply = probe1.receiveN(2, 400 milli)
assert(reply.head == string_obj1)
assert(reply(1) == string_obj2)
probe1.expectNoMessage(300 milli)
}
}
}
class PacketCodingActorFTest extends ActorTest {
"PacketCodingActor" should {
"unwind l-originating hexadecimal data into an r-facing packet (MultiPacket -> RelatedB + GenericObjectStateMsg)" in {
val string_hex = RawPacket(hex"00 03 04 00 15 02 98 0B 00 09 0C 0A 1D F2 00 10 00 00 00")
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val string_obj =
GamePacket(GamePacketOpcode.GenericObjectStateMsg, 0, GenericObjectStateMsg(PlanetSideGUID(242), 16))
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
pca ! string_hex
val reply = probe1.receiveN(1, 400 milli)
assert(reply.head == string_obj)
//the RelatedB message - 00 15 02 98 - is consumed by pca
probe1.expectNoMessage(300 milli)
}
}
}
class PacketCodingActorGTest extends ActorTest {
"PacketCodingActor" should {
"unwind l-originating hexadecimal data into an r-facing packet (MultiPacketEx -> RelatedA + GenericObjectStateMsg)" in {
val string_hex = RawPacket(hex"00 19 04 00 11 02 98 0B 00 09 0C 0A 1D F2 00 10 00 00 00")
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val string_obj =
GamePacket(GamePacketOpcode.GenericObjectStateMsg, 0, GenericObjectStateMsg(PlanetSideGUID(242), 16))
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
pca ! string_hex
val reply = probe1.receiveN(1, 400 milli)
assert(reply.head == string_obj)
//the RelatedA message - 00 11 02 98 - is consumed by pca; should see error log message in console
probe1.expectNoMessage(300 milli)
}
}
}
class PacketCodingActorHTest extends ActorTest {
"PacketCodingActor" should {
"unwind l-originating hexadecimal data into two r-facing packets (SlottedMetaPacket/MultiPacketEx -> 2 ObjectDeleteMessage)" in {
val string_hex = RawPacket(hex"00 09 0A E1 00 19 04 19 4F 04 40 04 19 51 04 40")
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val string_obj1 =
GamePacket(GamePacketOpcode.ObjectDeleteMessage, 0, ObjectDeleteMessage(PlanetSideGUID(1103), 2))
val string_obj2 =
GamePacket(GamePacketOpcode.ObjectDeleteMessage, 0, ObjectDeleteMessage(PlanetSideGUID(1105), 2))
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
pca ! string_hex
val reply = probe1.receiveN(2, 400 milli)
assert(reply.head == string_obj1)
assert(reply(1) == string_obj2)
probe1.expectNoMessage(300 milli)
}
}
}
class PacketCodingActorITest extends ActorTest {
import net.psforever.packet.game.objectcreate._
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val pos: PlacementData = PlacementData(Vector3.Zero, Vector3.Zero)
val app: Int => CharacterAppearanceData = CharacterAppearanceData(
BasicCharacterData(
"IlllIIIlllIlIllIlllIllI",
PlanetSideEmpire.VS,
CharacterGender.Female,
41,
CharacterVoice.Voice1
),
false,
false,
ExoSuitType.Standard,
"",
0,
false,
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
2.8125f,
0f,
true,
GrenadeState.None,
false,
false,
None,
RibbonBars()
)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
var char: Option[Int] => DetailedCharacterData = DetailedCharacterData(
0,
0,
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
100,
100,
50,
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
100,
100,
None,
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
List(
Certification.StandardAssault,
Certification.MediumAssault,
Certification.ATV,
Certification.Harasser,
Certification.StandardExoSuit,
Certification.AgileExoSuit,
Certification.ReinforcedExoSuit
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
),
List(),
List(),
List.empty,
None
)
val obj = DetailedPlayerData(pos, app, char, InventoryData(Nil), DrawnSlot.None)
//println(s"${PacketCoding.EncodePacket(ObjectCreateDetailedMessage(0x79, PlanetSideGUID(75), obj))}")
val pkt = MultiPacketBundle(List(ObjectCreateDetailedMessage(0x79, PlanetSideGUID(75), obj)))
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val string_hex =
hex"00090000186c060000bc84b000000000000000000002040000097049006c006c006c004900490049006c006c006c0049006c0049006c006c0049006c006c006c0049006c006c00490084524000000000000000000000000000000020000007f00703fffffffffffffffffffffffffffffffc000000000000000000000000000000000000000190019000640000000000c800c80000000000000000000000000000000000000001c00042c54686c7000000000000000000000000000000000000000000000000000000000000100000000400e0"
"PacketCodingActor" should {
"bundle an r-originating packet into an l-facing SlottedMetaPacket byte stream data (SlottedMetaPacket)" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
probe2 ! pkt
val reply1 = receiveN(1, 400 milli) //we get a MdcMsg message back
probe1.receiveN(1, 200 milli) //flush contents
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
probe2 ! reply1.head //by feeding the MdcMsg into the actor, we get normal output on the probe
probe1.receiveOne(300 milli) match {
case RawPacket(data) =>
assert(data == string_hex)
Networking The game uses a UDP-based protocol. Unlike TCP, UDP does not guarantee that packets arrive, or that they arrive in the correct order. For this reason, the game protocol implements those features using the following: * All packets have a sequence number that is utilized for reordering * Important packets are wrapped in a SlottedMetaPacket with a subslot number * RelatedA packets ae used to request lost packets using the subslot number * RelatedB packets are used to confirm received SlottedMetaPackets All of these go both ways, server <-> client. We used to only partially implement these features: Outgoing packet bundles used SMPs and could be resent, but not all packets were bundled and there was no logic for requesting lost packets from the client and there was no packet reordering, which resulted in dire consequences in the case of packet loss (zoning failures, crashes and many other odd bugs). This patch addresses all of these issues. * Packet bundling: Packets are now automatically bundled and sent as SlottedMetaPackets using a recurring timer. All manual bundling functionality was removed. * Packet reordering: Incoming packets, if received out of order, are stashed and reordered. The maximum wait time for reordering is 20ms. * Packet requesting: Missing SlottedMetaPackets are requested from the client. * PacketCoding refactor: Dropped confusing packet container types. Fixes #5. * Crypto rewrite: PSCrypto is based on a ancient buggy version of cryptopp. Updating to a current version was not possible because it removed the MD5-MAC algorithm. For more details, see Md5Mac.scala. This patch replaces PSCrypto with native Scala code. * Added two new actors: * SocketActor: A simple typed UDP socket actor * MiddlewareActor: The old session pipeline greatly simplified into a typed actor that does most of the things mentioned above. * Begun work on a headless client * Fixed anniversary gun breaking stamina regen * Resolved a few sentry errors
2020-09-17 17:04:06 +02:00
PacketCoding.decodePacket(data).require match {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
case _: SlottedMetaPacket =>
assert(true)
case _ =>
assert(false)
}
case e =>
assert(false)
}
}
}
}
class PacketCodingActorJTest extends ActorTest {
"PacketCodingActor" should {
"bundle r-originating packets into a number of MTU-acceptable l-facing byte streams (1 packets into 1)" in {
val pkt = MultiPacketBundle(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
List(
ObjectDeleteMessage(PlanetSideGUID(1103), 2),
ObjectDeleteMessage(PlanetSideGUID(1105), 2),
ObjectDeleteMessage(PlanetSideGUID(1107), 2)
)
)
val string_hex = hex"00090000001904194f044004195104400419530440"
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
probe2 ! pkt
val reply1 = receiveN(1, 400 milli) //we get a MdcMsg message back
probe1.receiveN(1, 200 milli) //flush contents
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
probe2 ! reply1.head //by feeding the MdcMsg into the actor, we get normal output on the probe
probe1.receiveOne(300 milli) match {
case RawPacket(data) =>
assert(data == string_hex)
case e =>
assert(false)
}
}
}
}
class PacketCodingActorKTest extends ActorTest {
import net.psforever.packet.game.objectcreate._
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val pos: PlacementData = PlacementData(Vector3.Zero, Vector3.Zero)
val aa: Int => CharacterAppearanceA = CharacterAppearanceA(
BasicCharacterData(
"IlllIIIlllIlIllIlllIllI",
PlanetSideEmpire.VS,
CharacterGender.Female,
41,
CharacterVoice.Voice1
),
ObjectCreateMessage Alterations, Class Object Adjustments (#243) * power outage failure resulting in the destruction of the original ocm-fixes branch; the git branch refs were corrupted during commit, but the up-to-date changed files remained intact * eliminating the need for CommonFieldData2 and CommonFieldData2WithPlacement * in the middle of integrating CommonFieldData into DetailedLockerContainerData (but not standard LockerContainerData); added field for final boolean in WeaponData * adding faction affinity to Equipment (to match functionality; not becuase I know what ends ...) * in the middle of integrating CommonFieldData into DetailedCommandDetonaterData * applying faction affinity to objects at time of terminal production (but to what ends?); required BoomerTrigger and AmmoBox to always report as NEUTRAL internally * completed the transition from using the old class-based order terminal system to the page-based order terminal system; unused terminal classes have been eliminated * more closely aligned TelepadDeployableData and InternalTelepadDeployableData * modifying TelepadDeployableData make it generic and eliminate the need for InternalTelepadDeployableData after fixing a packet converter to utilize DroppedItemData * modified Terminal operation to branch further outwards from Terminal.Request to the TerminalDefinition's Request method; modified tests to reflect update * loosening up matrix terminal definition limitations * modified ProximityTerminal to support a custom defintition class * rendered the message passing system for Terminals general (Any) in the full scale so it can be specific in instance cases * refactored and moved both EquipmentSlot and ExoSuitDefinition * (re)load Favorites each time player (re)spawns
2019-03-03 08:23:30 -05:00
CommonFieldData(
PlanetSideEmpire.VS,
false,
false,
true,
None,
false,
None,
None,
PlanetSideGUID(0)
ObjectCreateMessage Alterations, Class Object Adjustments (#243) * power outage failure resulting in the destruction of the original ocm-fixes branch; the git branch refs were corrupted during commit, but the up-to-date changed files remained intact * eliminating the need for CommonFieldData2 and CommonFieldData2WithPlacement * in the middle of integrating CommonFieldData into DetailedLockerContainerData (but not standard LockerContainerData); added field for final boolean in WeaponData * adding faction affinity to Equipment (to match functionality; not becuase I know what ends ...) * in the middle of integrating CommonFieldData into DetailedCommandDetonaterData * applying faction affinity to objects at time of terminal production (but to what ends?); required BoomerTrigger and AmmoBox to always report as NEUTRAL internally * completed the transition from using the old class-based order terminal system to the page-based order terminal system; unused terminal classes have been eliminated * more closely aligned TelepadDeployableData and InternalTelepadDeployableData * modifying TelepadDeployableData make it generic and eliminate the need for InternalTelepadDeployableData after fixing a packet converter to utilize DroppedItemData * modified Terminal operation to branch further outwards from Terminal.Request to the TerminalDefinition's Request method; modified tests to reflect update * loosening up matrix terminal definition limitations * modified ProximityTerminal to support a custom defintition class * rendered the message passing system for Terminals general (Any) in the full scale so it can be specific in instance cases * refactored and moved both EquipmentSlot and ExoSuitDefinition * (re)load Favorites each time player (re)spawns
2019-03-03 08:23:30 -05:00
),
ExoSuitType.Standard,
0,
41605313L,
0,
0,
0,
65535
)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val ab: (Boolean, Int) => CharacterAppearanceB = CharacterAppearanceB(
0L,
"",
0,
false,
false,
false,
false,
false,
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
2.8125f,
0f,
false,
GrenadeState.None,
false,
false,
false,
false,
false,
None
)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val app: Int => CharacterAppearanceData = CharacterAppearanceData(
aa,
ab,
RibbonBars()
)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val ba: DetailedCharacterA = DetailedCharacterA(
0L,
0L,
0L,
0L,
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
0L,
100,
100,
false,
50,
32831L,
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
100,
100,
None,
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
0,
0,
0L,
List(0, 0, 0, 0, 0, 0),
List(
Certification.StandardAssault,
Certification.MediumAssault,
Certification.ATV,
Certification.Harasser,
Certification.StandardExoSuit,
Certification.AgileExoSuit,
Certification.ReinforcedExoSuit
)
)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val bb: (Long, Option[Int]) => DetailedCharacterB = DetailedCharacterB(
None,
Nil,
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Nil,
Nil,
List(
"xpe_sanctuary_help",
"xpe_th_firemodes",
"used_beamer",
"map13"
),
Nil,
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
0L,
0L,
0L,
0L,
0L,
Some(DCDExtra2(0, 0)),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
Nil,
Nil,
false,
None
)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val char: Option[Int] => DetailedCharacterData =
(pad_length: Option[Int]) => DetailedCharacterData(ba, bb(ba.bep, pad_length))(pad_length)
val obj = DetailedPlayerData(pos, app, char, InventoryData(Nil), DrawnSlot.None)
val list = List(
ObjectCreateDetailedMessage(0x79, PlanetSideGUID(75), obj),
ObjectDeleteMessage(PlanetSideGUID(1103), 2),
ObjectDeleteMessage(PlanetSideGUID(1105), 2),
ObjectCreateDetailedMessage(0x79, PlanetSideGUID(175), obj),
ObjectCreateDetailedMessage(0x79, PlanetSideGUID(275), obj),
ObjectDeleteMessage(PlanetSideGUID(1107), 2)
)
"PacketCodingActor" should {
"bundle r-originating packets into a number of MTU-acceptable l-facing byte streams (6 packets into 2)" in {
val pkt = MultiPacketBundle(list)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
probe2 ! pkt
val reply1 = receiveN(2, 400 milli)
probe1.receiveN(1, 200 milli) //flush contents
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
probe2 ! reply1.head //by feeding the MdcMsg into the actor, we get normal output on the probe
val reply3 = probe1.receiveOne(300 milli).asInstanceOf[RawPacket]
pca ! reply3 //reconstruct original three packets from the first bundle
val reply4 = probe1.receiveN(3, 400 milli)
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
var i = 0
reply4.foreach {
case GamePacket(_, _, packet) =>
assert(packet == list(i))
i += 1
case _ =>
assert(false)
}
}
}
}
class PacketCodingActorLTest extends ActorTest {
val string_obj = PropertyOverrideMessage(
List(
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
GamePropertyScope(
0,
GamePropertyTarget(
GamePropertyTarget.game_properties,
List(
"purchase_exempt_vs" -> "",
"purchase_exempt_tr" -> "",
"purchase_exempt_nc" -> ""
)
)
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
GamePropertyScope(17, GamePropertyTarget(ObjectClass.katana, "allowed" -> "false")),
GamePropertyScope(18, GamePropertyTarget(ObjectClass.katana, "allowed" -> "false")),
GamePropertyScope(19, GamePropertyTarget(ObjectClass.katana, "allowed" -> "false")),
GamePropertyScope(20, GamePropertyTarget(ObjectClass.katana, "allowed" -> "false")),
GamePropertyScope(21, GamePropertyTarget(ObjectClass.katana, "allowed" -> "false")),
GamePropertyScope(22, GamePropertyTarget(ObjectClass.katana, "allowed" -> "false")),
GamePropertyScope(
29,
List(
GamePropertyTarget(ObjectClass.aphelion_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aphelion_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aurora, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.battlewagon, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.flail, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.galaxy_gunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lasher, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.liberator, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lightgunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.maelstrom, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.magrider, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.mini_chaingun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.prowler, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.r_shotgun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.thunderer, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vanguard, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vulture, "allowed" -> "false")
)
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
GamePropertyScope(
30,
List(
GamePropertyTarget(ObjectClass.aphelion_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aphelion_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aurora, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.battlewagon, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.flail, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.galaxy_gunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lasher, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.liberator, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lightgunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.maelstrom, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.magrider, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.mini_chaingun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.prowler, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.r_shotgun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.thunderer, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vanguard, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vulture, "allowed" -> "false")
)
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
GamePropertyScope(
31,
List(
GamePropertyTarget(ObjectClass.aphelion_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aphelion_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aurora, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.battlewagon, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.flail, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.galaxy_gunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lasher, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.liberator, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lightgunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.maelstrom, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.magrider, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.mini_chaingun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.prowler, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.r_shotgun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.thunderer, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vanguard, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vulture, "allowed" -> "false")
)
),
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
GamePropertyScope(
32,
List(
GamePropertyTarget(ObjectClass.aphelion_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aphelion_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.aurora, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.battlewagon, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.colossus_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.flail, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.galaxy_gunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lasher, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.liberator, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.lightgunship, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.maelstrom, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.magrider, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.mini_chaingun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_flight, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.peregrine_gunner, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.prowler, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.r_shotgun, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.thunderer, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vanguard, "allowed" -> "false"),
GamePropertyTarget(ObjectClass.vulture, "allowed" -> "false")
)
)
)
)
"PacketCodingActor" should {
"split, rather than bundle, r-originating packets into a number of MTU-acceptable l-facing byte streams" in {
Persistence #1 featuring quill (#508) * Add .scalafmt.conf * Adopt quill for database access * Removed postgresql-async * Refactored all instances of database access * Creating duplicate characters of the same account is no longer possible * Rewrote large parts of LoginSessionActor * Implement migrations * Move overrides into subdirectory * Make usernames case insensitive * Use LOWER(?) comparison instead of storing lowercased username * import scala.util.{Success, Failure} * Add config and joda-time dependencies * Add sbt-scalafmt * Use defaultWithAlign scalafmt preset * Format all * Add scalafix * Remove unused imports * Don't lowercase username when inserting * Update readme * Listen on worldserver.Hostname address * Remove database test on startup It could fail when the global thread pool is busy loading zone maps. Migrations run on the main thread and also serve the purpose of verifying the database configuration so it's fine to remove the test altogether. * Refactor chat message handlers, zones What started as a small change to how zones are stored turned into a pretty big effort of refactoring the chat message handler. The !hack command was removed, the /capturebase commandwas added. * Expose db ports in docker-compose.yml * Silence property override log * Rework configuration * Unify configuration using the typesafe.config library * Add configuration option for public address * Configuration is now loaded from application.conf rather than worldserver.ini * Refactor PsLogin and remove unnecessary logging * Move pslogin into net.psforever.pslogin namespace * Fix coverage
2020-07-14 05:54:05 +02:00
val probe1 = TestProbe()
val probe2 = system.actorOf(Props(classOf[MDCTestProbe], probe1), "mdc-probe")
val pca: ActorRef = system.actorOf(Props[PacketCodingActor](), "pca")
pca ! HelloFriend(135, List(probe2).iterator)
probe1.receiveOne(100 milli) //consume
val msg = MultiPacketBundle(List(string_obj))
pca ! msg
receiveN(4)
}
}
}
object PacketCodingActorTest {
//decoy
}
Networking The game uses a UDP-based protocol. Unlike TCP, UDP does not guarantee that packets arrive, or that they arrive in the correct order. For this reason, the game protocol implements those features using the following: * All packets have a sequence number that is utilized for reordering * Important packets are wrapped in a SlottedMetaPacket with a subslot number * RelatedA packets ae used to request lost packets using the subslot number * RelatedB packets are used to confirm received SlottedMetaPackets All of these go both ways, server <-> client. We used to only partially implement these features: Outgoing packet bundles used SMPs and could be resent, but not all packets were bundled and there was no logic for requesting lost packets from the client and there was no packet reordering, which resulted in dire consequences in the case of packet loss (zoning failures, crashes and many other odd bugs). This patch addresses all of these issues. * Packet bundling: Packets are now automatically bundled and sent as SlottedMetaPackets using a recurring timer. All manual bundling functionality was removed. * Packet reordering: Incoming packets, if received out of order, are stashed and reordered. The maximum wait time for reordering is 20ms. * Packet requesting: Missing SlottedMetaPackets are requested from the client. * PacketCoding refactor: Dropped confusing packet container types. Fixes #5. * Crypto rewrite: PSCrypto is based on a ancient buggy version of cryptopp. Updating to a current version was not possible because it removed the MD5-MAC algorithm. For more details, see Md5Mac.scala. This patch replaces PSCrypto with native Scala code. * Added two new actors: * SocketActor: A simple typed UDP socket actor * MiddlewareActor: The old session pipeline greatly simplified into a typed actor that does most of the things mentioned above. * Begun work on a headless client * Fixed anniversary gun breaking stamina regen * Resolved a few sentry errors
2020-09-17 17:04:06 +02:00
*/