Class SessionManager

java.lang.Object
me.agent.vgui.core.internal.SessionManager

public final class SessionManager extends Object
Owns all view sessions: opening, closing, navigation history, packet pushes and global listener dispatch. Operations for one player are serialized, including lifecycle, click and scheduled callbacks. Reentrant callbacks may transition to a different view; the outer operation then observes that it is stale and stops.
  • Constructor Details

  • Method Details

    • open

      public void open(com.velocitypowered.api.proxy.Player player, View view, ViewContext context, boolean pushHistory)
      Opens a view. Replaces any current session without close-window flicker; when pushHistory is set the replaced view goes onto the player's back-stack.
    • close

      public void close(com.velocitypowered.api.proxy.Player player)
      Closes the player's session (server-initiated), sending a close packet.
    • clientClosed

      public void clientClosed(ViewSession expected)
      The client told us it closed this exact window.
    • clientClosed

      public void clientClosed(UUID uuid)
      Compatibility overload that closes whichever session is current at dispatch.
    • overridden

      public void overridden(ViewSession expected)
      A backend server took over the player's screen.
    • overridden

      public void overridden(UUID uuid)
      Atomically lets a backend window take ownership from the current proxy view.
    • disconnected

      public void disconnected(UUID uuid)
      The player disconnected from the proxy.
    • closeAll

      public void closeAll(CloseReason reason)
      Closes every session. Shutdown permanently rejects any callback-driven reopen.
    • back

      public boolean back(com.velocitypowered.api.proxy.Player player)
      Reopens the previous view in the player's history, if any.
    • backendSwitchStarted

      public void backendSwitchStarted(UUID uuid)
      Invalidates backend-scoped state before a connection attempt.
    • backendConnected

      public void backendConnected(UUID uuid)
      Activates the latest backend generation after Velocity finishes connecting.
    • backendSwitchAborted

      public void backendSwitchAborted(UUID uuid)
      Releases the open gate after a failed backend connection attempt.
    • getSession

      public ViewSession getSession(UUID uuid)
    • addListener

      public void addListener(VGuiListener listener)
    • removeListener

      public void removeListener(VGuiListener listener)