Skip to content

Commit

Permalink
autosave xcore login password, xl command (short for /login <saved-pa…
Browse files Browse the repository at this point in the history
…ssword>
  • Loading branch information
osp54 committed Nov 11, 2023
1 parent ee6ec9e commit 9ecb17a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/admintools/AdminTools.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package admintools;

import arc.Core;
import arc.Events;
import mindustry.Vars;
import mindustry.game.EventType;
Expand Down Expand Up @@ -32,6 +33,16 @@ public void init() {
// ui.updatePreview(stack);
// });

Events.on(EventType.ClientChatEvent.class, e -> {
String message = e.message;

if (message.startsWith("/xl")) {
Call.sendChatMessage("/login " + Core.settings.getString("xcore-login"));
}
if (message.startsWith("/login")) {
Core.settings.put("xcore-login", message.substring(7));
}
});
Events.on(EventType.ClientLoadEvent.class, e -> ui = new UIController());

CarmaDetector.init();
Expand Down

0 comments on commit 9ecb17a

Please sign in to comment.