mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-28 00:09:13 +00:00
* 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
This commit is contained in:
parent
88b194fde2
commit
e0defe8240
850 changed files with 144487 additions and 47476 deletions
|
|
@ -5,7 +5,8 @@ import net.psforever.crypto.CryptoInterface
|
|||
import net.psforever.crypto.CryptoInterface.CryptoDHState
|
||||
import scodec.bits._
|
||||
|
||||
class CryptoInterfaceTest extends Specification { args(stopOnFail = true)
|
||||
class CryptoInterfaceTest extends Specification {
|
||||
args(stopOnFail = true)
|
||||
"Crypto interface" should {
|
||||
"correctly initialize" in {
|
||||
CryptoInterface.initialize()
|
||||
|
|
@ -13,13 +14,13 @@ class CryptoInterfaceTest extends Specification { args(stopOnFail = true)
|
|||
}
|
||||
|
||||
"encrypt and decrypt" in {
|
||||
val key = hex"41414141"
|
||||
val key = hex"41414141"
|
||||
val plaintext = ByteVector.fill(16)(0x42)
|
||||
|
||||
val crypto = new CryptoInterface.CryptoState(key, key)
|
||||
|
||||
val ciphertext = crypto.encrypt(plaintext)
|
||||
val decrypted = crypto.decrypt(ciphertext)
|
||||
val decrypted = crypto.decrypt(ciphertext)
|
||||
|
||||
crypto.close
|
||||
decrypted mustEqual plaintext
|
||||
|
|
@ -27,13 +28,13 @@ class CryptoInterfaceTest extends Specification { args(stopOnFail = true)
|
|||
}
|
||||
|
||||
"encrypt and decrypt must handle no bytes" in {
|
||||
val key = hex"41414141"
|
||||
val key = hex"41414141"
|
||||
val empty = ByteVector.empty
|
||||
|
||||
val crypto = new CryptoInterface.CryptoState(key, key)
|
||||
|
||||
val ciphertext = crypto.encrypt(empty)
|
||||
val decrypted = crypto.decrypt(ciphertext)
|
||||
val decrypted = crypto.decrypt(ciphertext)
|
||||
|
||||
crypto.close
|
||||
|
||||
|
|
@ -42,8 +43,8 @@ class CryptoInterfaceTest extends Specification { args(stopOnFail = true)
|
|||
}
|
||||
|
||||
"encrypt and decrypt must only accept block aligned inputs" in {
|
||||
val key = hex"41414141"
|
||||
val badPad = ByteVector.fill(CryptoInterface.RC5_BLOCK_SIZE-1)('a')
|
||||
val key = hex"41414141"
|
||||
val badPad = ByteVector.fill(CryptoInterface.RC5_BLOCK_SIZE - 1)('a')
|
||||
|
||||
val crypto = new CryptoInterface.CryptoState(key, key)
|
||||
|
||||
|
|
@ -109,7 +110,7 @@ class CryptoInterfaceTest extends Specification { args(stopOnFail = true)
|
|||
|
||||
"safely handle multiple starts" in {
|
||||
val dontCare = ByteVector.fill(16)(0x42)
|
||||
val dh = new CryptoDHState()
|
||||
val dh = new CryptoDHState()
|
||||
|
||||
dh.start()
|
||||
dh.start() must throwA[IllegalStateException]
|
||||
|
|
@ -120,7 +121,7 @@ class CryptoInterfaceTest extends Specification { args(stopOnFail = true)
|
|||
|
||||
"prevent function calls before initialization" in {
|
||||
val dontCare = ByteVector.fill(16)(0x42)
|
||||
val dh = new CryptoDHState()
|
||||
val dh = new CryptoDHState()
|
||||
|
||||
dh.getGenerator must throwA[IllegalStateException]
|
||||
dh.getModulus must throwA[IllegalStateException]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue