Class SessionManager
java.lang.Object
me.agent.vgui.core.internal.SessionManager
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 Summary
ConstructorsConstructorDescriptionSessionManager(org.slf4j.Logger logger, WindowIdAllocator idAllocator, InventoryTracker inventoryTracker, UpdateScheduler updateScheduler) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(VGuiListener listener) booleanback(com.velocitypowered.api.proxy.Player player) Reopens the previous view in the player's history, if any.voidbackendConnected(UUID uuid) Activates the latest backend generation after Velocity finishes connecting.voidbackendSwitchAborted(UUID uuid) Releases the open gate after a failed backend connection attempt.voidbackendSwitchStarted(UUID uuid) Invalidates backend-scoped state before a connection attempt.voidclientClosed(UUID uuid) Compatibility overload that closes whichever session is current at dispatch.voidclientClosed(ViewSession expected) The client told us it closed this exact window.voidclose(com.velocitypowered.api.proxy.Player player) Closes the player's session (server-initiated), sending a close packet.voidcloseAll(CloseReason reason) Closes every session.voiddisconnected(UUID uuid) The player disconnected from the proxy.getSession(UUID uuid) voidopen(com.velocitypowered.api.proxy.Player player, View view, ViewContext context, boolean pushHistory) Opens a view.voidoverridden(UUID uuid) Atomically lets a backend window take ownership from the current proxy view.voidoverridden(ViewSession expected) A backend server took over the player's screen.voidremoveListener(VGuiListener listener)
-
Constructor Details
-
SessionManager
public SessionManager(org.slf4j.Logger logger, WindowIdAllocator idAllocator, InventoryTracker inventoryTracker, UpdateScheduler updateScheduler)
-
-
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; whenpushHistoryis 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
The client told us it closed this exact window. -
clientClosed
Compatibility overload that closes whichever session is current at dispatch. -
overridden
A backend server took over the player's screen. -
overridden
Atomically lets a backend window take ownership from the current proxy view. -
disconnected
The player disconnected from the proxy. -
closeAll
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
Invalidates backend-scoped state before a connection attempt. -
backendConnected
Activates the latest backend generation after Velocity finishes connecting. -
backendSwitchAborted
Releases the open gate after a failed backend connection attempt. -
getSession
-
addListener
-
removeListener
-