Commit graph

95 commits

Author SHA1 Message Date
Renovate Bot d36fcb890e Update dependency joda-time:joda-time to v2.10.7 2020-10-21 10:47:34 +00:00
Mazo 9ec6c735b9
Merge pull request #611 from psforever/renovate/org.flywaydb-flyway-core-7.x
Update dependency org.flywaydb:flyway-core to v7.0.3
2020-10-15 19:29:36 +01:00
Renovate Bot ce0ba803e0
Update dependency org.flywaydb:flyway-core to v7.0.3 2020-10-15 18:28:38 +00:00
Mazo d529988ff0
Merge pull request #610 from psforever/renovate/org.specs2-specs2-core-4.x
Update dependency org.specs2:specs2-core to v4.10.5
2020-10-15 19:28:34 +01:00
Renovate Bot d21f5f2a76
Update dependency org.postgresql:postgresql to v42.2.18 2020-10-15 14:50:29 +00:00
Renovate Bot 81c095a55a
Update dependency org.specs2:specs2-core to v4.10.5 2020-10-14 09:47:34 +00:00
Renovate Bot 252e970736
Update dependency org.flywaydb:flyway-core to v7.0.2 2020-10-12 13:04:41 +00:00
Mazo d19429e45c
Merge pull request #602 from psforever/renovate/org.specs2-specs2-core-4.x
Update dependency org.specs2:specs2-core to v4.10.4
2020-10-12 13:05:01 +01:00
Mazo ad5997a841
Merge pull request #609 from psforever/renovate/io.kamon-kamon-bundle-2.x
Update dependency io.kamon:kamon-bundle to v2.1.8
2020-10-12 13:04:44 +01:00
Mazo 20a1629d38
Merge pull request #604 from psforever/renovate/org.postgresql-postgresql-42.x
Update dependency org.postgresql:postgresql to v42.2.17
2020-10-12 13:04:23 +01:00
Renovate Bot 7bdd28e474
Update dependency io.kamon:kamon-bundle to v2.1.8 2020-10-12 12:04:06 +00:00
Renovate Bot e070a02190
Update dependency io.kamon:kamon-apm-reporter to v2.1.8 2020-10-12 11:33:27 +00:00
Renovate Bot c3861a91fb
Update dependency org.postgresql:postgresql to v42.2.17 2020-10-09 14:27:56 +00:00
Renovate Bot 5c01d33f62 Update akka to v2.6.10 2020-10-09 12:27:56 +00:00
Renovate Bot e433952a4e
Update dependency org.specs2:specs2-core to v4.10.4 2020-10-09 11:27:51 +00:00
Renovate Bot 2d0f0ebe49 Update dependency org.flywaydb:flyway-core to v7.0.1 2020-10-07 12:08:37 +00:00
Renovate Bot 402342f995
Update dependency io.kamon:kamon-apm-reporter to v2.1.7 2020-10-05 13:31:40 +00:00
Renovate Bot e1d99fd17e
Update dependency io.kamon:kamon-bundle to v2.1.7 2020-10-05 13:30:17 +00:00
Renovate Bot fcb2635730 Update dependency org.flywaydb:flyway-core to v7 2020-09-29 11:03:33 +02:00
Renovate Bot f3c2fe75c1 Update dependency org.json4s:json4s-native to v3.6.10 2020-09-29 05:12:24 +00:00
Jakob Gillich 407429ee21 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-26 23:58:09 +02:00
Renovate Bot 5827204b10 Update dependency org.flywaydb:flyway-core to v6.5.7 2020-09-25 18:11:30 +02:00
Renovate Bot d67119b255 Update dependency com.github.pureconfig:pureconfig to v0.14.0 2020-09-22 02:32:46 +02:00
Renovate Bot 07f447c234 Update dependency io.getquill:quill-jasync-postgres to v3.5.3 2020-09-17 10:18:41 +00:00
Renovate Bot d7aa72d6e2
Update dependency org.flywaydb:flyway-core to v6.5.6 2020-09-16 14:21:58 +00:00
Renovate Bot 8245d3ff1e Update dependency commons-io:commons-io to v2.8.0 2020-09-09 18:37:23 +02:00
Renovate Bot 40c917d300 Update akka to v2.6.9 2020-09-09 18:37:07 +02:00
Jakob Gillich d1a3c9cbb5 Fix akka mixed versioning exception 2020-09-08 08:16:08 +02:00
Renovate Bot 2687cf5a14 Update dependency org.specs2:specs2-core to v4.10.3 2020-09-02 08:08:34 +02:00
Renovate Bot 7a0b2d5a7d Update dependency org.json4s:json4s-native to v3.6.9 2020-09-02 08:08:15 +02:00
Renovate Bot 23f02c180f Update dependency org.fusesource.jansi:jansi to v1.18 2020-09-02 08:07:56 +02:00
Renovate Bot 549d2b53fd Update dependency org.postgresql:postgresql to v42.2.16 2020-09-02 08:07:48 +02:00
Renovate Bot bff0dcb9d8 Update dependency org.scala-graph:graph-core to v1.13.2 2020-09-02 08:07:44 +02:00
Renovate Bot 8eb3131f81 Update dependency org.scalatest:scalatest to v3.2.2 2020-09-02 08:07:37 +02:00
Renovate Bot ea55f2357f Update dependency org.flywaydb:flyway-core to v6.5.5 2020-09-02 04:24:09 +00:00
Renovate Bot 6f7f0ca6f3 Update dependency net.java.dev.jna:jna to v5.6.0 2020-09-02 04:21:42 +00:00
Renovate Bot a62d5b8d81 Update dependency io.kamon:kamon-bundle to v2.1.6 2020-09-02 03:19:59 +00:00
Renovate Bot 4bac38d77d Update dependency io.kamon:kamon-apm-reporter to v2.1.6 2020-09-02 02:14:04 +00:00
Renovate Bot 50372a72b2 Update circe to v0.13.0 2020-09-02 02:09:16 +00:00
Renovate Bot 768172d13a Update dependency commons-io:commons-io to v2.7 2020-09-02 00:11:02 +02:00
Renovate Bot 8c768fadac Update akka packages to v2.6.8 2020-09-02 00:10:49 +02:00
Renovate Bot c3222ef568 Update dependency com.github.t3hnar:scala-bcrypt to v4.3.0 2020-09-02 00:01:19 +02:00
Jakob Gillich 0429003863 Auto publish docs 2020-08-26 06:19:00 +02:00
Jakob Gillich f4fd78fc5d Restructure repository
* Move /common/src to /src
* Move services to net.psforever package
* Move /pslogin to /server
2020-08-26 06:19:00 +02:00
Jakob Gillich 3bdc681c9d Avatar Persistence
* Add AvatarActor: Responsible for managing the session's avatar object
* Convert Avatar object to case class
* Add persistence for BEP, CEP, implants, certs and cosmetics
* Add cosmetic chat commands and handle UI packet
* Add /setbr, /setcr, /certadd, /addbep, /addcep GM commands
* Convert zone maps to JSON
* Update to Scala 2.13.3 and fix warnings
* Fix MAX cooldowns not being applied when purchased manually
* Normalize database table names to singular
* Add docker image build
2020-08-22 16:19:13 +02:00
Jakob Gillich 1efbedcf8e Fix coverage exclusions 2020-08-22 16:19:13 +02:00
Jakob Gillich ff8f787b81 Add Sentry 2020-08-22 16:19:13 +02:00
Jakob Gillich 3345e56b38 Building persistence
Buildings will now persist their faction in the database. At least
that's what I want you to believe this change is.

What it actually is: A rework of InterstellarCluster and groundwork
for further reworks.

InterstellarClusterService: This is the old InterstellarCluster, but
as a service (it has always been one in secret). It was converted to
a typed actor and it now handles all spawn point requests.

ZoneActor: Basically ZoneControl, but as a typed actor. It's more of a
stub right now, the eventual goal is to have it own the `Zone` object
rather than the other way around.

BuildingActor: BuildingControl, but as a typed actor.

Also includes some minor improvements to ChatActor and sets
SupervisorStrategy.restart for all typed actors (which is the default
for classic actors, but not for typed actors - we may want to get more
sophisticated here in the future).
2020-08-22 16:19:13 +02:00
Jakob Gillich 4634dffe00 ChatActor
This removes roughly 1k LOC from WorldSessionActor and moves
them to a new ChatActor. That was the initial goal anyway, but it
wasn't that simple. There was no clear location to put this new actor,
I didn't want to put it in pslogin since it isn't part of the "login server"
(and neither is WSA). But since the new actor would have to talk to
WSA and common does not depend on pslogin, I had a choice of
putting more actors in pslogin or putting everything in common. I
chose the latter.

ChatActor and SessionActor (formerly WorldSessionActor) now live
in `common/actors/session`. Since WSA also depends on other
actors in pslogin, most of the pslogin code was moved to either
common/login or common/util. PsLogin as the main entry point
remains in pslogin since having the main code compile to a library
has some advantages, and it will allow us to produce binaries
for distinct login/world servers in the future if desired. For a second
take, I'd suggest moving common to /src in the root directory.

This change is enabled by a new immutable `Zone` object that is
passed from SessionActor to ChatActor. Most of its members are
still mutable references, and the code at the moment does depend
on this being the case. Changes to the session object in
SessionActor are forwarded through a SetZone message to
ChatActor. As we split out more code into actors, we could
use EventBus or typed Topic's instead.

Also included is a reworked ChatService that was converted to a
typed actor and uses the built-in Receptionist facility for service
discovery. By receiving the session object from ChatActor, it can
be much smarter about who to send messages to, rather than
sending all messages to everyone and having them figure it out.
But as this session object is not updated, it can only use static
properties like player name and faction and not fluid properties
like position.

The following chat commands were added:
command, note, gmbroadcast, [nc|tr|vs|broadcast, gmtell, gmpopup
and !whitetext
2020-08-22 16:19:13 +02:00
Jakob Gillich 4dd24ff01a Fix packed binary
I moved PsLogin into a package but didn't update `packMain`
2020-07-23 21:53:45 +02:00