Commit graph

14 commits

Author SHA1 Message Date
Fate-JH 563afcdb19
Auto-Repair Tuning (#652)
* difficulty modifiers for repair rate and drain in config

* changed autorepair request-repair pattern to wait until a repair is fulfilled before issuing the next request; moved integration tests for efficiency

* auto-repair accounts for delay between request-reply when schduling next request; base ntu drain is halved; auto-repair mending values adjusted based on wiki times

* moving config call into auto-repair mixin

* deleting the old integration testing code

* obligatory test fixes

* more of the same

* correcting exceptions with calculating subsequent auto-repair time and transfer messaging behavior with WarpGate objects; transfer animation and transfer delivery now have slightly different timing; wrote  bunch of tests that don't work in the standard manner, but do pass
2021-01-12 14:27:33 -05:00
Jakob Gillich 4c1b9a64d3
Fix thread safety issues
* Synchronize RC5 cipher access
* Replace avatar using message to self in AvatarActor
2020-12-31 04:26:23 +01: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
Jakob Gillich 0429003863 Auto publish docs 2020-08-26 06:19:00 +02:00
Jakob Gillich e0defe8240
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-13 23:54:05 -04:00
Jakob Gillich 8424fcfe68
Ignore more project crap 2020-06-09 19:59:31 +02:00
Mazo a4b0c84e0c Gitignore pslogin/src/main/resources/user.conf 2020-05-12 10:43:04 +01:00
pschord d08911d07c Account and Character Database and Config Improvements (#317)
* Create Account/DB abstraction

* Fix crash when removing boomers from deconstructed player

* Extend config to include database and worldserver info

* Improve ConfigParser tests

* Add database setup documentation

* Add xTriad to THANKS file

**

* Increase bcrypt rounds and fix readme link
2020-01-10 11:13:37 -05:00
Chord ccad92a555 Increase client keep alive interval, add dynamic log files 2016-08-05 18:12:51 -04:00
Chord 8c0be0d84e Ignore log files 2016-07-27 01:16:30 -04:00
Chord 35a592476f Add classpath for native pscrypto libraries 2016-07-26 20:41:02 -04:00
Chord 98b87e1e13 Improve server logging and manually load logback 2016-07-19 03:02:44 -04:00
Chord 8cec84787d Ignore binary files 2016-03-04 15:16:20 -05:00
Chord d96fce6299 Initial Commit 2016-02-05 03:19:13 -05:00