summaryrefslogtreecommitdiff
path: root/engine/src/main
diff options
context:
space:
mode:
authorSho Sakuma <me@m1sk9.dev>2026-09-28 23:43:14 +0900
committerSho Sakuma <me@m1sk9.dev>2026-09-28 23:43:14 +0900
commit388ae4ef14ec620e6f1fe2ce8a8ea8e3a816d10d (patch)
tree79e79355b5e407bbd6d71b3a7010c6f4348ab261 /engine/src/main
parenta22fce70db7b43aadd8baa42e87a4430a8b1e05f (diff)
downloadLunaticChat-388ae4ef14ec620e6f1fe2ce8a8ea8e3a816d10d.tar.gz
LunaticChat-388ae4ef14ec620e6f1fe2ce8a8ea8e3a816d10d.tar.bz2
LunaticChat-388ae4ef14ec620e6f1fe2ce8a8ea8e3a816d10d.zip
feat: carry the sender's world in cross-server direct messages
{world} rendered empty for a direct message from another server, which left formats like "({world})" showing a bare pair of brackets. The relay now carries the sender's world as an optional field, so this is a PATCH bump (protocol 1.0.2) and either side can be updated first; an older sender or proxy still yields an empty value. The world is read once per message, so the sender, the spies and the relayed copy can no longer disagree if the sender changes worlds mid-way. Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'engine/src/main')
-rw-r--r--engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/protocol/PluginMessage.kt3
-rw-r--r--engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/protocol/ProtocolVersion.kt2
2 files changed, 4 insertions, 1 deletions
diff --git a/engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/protocol/PluginMessage.kt b/engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/protocol/PluginMessage.kt
index 689a57c..82cff37 100644
--- a/engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/protocol/PluginMessage.kt
+++ b/engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/protocol/PluginMessage.kt
@@ -93,6 +93,8 @@ sealed interface PluginMessage {
* @property targetName Target player name
* @property message Message content (romaji-converted if applicable)
* @property timestamp Message timestamp (milliseconds since epoch)
+ * @property senderWorld Name of the world the sender is in; empty when relayed by a
+ * pre-1.0.2 peer
*/
@Serializable
data class DirectMessageRelay(
@@ -104,6 +106,7 @@ sealed interface PluginMessage {
val targetName: String,
val message: String,
val timestamp: Long = System.currentTimeMillis(),
+ val senderWorld: String = "",
) : PluginMessage
/**
diff --git a/engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/protocol/ProtocolVersion.kt b/engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/protocol/ProtocolVersion.kt
index 6585c86..cdf17e7 100644
--- a/engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/protocol/ProtocolVersion.kt
+++ b/engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/protocol/ProtocolVersion.kt
@@ -33,7 +33,7 @@ package dev.m1sk9.lunaticChat.engine.protocol
object ProtocolVersion {
const val MAJOR = 1
const val MINOR = 0
- const val PATCH = 1
+ const val PATCH = 2
/**
* Minimum MINOR version this build can interoperate with (same MAJOR).