Skip to content

Add Sentinel group leader map-only tracking#294

Open
T9knauf wants to merge 1 commit into
dm94:masterfrom
T9knauf:sentinel-group-leader-map-only
Open

Add Sentinel group leader map-only tracking#294
T9knauf wants to merge 1 commit into
dm94:masterfrom
T9knauf:sentinel-group-leader-map-only

Conversation

@T9knauf
Copy link
Copy Markdown

@T9knauf T9knauf commented May 10, 2026

Summary

  • add an optional Sentinel groupLeaderMapOnly mode that travels to the group leader map without forcing coordinate-follow or attack mirroring
  • make group target selection deterministic using the documented priority: Master ID > Tag > Group Leader
  • add English and Turkish config labels for the new option

Verification

  • git diff --check
  • gradle build --console=plain was attempted with a local Gradle 8.7 distribution, but the repository currently cannot resolve existing dependency eu.darkbot:DarkBot:97430f3417 from Maven/JitPack.

/claim #224

Summary by Sourcery

Add an optional Sentinel mode that only tracks the group leader’s map while making group target selection follow a deterministic priority and localizing the new option.

New Features:

  • Introduce a Sentinel configuration option to track only the group leader’s map without mirroring movement or attacks.

Enhancements:

  • Refine group master selection to use a deterministic priority order: configured master ID, then tagged master, then group leader.

Documentation:

  • Add English and Turkish configuration labels and descriptions for the new group leader map-only option.

@opirebot
Copy link
Copy Markdown

opirebot Bot commented May 10, 2026

😅 Ups... the issue does not have any reward yet!

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 10, 2026

Reviewer's Guide

Introduces an optional Sentinel "group leader map-only" tracking mode, refactors group target selection to be deterministic by Master ID > Tag > Group Leader, and wires the new option into configuration and i18n strings.

Sequence diagram for deterministic group targeting and map-only tracking

sequenceDiagram
    actor Player
    participant SentinelModule
    participant Group
    participant GroupMember
    participant HeroApi
    participant StarSystem
    participant MapModule

    Player->>SentinelModule: onTickModule()
    SentinelModule->>Group: hasGroup()
    alt has group
        SentinelModule->>Group: getMembers()
        SentinelModule->>SentinelModule: updateGroupLeaderId()
        SentinelModule->>SentinelModule: hasSentinel()
        alt sentinel present
            SentinelModule->>SentinelModule: updateLastMap()
            SentinelModule->>SentinelModule: isGroupLeaderMapOnlyActive()
            alt group leader map-only active (sentinel view)
                SentinelModule->>SentinelModule: trackLeaderMapOnly()
                SentinelModule->>SentinelModule: setMode(configRoam)
                SentinelModule->>SentinelModule: collectorModule.onTickModule() [if collectorActive]
            else normal behavior
                SentinelModule->>SentinelModule: isAttacking()
                alt attacking
                    SentinelModule->>SentinelModule: attackLogic()
                else not attacking
                    SentinelModule->>SentinelModule: followByPortals()
                end
            end
        end
    end

    Player->>SentinelModule: goToGroup()
    SentinelModule->>Group: getMembers()
    SentinelModule->>SentinelModule: getGroupMaster()
    alt master by MASTER_ID
        SentinelModule->>GroupMember: isLivingGroupMember()
    else master by SENTINEL_TAG
        SentinelModule->>GroupMember: isLivingGroupMember()
    else master by group leader
        SentinelModule->>GroupMember: isLeader()
    end

    alt master found
        SentinelModule->>GroupMember: isLeader()
        alt member is leader
            SentinelModule->>SentinelModule: groupLeaderID = member.id
        end
        SentinelModule->>SentinelModule: masterID = member.id
        SentinelModule->>HeroApi: getMap()
        alt same map
            SentinelModule->>SentinelModule: lastSentinelLocation = member.location
            SentinelModule->>SentinelModule: isGroupLeaderMapOnlyActive(member)
            alt map-only active (member view)
                SentinelModule->>SentinelModule: trackLeaderMapOnly()
            else full follow
                SentinelModule->>SentinelModule: movement.moveTo(member.location)
            end
        else different map
            SentinelModule->>StarSystem: findMap(member.mapId)
            StarSystem-->>SentinelModule: GameMap
            SentinelModule->>MapModule: setTarget(map)
        end
    else no master
        SentinelModule-->>Player: no movement (no valid master)
    end
Loading

Class diagram for SentinelModule and SentinelConfig updates

classDiagram
    class SentinelModule {
        - JLabel label
        - State currentStatus
        - long groupLeaderID
        - long masterID
        + onTickModule() void
        - trackLeaderMapOnly() void
        - goToGroup() void
        - getGroupMaster() GroupMember
        - isLivingGroupMember(member GroupMember) boolean
        - updateGroupLeaderId() void
        - isGroupLeaderMapOnlyActive() boolean
        - isGroupLeaderMapOnlyActive(member GroupMember) boolean
    }

    class State {
        <<enum>>
        INIT
        WAIT
        WAIT_GROUP_LOADING
        TRAVELLING_TO_MASTER
        TRACKING_LEADER_MAP
        FOLLOWING_MASTER
        HELPING_MASTER
        TRAVELING_TO_WORKING_MAP
    }

    class SentinelConfig {
        + boolean followGroupLeader
        + boolean groupLeaderMapOnly
        + boolean ignoreSecurity
        + int MASTER_ID
        + Tag SENTINEL_TAG
        + Humanizer humanizer
    }

    class GroupMember {
        + long getId()
        + boolean isLeader()
        + boolean isDead()
        + int getMapId()
        + Location getLocation()
    }

    SentinelModule --> State
    SentinelModule --> SentinelConfig
    SentinelModule --> GroupMember
    SentinelConfig --> Humanizer
    SentinelConfig --> Tag
Loading

Flow diagram for group leader ID update and map-only activation

flowchart TD
    A[Start onTickModule] --> B[updateGroupLeaderId]
    B --> C[Group hasGroup?]
    C -->|No| D[Return]
    C -->|Yes| E[Get members]
    E --> F[Filter by isLivingGroupMember]
    F --> G[Filter by isLeader]
    G --> H[First leader present?]
    H -->|Yes| I[Set groupLeaderID = leader.id]
    H -->|No| D
    I --> J[Set currentStatus and behavior]
    J --> K[isGroupLeaderMapOnlyActive]
    K -->|Yes| L[Set State.TRACKING_LEADER_MAP and trackLeaderMapOnly]
    K -->|No| M[Proceed with normal attack or follow logic]
Loading

File-Level Changes

Change Details Files
Add a map-only tracking mode that sends the bot to the group leader's map without following their coordinates or attacks.
  • Extend SentinelModule state machine with TRACKING_LEADER_MAP and adjust status transitions when group leader map-only mode is active.
  • Add trackLeaderMapOnly helper to set roaming mode and delegate to the collector module when enabled.
  • Update instructions label HTML to document the new map-only behavior.
src/main/java/com/deeme/modules/SentinelModule.java
Refactor group member targeting to be deterministic with priority Master ID > Tag > Group Leader, and decouple leader ID tracking from movement logic.
  • Introduce getGroupMaster helper that applies the MASTER_ID, SENTINEL_TAG, and group leader priority and only considers living non-hero members.
  • Split group leader ID maintenance into updateGroupLeaderId, called every tick when a group exists.
  • Replace previous streaming goToGroup implementation with logic that uses getGroupMaster to set masterID/groupLeaderID, compute lastSentinelLocation, and either move to the member or travel to their map.
  • Replace isGroupMemberValid with isLivingGroupMember plus explicit checks in getGroupMaster, and add predicates for map-only activation based on the current sentinel or a GroupMember.
src/main/java/com/deeme/modules/SentinelModule.java
Expose and localize configuration for the new group leader map-only mode.
  • Add groupLeaderMapOnly boolean option to SentinelConfig with its @option key.
  • Add English and Turkish labels and descriptions for the sentinel.group_leader_map_only option to the properties files.
src/main/java/com/deeme/types/config/SentinelConfig.java
src/main/resources/com/deeme/lang/strings_en.properties
src/main/resources/com/deeme/lang/strings_tr.properties

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant