make trusted broadcast log in console

This commit is contained in:
Chayapak 2023-04-25 12:52:42 +07:00
parent 090d38610c
commit 189aee90f9
3 changed files with 21 additions and 14 deletions

View file

@ -4,11 +4,10 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="i forgor 1 thing lmfao"> <list default="true" id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="gex">
<change afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/SeenCommand.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/LoggerPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/LoggerPlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PlayersPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PlayersPlugin.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TrustedPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TrustedPlugin.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -100,13 +99,6 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1680245437032</updated> <updated>1680245437032</updated>
</task> </task>
<task id="LOCAL-00070" summary="improve rtp">
<created>1681638481198</created>
<option name="number" value="00070" />
<option name="presentableId" value="LOCAL-00070" />
<option name="project" value="LOCAL" />
<updated>1681638481198</updated>
</task>
<task id="LOCAL-00071" summary="forgor that i used displayname"> <task id="LOCAL-00071" summary="forgor that i used displayname">
<created>1681638788599</created> <created>1681638788599</created>
<option name="number" value="00071" /> <option name="number" value="00071" />
@ -443,7 +435,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1682343832831</updated> <updated>1682343832831</updated>
</task> </task>
<option name="localTasksCounter" value="119" /> <task id="LOCAL-00119" summary="gex">
<created>1682401544373</created>
<option name="number" value="00119" />
<option name="presentableId" value="LOCAL-00119" />
<option name="project" value="LOCAL" />
<updated>1682401544374</updated>
</task>
<option name="localTasksCounter" value="120" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
@ -458,7 +457,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="readme i guess" />
<MESSAGE value="change a bit mabe" /> <MESSAGE value="change a bit mabe" />
<MESSAGE value="improve reconnect i guess" /> <MESSAGE value="improve reconnect i guess" />
<MESSAGE value="make better console logging like the old js chomens bot" /> <MESSAGE value="make better console logging like the old js chomens bot" />
@ -483,7 +481,8 @@
<MESSAGE value="thanks blackilykat for solving the thing.,.,.,&#10;yes just change the thing to null and its all done" /> <MESSAGE value="thanks blackilykat for solving the thing.,.,.,&#10;yes just change the thing to null and its all done" />
<MESSAGE value="fix chomens bot crsah exploit 2023 working" /> <MESSAGE value="fix chomens bot crsah exploit 2023 working" />
<MESSAGE value="i forgor 1 thing lmfao" /> <MESSAGE value="i forgor 1 thing lmfao" />
<option name="LAST_COMMIT_MESSAGE" value="i forgor 1 thing lmfao" /> <MESSAGE value="gex" />
<option name="LAST_COMMIT_MESSAGE" value="gex" />
</component> </component>
<component name="XSLT-Support.FileAssociations.UIState"> <component name="XSLT-Support.FileAssociations.UIState">
<expand /> <expand />

View file

@ -81,6 +81,12 @@ public class LoggerPlugin extends ChatPlugin.ChatListener {
bot.console().reader().printAbove(message); bot.console().reader().printAbove(message);
} }
public void custom (Component prefix, Component _message) {
final String message = prefix(prefix, ComponentUtilities.stringifyAnsi(_message));
bot.console().reader().printAbove(message);
}
@Override @Override
public void systemMessageReceived(Component component) { public void systemMessageReceived(Component component) {
final String ansiMessage = ComponentUtilities.stringifyAnsi(component); final String ansiMessage = ComponentUtilities.stringifyAnsi(component);

View file

@ -26,6 +26,8 @@ public class TrustedPlugin extends PlayersPlugin.PlayerListener {
for (Bot bot : bot.allBots()) { for (Bot bot : bot.allBots()) {
if (!bot.loggedIn()) continue; if (!bot.loggedIn()) continue;
bot.logger().custom(Component.text("Trusted Broadcast").color(NamedTextColor.AQUA), message);
for (String player : list) { for (String player : list) {
final MutablePlayerListEntry entry = bot.players().getEntry(player); final MutablePlayerListEntry entry = bot.players().getEntry(player);