CMObject
, Tickable
, CMLibrary
, SessionsList
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class Sessions extends StdLibrary implements SessionsList
Modifier and Type | Field | Description |
---|---|---|
SLinkedList<Session> |
all |
idConverter
isDebugging, name, serviceClient, tickStatus
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
Sessions() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
activate() |
Activates the library.
|
void |
add(Session s) |
Adds the given session to this manager, to be managed
|
java.lang.Iterable<Session> |
allIterable() |
Returns the sessions for all the sessions
currently managed, logging in or not, from all
hosts running.
|
java.lang.Iterable<Session> |
allIterableAllHosts() |
Returns the sessions for all the sessions
currently managed, logging in or not, from all
hosts running.
|
MOB |
findCharacterOnline(java.lang.String srchStr,
boolean exactOnly) |
Searches online characters whose sessions are managed
by this library, and returns the character mobs.
|
Session |
findCharacterSessionOnline(java.lang.String srchStr,
boolean exactOnly) |
Searches online characters whose sessions are managed
by this library, and returns the session.
|
protected Session |
getAllSessionAt(java.util.Iterator<Session> i,
int index) |
|
protected int |
getCount(java.util.Iterator<Session> i) |
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
boolean |
isSession(Session s) |
Returns whether the given session is still registered here.
|
java.util.Iterator<Session> |
localOnline() |
Returns the sessions for all the online game
characters that are on the map and playing.
|
java.lang.Iterable<Session> |
localOnlineIterable() |
Returns the sessions for all the online game
characters that are on the map and playing.
|
java.lang.Iterable<Session> |
localOnlineIterableAllHosts() |
Returns the sessions for all the online game
characters that are on the map and playing on
a host that uses the given map library.
|
void |
moveSessionToCorrectThreadGroup(Session session,
int theme) |
Determines the correct thread group for the given theme, and marks the
given session appropriately.
|
int |
numLocalOnline() |
The number of char sessions being managed here.
|
int |
numSessions() |
The number of sessions being managed here.
|
void |
remove(Session s) |
Removes the given session from this manager.
|
protected void |
sessionCheck() |
|
java.util.Iterator<Session> |
sessions() |
Returns the sessions for all the sessions
currently managed, logging in or not, from all
hosts running.
|
boolean |
shutdown() |
Shuts down the library.
|
void |
stopSessionAtAllCosts(Session S) |
Given a session, this will attempt to stop
its running thread in every way imaginable
and remove the session from the manager.
|
boolean |
tick(Tickable ticking,
int tickID) |
this is the method which is called periodically by the threading engine.
|
getServiceClient, L, propertiesLoaded
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus
public final SLinkedList<Session> all
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public java.util.Iterator<Session> sessions()
SessionsList
sessions
in interface SessionsList
SessionsList.allIterable()
,
SessionsList.allIterableAllHosts()
,
SessionsList.localOnline()
,
SessionsList.localOnlineIterable()
public java.lang.Iterable<Session> allIterable()
SessionsList
allIterable
in interface SessionsList
SessionsList.sessions()
,
SessionsList.allIterableAllHosts()
,
SessionsList.localOnline()
,
SessionsList.localOnlineIterableAllHosts()
,
SessionsList.localOnlineIterable()
public java.util.Iterator<Session> localOnline()
SessionsList
localOnline
in interface SessionsList
SessionsList.sessions()
,
SessionsList.allIterable()
,
SessionsList.allIterableAllHosts()
,
SessionsList.localOnlineIterableAllHosts()
,
SessionsList.localOnlineIterable()
public java.lang.Iterable<Session> localOnlineIterable()
SessionsList
localOnlineIterable
in interface SessionsList
SessionsList.sessions()
,
SessionsList.allIterable()
,
SessionsList.allIterableAllHosts()
,
SessionsList.localOnlineIterableAllHosts()
,
SessionsList.localOnline()
public java.lang.Iterable<Session> localOnlineIterableAllHosts()
SessionsList
localOnlineIterableAllHosts
in interface SessionsList
SessionsList.sessions()
,
SessionsList.allIterable()
,
SessionsList.allIterableAllHosts()
,
SessionsList.localOnline()
,
SessionsList.localOnlineIterable()
public int numSessions()
SessionsList
numSessions
in interface SessionsList
SessionsList.isSession(Session)
,
SessionsList.add(Session)
,
SessionsList.remove(Session)
,
SessionsList.numLocalOnline()
public java.lang.Iterable<Session> allIterableAllHosts()
SessionsList
allIterableAllHosts
in interface SessionsList
SessionsList.sessions()
,
SessionsList.allIterable()
,
SessionsList.localOnlineIterableAllHosts()
,
SessionsList.localOnline()
,
SessionsList.localOnlineIterable()
public int numLocalOnline()
SessionsList
numLocalOnline
in interface SessionsList
SessionsList.isSession(Session)
,
SessionsList.add(Session)
,
SessionsList.remove(Session)
,
SessionsList.numSessions()
protected int getCount(java.util.Iterator<Session> i)
public void add(Session s)
SessionsList
add
in interface SessionsList
s
- the session to addSessionsList.isSession(Session)
,
SessionsList.add(Session)
,
SessionsList.remove(Session)
,
SessionsList.numSessions()
,
SessionsList.numLocalOnline()
public void remove(Session s)
SessionsList
remove
in interface SessionsList
s
- the session to removeSessionsList.isSession(Session)
,
SessionsList.add(Session)
,
SessionsList.remove(Session)
,
SessionsList.numSessions()
,
SessionsList.numLocalOnline()
public boolean isSession(Session s)
SessionsList
isSession
in interface SessionsList
s
- the session to check forSessionsList.add(Session)
,
SessionsList.remove(Session)
,
SessionsList.numSessions()
,
SessionsList.numLocalOnline()
public void stopSessionAtAllCosts(Session S)
SessionsList
stopSessionAtAllCosts
in interface SessionsList
S
- the session to stop and killprotected void sessionCheck()
public boolean activate()
CMLibrary
activate
in interface CMLibrary
activate
in class StdLibrary
CMLibrary.shutdown()
public boolean tick(Tickable ticking, int tickID)
Tickable
tick
in interface Tickable
tick
in class StdLibrary
ticking
- a reference to this Tickable objecttickID
- the TICKID_ constant describing this periodic call, as defined in TickableTickable
,
ServiceEngine
,
TickableGroup
public boolean shutdown()
CMLibrary
shutdown
in interface CMLibrary
shutdown
in class StdLibrary
CMLibrary.activate()
public MOB findCharacterOnline(java.lang.String srchStr, boolean exactOnly)
SessionsList
findCharacterOnline
in interface SessionsList
srchStr
- the whole or partial char nameexactOnly
- true for whole, false for partial or wholepublic Session findCharacterSessionOnline(java.lang.String srchStr, boolean exactOnly)
SessionsList
findCharacterSessionOnline
in interface SessionsList
srchStr
- the whole or partial char nameexactOnly
- true for whole, false for partial or wholepublic void moveSessionToCorrectThreadGroup(Session session, int theme)
SessionsList
moveSessionToCorrectThreadGroup
in interface SessionsList
session
- the session to movetheme
- the theme of the group to assign it to