better post definition

This commit is contained in:
minjaesong
2025-01-15 13:23:28 +09:00
parent c14720d649
commit 51dd99fd80
4 changed files with 68 additions and 10 deletions

View File

@@ -258,10 +258,10 @@ class AudioMixer : Disposable {
it.filters[0] = BinoPan(0f) it.filters[0] = BinoPan(0f)
} }
masterTrack.filters[0] = SoftClp masterTrack.filters[0] = Comp(-36f, 1f, 12f).also {
masterTrack.filters[1] = Comp(-36f, 1f, 12f).also {
it.bypass = true it.bypass = true
} }
masterTrack.filters[1] = SoftClp
masterTrack.filters[2] = Vecto(1.4142f) masterTrack.filters[2] = Vecto(1.4142f)
masterTrack.filters[3] = Spectro() masterTrack.filters[3] = Spectro()

View File

@@ -123,12 +123,11 @@ class Comp(
// Toolkit.fillArea(batch, x.toFloat() + STRIP_W, y+14f, -STRIP_W * perc, 2f) // Toolkit.fillArea(batch, x.toFloat() + STRIP_W, y+14f, -STRIP_W * perc, 2f)
batch.color = FILTER_NAME_ACTIVE 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, "P:${threshold.absoluteValue.toInt()}/${knee.absoluteValue.toInt()}", 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+17f)
App.fontSmallNumbers.draw(batch, "R:${ratio.absoluteValue.times(100).roundToInt().div(100f)}:1", x+3f, y+33f)
} }
override val debugViewHeight: Int = 48 override val debugViewHeight: Int = 32
override fun copyParamsFrom(other: TerrarumAudioFilter) { override fun copyParamsFrom(other: TerrarumAudioFilter) {
if (other is Comp) { if (other is Comp) {

View File

@@ -50,7 +50,7 @@ class GamePostalService {
data class Post( data class Post(
val sender: String, // an identifier for an actor, an entity, etc.; actor identifier is always "UUID:<actor UUID>" val sender: String, // an identifier for an actor, an entity, etc.; actor identifier is always "UUID:<actor UUID>"
val receiver: String, // an identifier for an actor, an entity, etc.; actor identifier is always "UUID:<actor UUID>" val recipient: String, // an identifier for an actor, an entity, etc.; actor identifier is always "UUID:<actor UUID>"
val postmarkDate: Long, // world TIME_T 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 postType: Int = 0, // 0: regular post; 128: sent by system/NPCs; may be extended with future additions such as registered post
val postContents: PostContents, val postContents: PostContents,
@@ -62,5 +62,64 @@ data class Post(
data class PostContents( data class PostContents(
val type: String, // "text", "btex" val type: String, // "text", "btex"
val contentsRaw: String, // plain text for "text"; xml for "btex" val contentsRaw: String, // plain text for "text"; xml for "btex"
val contentsExtra: Any? = null 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
*/

View File

@@ -498,7 +498,7 @@ class BasicDebugInfoWindow : UICanvas() {
private val stripGap = 1 private val stripGap = 1
private val stripFilterHeight = 16 private val stripFilterHeight = 16
private val stripFaderHeight = meterHeight + 20 private val stripFaderHeight = meterHeight + 20
private val numberOfFilters = 14 private val numberOfFilters = 15
private val stripH = stripFaderHeight + stripFilterHeight * numberOfFilters + 16 private val stripH = stripFaderHeight + stripFilterHeight * numberOfFilters + 16
private val trackBack = listOf(COL_WELL, COL_WELL2) private val trackBack = listOf(COL_WELL, COL_WELL2)