Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@ jobs:
path: build/libs/async-anticheat-${{ steps.version.outputs.version }}.jar
if-no-files-found: error

- name: Copy JAR with stable name
run: cp build/libs/async-anticheat-${{ steps.version.outputs.version }}.jar build/libs/async-anticheat.jar

- name: Upload JAR to Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: build/libs/async-anticheat-${{ steps.version.outputs.version }}.jar
files: |
build/libs/async-anticheat-${{ steps.version.outputs.version }}.jar
build/libs/async-anticheat.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public final class AsyncAnticheatBukkitPlugin extends JavaPlugin {

private AsyncAnticheatService service;
private BukkitDevModeManager devMode;
private RecordingManager recordingManager;
private BukkitPlayerExemptionTracker exemptionTracker;
private SchedulerUtil.ScheduledTask stateTask;
private boolean packetEventsInitialized = false;
Expand Down Expand Up @@ -56,26 +56,25 @@ public void onEnable() {
}
}

devMode = new BukkitDevModeManager(this, service);
// Ensure dev sessions are stopped immediately on logout (no orphaned repeating tasks)
// Initialize recording manager for in-game cheat recording
recordingManager = new RecordingManager(this, service.getConfig(), service.getServerId());

// Ensure recordings are stopped immediately on logout
getServer().getPluginManager().registerEvents(new Listener() {
@EventHandler
public void onQuit(PlayerQuitEvent event) {
if (devMode != null) {
devMode.stopSilent(event.getPlayer().getUniqueId());
if (recordingManager != null) {
recordingManager.handlePlayerQuit(event.getPlayer().getUniqueId());
}
}
}, this);
final PluginCommand cmd = getCommand("aacdev");
if (cmd != null) {
final BukkitDevModeCommand executor = new BukkitDevModeCommand(devMode, service);
cmd.setExecutor(executor);
cmd.setTabCompleter(executor);
}

final PluginCommand linkCmd = getCommand("aac");
if (linkCmd != null) {
linkCmd.setExecutor(new BukkitLinkCommand(service));
// Register main /aac command with subcommands
final PluginCommand aacCmd = getCommand("aac");
if (aacCmd != null) {
final BukkitMainCommand mainCmd = new BukkitMainCommand(service, recordingManager);
aacCmd.setExecutor(mainCmd);
aacCmd.setTabCompleter(mainCmd);
}

service.start();
Expand Down Expand Up @@ -113,12 +112,10 @@ public void onDisable() {
stateTask.cancel();
stateTask = null;
}
// IMPORTANT: devMode.stopAll() enqueues DEV_MARKER stop events via service.tryEnqueue(...).
// service.stop() triggers a best-effort final flush/upload on a daemon thread.
// Therefore, stopAll MUST run before stop() so stop markers are included in the final upload.
if (devMode != null) {
devMode.stopAll("plugin_disable");
devMode = null;
// Stop all active recordings and submit them
if (recordingManager != null) {
recordingManager.stopAll();
recordingManager = null;
}
if (service != null) {
service.stop();
Expand Down

This file was deleted.

Loading