Class ClajRoutines
java.lang.Object
com.xpdustry.claj.server.ClajRoutines
Class holding caches and CLaJ routines, such as cleaning AddressRater, closing afk rooms, pending request, etc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal arc.struct.LongMap<arc.util.Timer.Task> Used to calculate whether a room is afk or not.final arc.struct.ObjectMap<com.xpdustry.claj.common.status.ClajType, ClajRoutines.CachedRoomList> Cache for room list requests.final arc.struct.LongMap<arc.struct.Seq<ClajConnection>> List of client who requested the state of a room that was outdated.final arc.struct.LongMap<arc.util.Timer.Task> Use cleaner task instead of storing thependingInfoRequestsinvert, to avoid having to many caches.final arc.struct.ObjectMap<InetAddress, ClajRoutines.AddressRater> List of join, info and list request rates by ip. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelRoomAfk(ClajRoom room) voidcancelRoomInfoTask(ClajRoom room) voidclearCaches(arc.func.Cons2<ClajConnection, Long> infoRejection) voidvoidclearRoomCache(ClajRoom room, boolean removeList) voidclearRoomListCache(com.xpdustry.claj.common.status.ClajType type) protected ClajRoutines.CachedRoomListgetListCache(com.xpdustry.claj.common.status.ClajType type, arc.struct.LongMap<ClajRoom> fallbackRooms) arc.struct.Seq<ClajConnection> arc.struct.Seq<ClajConnection> booleanrefreshRoomList(com.xpdustry.claj.common.status.ClajType type, boolean force, arc.struct.LongMap<ClajRoom> rooms) voidrefreshRoomList(com.xpdustry.claj.common.status.ClajType type, arc.struct.LongMap<ClajRoom> rooms) voidintrequestRoomList(ClajConnection con, com.xpdustry.claj.common.status.ClajType type, arc.struct.LongMap<ClajRoom> fallbackRooms, arc.func.Cons<Boolean> rejected) booleanrequestRoomState(ClajRoom room, arc.func.Cons<ClajRoom> sendState) voidscheludeRoomAfk(ClajRoom room, Runnable afkClose) booleansendRoomList(com.xpdustry.claj.common.status.ClajType type, boolean force) voidupdateRoom(ClajRoom room, boolean stateChanged)
-
Field Details
-
afk
public final arc.struct.LongMap<arc.util.Timer.Task> afkUsed to calculate whether a room is afk or not. -
rates
List of join, info and list request rates by ip. -
pendingInfoRequests
List of client who requested the state of a room that was outdated. -
pendingInfoTasks
public final arc.struct.LongMap<arc.util.Timer.Task> pendingInfoTasksUse cleaner task instead of storing thependingInfoRequestsinvert, to avoid having to many caches. -
listCache
public final arc.struct.ObjectMap<com.xpdustry.claj.common.status.ClajType, ClajRoutines.CachedRoomList> listCacheCache for room list requests.
-
-
Constructor Details
-
ClajRoutines
public ClajRoutines()
-
-
Method Details
-
clearCaches
-
clearRoomCache
-
clearRoomListCache
public void clearRoomListCache(com.xpdustry.claj.common.status.ClajType type) -
clearClientCache
-
scheludeRoomAfk
-
cancelRoomAfk
-
requestRoomState
-
cancelRoomInfoTask
-
getPendingRoomRequests
-
getPendingRoomRequestsForSend
-
requestRoomList
public int requestRoomList(ClajConnection con, com.xpdustry.claj.common.status.ClajType type, arc.struct.LongMap<ClajRoom> fallbackRooms, arc.func.Cons<Boolean> rejected) -
updateRoom
-
sendRoomList
public boolean sendRoomList(com.xpdustry.claj.common.status.ClajType type, boolean force) -
refreshRoomList
public boolean refreshRoomList(com.xpdustry.claj.common.status.ClajType type, boolean force, arc.struct.LongMap<ClajRoom> rooms) -
refreshRoomList
public void refreshRoomList(com.xpdustry.claj.common.status.ClajType type, arc.struct.LongMap<ClajRoom> rooms) -
getListCache
protected ClajRoutines.CachedRoomList getListCache(com.xpdustry.claj.common.status.ClajType type, arc.struct.LongMap<ClajRoom> fallbackRooms) -
getAddressRate
-
removeAddressRate
-