diff --git a/src/net/torvald/terrarum/audio/AudioMixer.kt b/src/net/torvald/terrarum/audio/AudioMixer.kt index d35a3bb1e..979dcf8fb 100644 --- a/src/net/torvald/terrarum/audio/AudioMixer.kt +++ b/src/net/torvald/terrarum/audio/AudioMixer.kt @@ -258,10 +258,10 @@ class AudioMixer : Disposable { it.filters[0] = BinoPan(0f) } - masterTrack.filters[0] = SoftClp - masterTrack.filters[1] = Comp(-36f, 1f, 12f).also { + masterTrack.filters[0] = Comp(-36f, 1f, 12f).also { it.bypass = true } + masterTrack.filters[1] = SoftClp masterTrack.filters[2] = Vecto(1.4142f) masterTrack.filters[3] = Spectro() diff --git a/src/net/torvald/terrarum/audio/dsp/Comp.kt b/src/net/torvald/terrarum/audio/dsp/Comp.kt index 292c89aea..d6d895354 100644 --- a/src/net/torvald/terrarum/audio/dsp/Comp.kt +++ b/src/net/torvald/terrarum/audio/dsp/Comp.kt @@ -123,12 +123,11 @@ class Comp( // Toolkit.fillArea(batch, x.toFloat() + STRIP_W, y+14f, -STRIP_W * perc, 2f) batch.color = FILTER_NAME_ACTIVE - App.fontSmallNumbers.draw(batch, "T:${threshold.absoluteValue.times(100).roundToInt().div(100f)}", x+3f, y+1f) - App.fontSmallNumbers.draw(batch, "K:${knee.absoluteValue.times(100).roundToInt().div(100f)}", x+3f, y+17f) - App.fontSmallNumbers.draw(batch, "R:${ratio.absoluteValue.times(100).roundToInt().div(100f)}:1", x+3f, y+33f) + App.fontSmallNumbers.draw(batch, "P:${threshold.absoluteValue.toInt()}/${knee.absoluteValue.toInt()}", x+3f, y+1f) + App.fontSmallNumbers.draw(batch, "R:${ratio.absoluteValue.times(100).roundToInt().div(100f)}:1", x+3f, y+17f) } - override val debugViewHeight: Int = 48 + override val debugViewHeight: Int = 32 override fun copyParamsFrom(other: TerrarumAudioFilter) { if (other is Comp) { diff --git a/src/net/torvald/terrarum/modulebasegame/gameworld/GamePostalService.kt b/src/net/torvald/terrarum/modulebasegame/gameworld/GamePostalService.kt index 7b1bb0db3..1368e30e3 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameworld/GamePostalService.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameworld/GamePostalService.kt @@ -50,7 +50,7 @@ class GamePostalService { data class Post( val sender: String, // an identifier for an actor, an entity, etc.; actor identifier is always "UUID:" - val receiver: String, // an identifier for an actor, an entity, etc.; actor identifier is always "UUID:" + val recipient: String, // an identifier for an actor, an entity, etc.; actor identifier is always "UUID:" val postmarkDate: Long, // world TIME_T val postType: Int = 0, // 0: regular post; 128: sent by system/NPCs; may be extended with future additions such as registered post val postContents: PostContents, @@ -62,5 +62,64 @@ data class Post( data class PostContents( val type: String, // "text", "btex" val contentsRaw: String, // plain text for "text"; xml for "btex" - val contentsExtra: Any? = null -) \ No newline at end of file + val encryption: String = "none", // "none", "end2end" + val contentsExtra: Any? = null, +) + + +/* + +Serialised Post Format + +Endianness: little + +Chunks: +- MAGIC +- HEADER +- CONTENTSRAW +- CONTENTSEXTRA +- PARCEL + +When the mail is "sealed" (having encryption="end2end"), each chunk after the HEADER are encrypted. +Encryption method: AES-128 using ((128 bits Sender UUID) xor (128 bits Recipient UUID)) + ((float64 parcel weight) shake (date in postmark)) + +MAGIC: 'TeMeSbTR' +HEADER: + - Int8 Protocol version (always 0x01) + - Int8 Post type + - Int8 Generic flags + - Uint24 Offset to CONTENTSRAW + - Uint24 Offset to PARCEL (0xFFFFFF to denote null) + - Uint24 Offset to CONTENTSEXTRA (0xFFFFFF to denote null) + - Int128 The world UUID + - Int64 Date in Postmark (ingame world TIME_T) + - Uint16 Length of Sender string + - Bytes Sender String + - Uint16 Length of Recipient string + - Bytes Recipient String + + Post Type + - 0: text, 1: btex + + Flags + - 1: not posted (players can edit the contents) + - 128: sealed + + Notes: post is either: + 1. always pre-paid when posted + 2. not yet encrypted when in not-posted status (can always calculate postage on the fly) + so no postage information is needed for the Serialised Format + +CONTENTSRAW + - Uint48 unzipped size + - Bytes payload in Zstd compression + +CONTENTSEXTRA + - Uint48 unzipped size + - Bytes payload in Zstd compression + +PARCEL + - Uint48 unzipped size + - Bytes FixtureInventory JSON string in Zstd compression + + */ \ No newline at end of file diff --git a/src/net/torvald/terrarum/ui/BasicDebugInfoWindow.kt b/src/net/torvald/terrarum/ui/BasicDebugInfoWindow.kt index 82c011c0a..e3eb65629 100644 --- a/src/net/torvald/terrarum/ui/BasicDebugInfoWindow.kt +++ b/src/net/torvald/terrarum/ui/BasicDebugInfoWindow.kt @@ -498,7 +498,7 @@ class BasicDebugInfoWindow : UICanvas() { private val stripGap = 1 private val stripFilterHeight = 16 private val stripFaderHeight = meterHeight + 20 - private val numberOfFilters = 14 + private val numberOfFilters = 15 private val stripH = stripFaderHeight + stripFilterHeight * numberOfFilters + 16 private val trackBack = listOf(COL_WELL, COL_WELL2)