Class NxGameDataImpl

java.lang.Object
app.l2nx.gs.adapter.core.gamedata.NxGameDataImpl
All Implemented Interfaces:
app.l2nx.gs.adapter.api.spi.NxGameData

public final class NxGameDataImpl extends Object implements app.l2nx.gs.adapter.api.spi.NxGameData
Session-scoped NxGameData façade — a registry of snapshot triggers bound by the gd-sync module during onConnect. Survives reconnect: the captured reference keeps working while the underlying IO executor is swapped on each handshake, and triggers re-register on every fresh connect.

publishSnapshot() fans out to every registered trigger, each run on the adapter IO executor so the caller (host game thread) never blocks on Kafka latency. Catches Throwable from triggers to keep the host thread safe.

  • Constructor Details

    • NxGameDataImpl

      public NxGameDataImpl()
  • Method Details

    • bindExecutor

      public void bindExecutor(Executor io)
      Swap the IO executor used to run triggers. Called by adapter-core on every handshake so the stable façade always dispatches onto the live pool.
    • publishSnapshot

      public void publishSnapshot()
      Specified by:
      publishSnapshot in interface app.l2nx.gs.adapter.api.spi.NxGameData
    • registerSnapshotTrigger

      public void registerSnapshotTrigger(app.l2nx.gs.adapter.api.spi.NxGameDataTrigger trigger)
      Specified by:
      registerSnapshotTrigger in interface app.l2nx.gs.adapter.api.spi.NxGameData
    • clearTriggers

      public void clearTriggers()
      Drop all registered triggers. Called on reconnect so the gd-sync module re-registers cleanly instead of stacking duplicate triggers.