Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
0.2.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
phinner committed Apr 19, 2022
1 parent 7fd95ef commit da96057
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- Some bug fixes + optimizations.
- Added better debug.
- Added new configuration properties.
- Fix ugly error message when the message receiver is offline.

- Fix startup error when restarting a Javelin server.
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Xpdustry Javelin",
"author": "Xpdustry",
"description": "A plugin for cross server communication.",
"version": "0.2.0",
"version": "0.2.1",
"minGameVersion": "v126.2",
"hidden": true,
"java": true,
Expand Down
4 changes: 4 additions & 0 deletions src/main/kotlin/fr/xpdustry/javelin/JavelinServer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ private class SimpleJavelinServer @Inject constructor(
val AUTHORIZATION_REGEX = Regex("^Bearer .+$")
}

init {
isReuseAddr = true
}

private val verifier = JWT.require(algorithm).build()

private val gson = GsonBuilder()
Expand Down
17 changes: 11 additions & 6 deletions src/main/kotlin/fr/xpdustry/javelin/whisper/WhisperCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ class WhisperCommand {
private fun ArcCommandSender.whisper(receiver: String, message: String) {
val context = WhisperContext(player.name(), receiver, message)
replies[player] = receiver
val result = servicePipeline.pump(context).through(typeToken<WhisperService>()).result
if (result == State.ACCEPTED) {
player.sendMessage(WhisperFormatter.instance.format(context))
} else {
sendMessage(clientMessageFormatter.format("The player $receiver can't be found on.", MessageIntent.ERROR))
}

servicePipeline
.pump(context)
.through(typeToken<WhisperService>())
.getResult { result, _ ->
if (result == State.ACCEPTED) {
player.sendMessage(WhisperFormatter.instance.format(context))
} else {
sendMessage(clientMessageFormatter.format("The player $receiver is not online.", MessageIntent.ERROR))
}
}
}
}

0 comments on commit da96057

Please sign in to comment.