Skip to content

Commit

Permalink
Add message block text log
Browse files Browse the repository at this point in the history
  • Loading branch information
Kieaer committed Mar 21, 2024
1 parent 0a2d071 commit 39ebfa0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
9 changes: 2 additions & 7 deletions src/main/kotlin/essentials/Commands.kt
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,7 @@ class Commands(var handler: CommandHandler, isClient: Boolean) {
clientCommands.register("help", "[page]", "Show command lists") { a, p : Playerc -> Client(a, p).help() }
clientCommands.register("hub", "<set/zone/block/count/total/remove/reset> [ip] [parameters...]", "Create a server to server point.") { a, p : Playerc -> Client(a, p).hub() }
clientCommands.register("hud", "<health>", "Enable unit information.") { a, p : Playerc -> Client(a, p).hud() }
clientCommands.register("info", "[player...]", "Show your information") { a, p: Playerc ->
Client(
a,
p
).info()
}
clientCommands.register("info", "[player...]", "Show your information") { a, p: Playerc -> Client(a, p).info() }
clientCommands.register("js", "[code...]", "Execute JavaScript codes") { a, p : Playerc -> Client(a, p).js() }
clientCommands.register("kickall", "All users except yourself and the administrator will be kicked") { a, p : Playerc -> Client(a, p).kickall() }
clientCommands.register("kill", "[player]", "Kill player.") { a, p : Playerc -> Client(a, p).kill() }
Expand Down Expand Up @@ -2607,7 +2602,7 @@ class Commands(var handler: CommandHandler, isClient: Boolean) {
}

else -> {
send("command.vote.wrong")
send("command.help.vote")
}
}
}
Expand Down
10 changes: 9 additions & 1 deletion src/main/kotlin/essentials/Event.kt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ object Event {
}

addLog(TileLog(System.currentTimeMillis(), it.player.name, "config", it.tile.tile.x, it.tile.tile.y, checkValidBlock(it.tile.tile), it.tile.rotation, it.tile.team, it.value))
if (checkValidBlock(it.tile.tile).contains("message", true)) {
addLog(TileLog(System.currentTimeMillis(), it.player.name, "message", it.tile.tile.x, it.tile.tile.y, checkValidBlock(it.tile.tile), it.tile.rotation, it.tile.team, it.value))
}
}
}

Expand Down Expand Up @@ -244,10 +247,15 @@ object Event {
"config" -> "[cyan]${bundle["event.log.config"]}[]"
"withdraw" -> "[green]${bundle["event.log.withdraw"]}[]"
"deposit" -> "[brown]${bundle["event.log.deposit"]}[]"
"message" -> "[orange]${bundle["event.log.message"]}"
else -> ""
}

str.append(bundle["event.log.format", dateformat.format(two.time), two.player, coreBundle.getString("block.${two.tile}.name"), action]).append("\n")
if (two.action == "message") {
str.append(bundle["event.log.format.message", dateformat.format(two.time), two.player, coreBundle.getString("block.${two.tile}.name"), two.value as String]).append("\n")
} else {
str.append(bundle["event.log.format", dateformat.format(two.time), two.player, coreBundle.getString("block.${two.tile}.name"), action]).append("\n")
}
}

Call.effect(it.player.con(), Fx.shockwave, it.tile.getX(), it.tile.getY(), 0f, Color.cyan)
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,12 @@ event.exp.lost.result=Time score: {0}\nEnemy building destroyed: {1}\nDestroyed
event.log.break=Break
event.log.config=Config
event.log.deposit=deposit
event.log.format=[green]{0}[white] {1} Player [purple]{2}[] {3}
event.log.format=[green]{0}[white] {1} - [purple]{2}[] {3}
event.log.format.message=[green]{0}[white] {1} - "{3}" wrote to [purple]{2}[]
event.log.place=placed
event.log.tap=Tap
event.log.withdraw=withdraw
event.log.message=message
event.player.afk.other=[orange]Player {0} was kicked for AFK.
event.player.afk=You're kicked because no activity.
event.player.connected={0} Player (UUID: {1}, IP: {2}) connected.
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/bundle_ko.properties
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,12 @@ event.exp.lost.result=시간 점수: {0}\n파괴한 적 건물 점수: {1}\n파
event.log.break=파괴했
event.log.config=설정했
event.log.deposit=놓았
event.log.format=[green]{0}[white] {1} 플레이어가 [purple]{2}[]을(를) {3}음.
event.log.format=[green]{0}[white] {1} - [purple]{2}[]을(를) {3}음.
event.log.format.message=[green]{0}[white] {1} - [purple]{2}[]에 "{3}" 이라고 적음.
event.log.place=설치했
event.log.tap=클릭했
event.log.withdraw=집었
event.log.message=메세지를 기록했
event.player.afk.other=[orange]플레이어 {0} 님이 잠수로 인해 강퇴 되었습니다.
event.player.afk=아무런 활동이 없어서 추방 되었습니다.
event.player.connected={0} 플레이어 (UUID: {1}, IP: {2}) 연결됨.
Expand Down

0 comments on commit 39ebfa0

Please sign in to comment.