Compare commits
3 Commits
1c304a5108
...
master
Author | SHA1 | Date | |
---|---|---|---|
80d58ea4e2
|
|||
770a58fb1d
|
|||
1862ce4f65
|
@@ -39,7 +39,8 @@ class SolarNetworkConnect : JavaPlugin() {
|
||||
private var playerSolarpassMap: MutableMap<String, String?> = mutableMapOf()
|
||||
|
||||
private fun handleWebSocketPacket(packet: WebSocketPacket) {
|
||||
logger.info("Received WebSocket packet: type=${packet.type}")
|
||||
if (config.getBoolean("debug"))
|
||||
logger.info("Received WebSocket packet: type=${packet.type}")
|
||||
if (packet.type.startsWith("messages") && packet.data != null) {
|
||||
try {
|
||||
when (packet.type) {
|
||||
|
@@ -187,15 +187,11 @@ class SnCommand(
|
||||
|
||||
try {
|
||||
val transactionSrv = SnBalanceService(sn);
|
||||
val transaction = transactionSrv.addBalance(amount, "Withdraw from GoatCraft", accountId);
|
||||
transactionSrv.addBalance(amount, "Withdraw from GoatCraft", accountId);
|
||||
val transactionHintComponent =
|
||||
TextComponent(
|
||||
ChatColor.GREEN.toString() + (messages["command_withdraw_done"]
|
||||
?: "Done! transaction number ") + ChatColor.WHITE + ChatColor.BOLD + "#${
|
||||
transaction.id.take(
|
||||
6
|
||||
)
|
||||
}"
|
||||
?: "Done! ")
|
||||
)
|
||||
|
||||
p0.playSound(p0.player!!, Sound.BLOCK_ANVIL_PLACE, 1.0F, 1.0F)
|
||||
|
@@ -27,9 +27,8 @@ class SnChatListener(
|
||||
@Suppress("SENSELESS_COMPARISON")
|
||||
@EventHandler()
|
||||
fun onPlayerJoin(event: PlayerJoinEvent) {
|
||||
val user = CMI.getInstance().playerManager.getUser(event.player);
|
||||
val firstTime = user.playerTime == 0L;
|
||||
val templateKey = if (!firstTime) "join" else "joinFirst";
|
||||
val firstTime = Bukkit.getOfflinePlayer(event.player.uniqueId) == null;
|
||||
val templateKey = if (!firstTime) "join" else "join_first";
|
||||
val template = messages[templateKey]
|
||||
?: if (!firstTime) "➡️ {player} joined the game." else "➡️ {player} first time joined the game."
|
||||
val message = template.replace("{player}", event.player.name)
|
||||
|
@@ -47,7 +47,7 @@ class SnBalanceService(private val sn: SnService) {
|
||||
ignoreUnknownKeys = true
|
||||
}
|
||||
|
||||
fun addBalance(amount: Double, remark: String, accountID: String): SnTransaction {
|
||||
fun addBalance(amount: Double, remark: String, accountID: String) {
|
||||
val body = SnTransactionRequest(
|
||||
amount = amount,
|
||||
remark = remark,
|
||||
@@ -65,10 +65,6 @@ class SnBalanceService(private val sn: SnService) {
|
||||
|
||||
sn.client.newCall(request).execute().use { response ->
|
||||
if (!response.isSuccessful) throw IOException("Unexpected code $response")
|
||||
val responseBody = response.body!!.string()
|
||||
val out = json.decodeFromString<SnTransaction>(responseBody)
|
||||
|
||||
return out
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
join: "➡️ {player} joined the game."
|
||||
joinFirst: "➡️ {player} first time joined the game."
|
||||
join_first: "➡️ {player} first time joined the game."
|
||||
quit: "⬅️ {player} left the game."
|
||||
death: "💀 {player} {message}"
|
||||
advancement: "🎉 {player} unlocked advancement: {advancement}"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
join: "➡️ {player} 加入了游戏。"
|
||||
joinFirst: "➡️ {player} 首次加入了游戏。"
|
||||
join_first: "➡️ {player} 首次加入了游戏。"
|
||||
quit: "⬅️ {player} 离开了游戏。"
|
||||
death: "💀 {player} {message}"
|
||||
advancement: "🎉 {player} 解锁成就:{advancement}"
|
||||
|
Reference in New Issue
Block a user