|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.Libraries.StdLibrary
com.planet_ink.coffee_mud.Libraries.CMChannels
public class CMChannels
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.ChannelsLibrary |
|---|
ChannelsLibrary.ChannelFlag, ChannelsLibrary.ChannelMsg, ChannelsLibrary.CMChannel |
| Field Summary | |
|---|---|
java.lang.String[] |
baseChannelNames
|
java.util.List<ChannelsLibrary.CMChannel> |
channelList
|
protected Language |
commonLang
|
static java.util.Set<ChannelsLibrary.ChannelFlag> |
emptyFlags
|
static java.util.List<ChannelsLibrary.ChannelMsg> |
emptyQueue
|
int |
QUEUE_SIZE
|
| Fields inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary |
|---|
isDebugging, name, serviceClient, tickStatus |
| Constructor Summary | |
|---|---|
CMChannels()
|
|
| Method Summary | |
|---|---|
boolean |
activate()
Activates the library. |
void |
channelQueUp(int channelNumber,
CMMsg msg)
Adds the given channel message CMMsg event message to the que for the given channel number. |
java.util.List<Session> |
clearInvalidSnoopers(Session mySession,
int channelCode)
Searches all users online for any sessions that are snooping on the given session, and also are not permitted to read the given channel number. |
void |
createAndSendChannelMessage(MOB mob,
java.lang.String channelName,
java.lang.String message,
boolean systemMsg)
Creates and sends the given string message on the channel with the given name to all sessions who are allowed to receive the message from the given sender. |
ChannelsLibrary.CMChannel |
createNewChannel(java.lang.String name)
|
ChannelsLibrary.CMChannel |
createNewChannel(java.lang.String name,
java.lang.String mask,
java.util.Set<ChannelsLibrary.ChannelFlag> flags,
java.lang.String colorOverrideANSI,
java.lang.String colorOverrideWords)
|
ChannelsLibrary.CMChannel |
createNewChannel(java.lang.String name,
java.lang.String i3Name,
java.lang.String imc2Name,
java.lang.String mask,
java.util.Set<ChannelsLibrary.ChannelFlag> flags,
java.lang.String colorOverrideANSI,
java.lang.String colorOverrideWords)
Creates a new channel object. |
java.lang.String |
findChannelName(java.lang.String channelName)
Returns the official channel name of the channel with the given name or which starts with the given name. |
ChannelsLibrary.CMChannel |
getChannel(int channelNumber)
Returns the CMChannel object for the given registered channel from 0 - getNumChannels(); Basically this is almost all you need, but there's more.... |
int |
getChannelCodeNumber(java.lang.String channelName)
Returns the bitmask appropriate to the channel of the given name, or which starts with the given string. |
int |
getChannelIndex(java.lang.String channelName)
Returns the official index number of the channel with the given name or which starts with the given name. |
java.lang.String[] |
getChannelNames()
Returns an array of all the names of all the channels. |
java.util.List<ChannelsLibrary.ChannelMsg> |
getChannelQue(int channelNumber,
int numNewToSkip,
int numToReturn)
Generates a list of previous channel messages, in ChannelMsg object format. |
protected Language |
getCommonLanguage()
|
java.lang.String |
getExtraChannelDesc(java.lang.String channelName)
Returns the friendly readable description of the channel with the given name, or which starts with the given string. |
java.util.List<java.lang.String> |
getFlaggedChannelNames(ChannelsLibrary.ChannelFlag flag)
Returns the list of channel names that have the given ChannelFlag set. |
java.util.List<ChannelsLibrary.CMChannel> |
getI3ChannelsList()
Returns all the CMChannel objects for any channels flagged as being mapped to I3. |
java.util.List<ChannelsLibrary.CMChannel> |
getIMC2ChannelsList()
Returns all the CMChannel objects for any channels flagged as being mapped to IMC2. |
int |
getNumChannels()
Returns the number of registered channels |
java.lang.String |
ID()
The CoffeeMud Java Class ID shared by all instances of this object. |
int |
loadChannels(java.lang.String list,
java.lang.String ilist,
java.lang.String imc2list)
Clears the channels list and then reloads it from the three given comma-delimited list of coded strings. |
boolean |
mayReadThisChannel(MOB sender,
boolean areaReq,
MOB M,
int channelNumber)
Returns whether the given Mob can read a channel message from the given sender, on a particular channel. |
boolean |
mayReadThisChannel(MOB sender,
boolean areaReq,
MOB M,
int channelNumber,
boolean offlineOK)
Returns whether the given Mob can read a channel message from the given sender, on a particular channel. |
boolean |
mayReadThisChannel(MOB sender,
boolean areaReq,
Session ses,
int channelNumber)
Returns whether the given Mob can read a channel message from the given sender, on a particular channel. |
boolean |
mayReadThisChannel(MOB M,
int channelNumber,
boolean zapCheckOnly)
Returns whether the given Mob can read a channel message from the given sender, on a particular channel. |
java.lang.String |
parseOutFlags(java.lang.String mask,
java.util.Set<ChannelsLibrary.ChannelFlag> flags,
java.lang.String[] colorOverride)
|
void |
restoreInvalidSnoopers(Session mySession,
java.util.List<Session> invalid)
Iterates through the given list of sessions and forces them all to snoop on the given session. |
boolean |
sendChannelCMMsgTo(Session ses,
boolean areareq,
int channelInt,
CMMsg msg,
MOB sender)
Sends the given channel message from the given sender to the given session on the given channelNumbered channel. |
boolean |
shutdown()
Shuts down the library. |
boolean |
tick(Tickable ticking,
int tickID)
this is the method which is called periodically by the threading engine. |
| Methods inherited from class com.planet_ink.coffee_mud.Libraries.StdLibrary |
|---|
checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary |
|---|
getServiceClient, L, propertiesLoaded |
| Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
|---|
copyOf, initializeClass, name, newInstance |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
public final int QUEUE_SIZE
public java.lang.String[] baseChannelNames
public java.util.List<ChannelsLibrary.CMChannel> channelList
protected Language commonLang
public static final java.util.List<ChannelsLibrary.ChannelMsg> emptyQueue
public static final java.util.Set<ChannelsLibrary.ChannelFlag> emptyFlags
| Constructor Detail |
|---|
public CMChannels()
| Method Detail |
|---|
public java.lang.String ID()
CMObject
ID in interface CMObjectID in class StdLibrarypublic int getNumChannels()
ChannelsLibrary
getNumChannels in interface ChannelsLibraryChannelsLibrary.getChannelIndex(String)public ChannelsLibrary.CMChannel getChannel(int channelNumber)
ChannelsLibrary
getChannel in interface ChannelsLibrarychannelNumber - the index of the channel
ChannelsLibrary.getNumChannels()public ChannelsLibrary.CMChannel createNewChannel(java.lang.String name)
public ChannelsLibrary.CMChannel createNewChannel(java.lang.String name,
java.lang.String mask,
java.util.Set<ChannelsLibrary.ChannelFlag> flags,
java.lang.String colorOverrideANSI,
java.lang.String colorOverrideWords)
public ChannelsLibrary.CMChannel createNewChannel(java.lang.String name,
java.lang.String i3Name,
java.lang.String imc2Name,
java.lang.String mask,
java.util.Set<ChannelsLibrary.ChannelFlag> flags,
java.lang.String colorOverrideANSI,
java.lang.String colorOverrideWords)
ChannelsLibrary
createNewChannel in interface ChannelsLibraryname - the channel namei3Name - empty string, or the mapped name of the i3 channelimc2Name - empty string, or the mapped name of the imc2 channelmask - the zapper mask for who may read the channelflags - the channel flags to set for the given channelcolorOverrideANSI - empty string for default, or the color code for this channelcolorOverrideWords - empty string for default, or the color code for this channel
ChannelsLibrary.CMChannel,
ChannelsLibrary.ChannelFlag
public java.util.List<ChannelsLibrary.ChannelMsg> getChannelQue(int channelNumber,
int numNewToSkip,
int numToReturn)
ChannelsLibrary
getChannelQue in interface ChannelsLibrarychannelNumber - the channel id number/indexnumNewToSkip - starting message number (0 based)numToReturn - total number of messages to return
ChannelsLibrary.getChannelIndex(String),
ChannelsLibrary.ChannelMsg
public boolean mayReadThisChannel(MOB sender,
boolean areaReq,
MOB M,
int channelNumber)
ChannelsLibrary
mayReadThisChannel in interface ChannelsLibrarysender - the sender of the channel messageareaReq - true if the message can only be read by someone in the senders AreaM - the potential receiver of the message to confirmchannelNumber - the channel index number
ChannelsLibrary.getNumChannels(),
ChannelsLibrary.mayReadThisChannel(MOB, int, boolean),
ChannelsLibrary.mayReadThisChannel(MOB, boolean, Session, int),
ChannelsLibrary.mayReadThisChannel(MOB, boolean, MOB, int, boolean)
public boolean mayReadThisChannel(MOB sender,
boolean areaReq,
MOB M,
int channelNumber,
boolean offlineOK)
ChannelsLibrary
mayReadThisChannel in interface ChannelsLibrarysender - the sender of the channel messageareaReq - true if the message can only be read by someone in the senders AreaM - the potential receiver of the message to confirmchannelNumber - the channel index numberofflineOK - true if the channel reader can be read, or offline, false if they must be online
ChannelsLibrary.getChannelIndex(String),
ChannelsLibrary.mayReadThisChannel(MOB, int, boolean),
ChannelsLibrary.mayReadThisChannel(MOB, boolean, Session, int),
ChannelsLibrary.mayReadThisChannel(MOB, boolean, MOB, int)
public boolean mayReadThisChannel(MOB sender,
boolean areaReq,
Session ses,
int channelNumber)
ChannelsLibrary
mayReadThisChannel in interface ChannelsLibrarysender - the sender of the channel messageareaReq - true if the message can only be read by someone in the senders Areases - the potential receiver session of the message to confirmchannelNumber - the channel index number
ChannelsLibrary.getNumChannels(),
ChannelsLibrary.mayReadThisChannel(MOB, int, boolean),
ChannelsLibrary.mayReadThisChannel(MOB, boolean, MOB, int),
ChannelsLibrary.mayReadThisChannel(MOB, boolean, MOB, int, boolean)
public boolean mayReadThisChannel(MOB M,
int channelNumber,
boolean zapCheckOnly)
ChannelsLibrary
mayReadThisChannel in interface ChannelsLibraryM - the potential receiver of the message to confirmchannelNumber - the channel index numberzapCheckOnly - the channel index number
ChannelsLibrary.getChannelIndex(String),
ChannelsLibrary.mayReadThisChannel(MOB, boolean, MOB, int),
ChannelsLibrary.mayReadThisChannel(MOB, boolean, Session, int),
ChannelsLibrary.mayReadThisChannel(MOB, boolean, MOB, int, boolean)
public void channelQueUp(int channelNumber,
CMMsg msg)
ChannelsLibrary
channelQueUp in interface ChannelsLibrarychannelNumber - the channel index numbermsg - the channel message msg that was sent aroundChannelsLibrary.getNumChannels(),
ChannelsLibrary.getChannelIndex(String)public int getChannelIndex(java.lang.String channelName)
ChannelsLibrary
getChannelIndex in interface ChannelsLibrarychannelName - the channel string to search for
ChannelsLibrary.getNumChannels()public int getChannelCodeNumber(java.lang.String channelName)
ChannelsLibrary
getChannelCodeNumber in interface ChannelsLibrarychannelName - the name of the channel
public java.lang.String findChannelName(java.lang.String channelName)
ChannelsLibrary
findChannelName in interface ChannelsLibrarychannelName - the channel string to search for
ChannelsLibrary.getNumChannels()public java.util.List<java.lang.String> getFlaggedChannelNames(ChannelsLibrary.ChannelFlag flag)
ChannelsLibrary
getFlaggedChannelNames in interface ChannelsLibraryflag - the flag to find channels for
ChannelsLibrary.ChannelFlagpublic java.lang.String getExtraChannelDesc(java.lang.String channelName)
ChannelsLibrary
getExtraChannelDesc in interface ChannelsLibrarychannelName - the name of the channel
public java.util.List<ChannelsLibrary.CMChannel> getIMC2ChannelsList()
ChannelsLibrary
getIMC2ChannelsList in interface ChannelsLibrarypublic java.util.List<ChannelsLibrary.CMChannel> getI3ChannelsList()
ChannelsLibrary
getI3ChannelsList in interface ChannelsLibrarypublic java.lang.String[] getChannelNames()
ChannelsLibrary
getChannelNames in interface ChannelsLibraryChannelsLibrary.getNumChannels()
public java.util.List<Session> clearInvalidSnoopers(Session mySession,
int channelCode)
ChannelsLibrary
clearInvalidSnoopers in interface ChannelsLibrarymySession - the session to search for snoopers ofchannelCode - the channel number to cross reference snoopers by
ChannelsLibrary.getNumChannels(),
ChannelsLibrary.restoreInvalidSnoopers(Session, List)
public void restoreInvalidSnoopers(Session mySession,
java.util.List<Session> invalid)
ChannelsLibrary
restoreInvalidSnoopers in interface ChannelsLibrarymySession - the session to search restoring snooping oninvalid - the list of sessions to force resnoopingChannelsLibrary.clearInvalidSnoopers(Session, int)
public java.lang.String parseOutFlags(java.lang.String mask,
java.util.Set<ChannelsLibrary.ChannelFlag> flags,
java.lang.String[] colorOverride)
public int loadChannels(java.lang.String list,
java.lang.String ilist,
java.lang.String imc2list)
ChannelsLibrary
loadChannels in interface ChannelsLibrarylist - the main game channel listilist - the list of i3 channelsimc2list - the list of imc2 channels
public boolean sendChannelCMMsgTo(Session ses,
boolean areareq,
int channelInt,
CMMsg msg,
MOB sender)
ChannelsLibrary
sendChannelCMMsgTo in interface ChannelsLibraryses - the session to send the channel message toareareq - true if the sender and session must be in the same area, false otherwisechannelInt - the channel index number of the messagemsg - the constructed CMMsg channel messagesender - the sender of the channel message
ChannelsLibrary.getNumChannels(),
ChannelsLibrary.createAndSendChannelMessage(MOB, String, String, boolean)
public void createAndSendChannelMessage(MOB mob,
java.lang.String channelName,
java.lang.String message,
boolean systemMsg)
ChannelsLibrary
createAndSendChannelMessage in interface ChannelsLibrarymob - the sender of the messagechannelName - the name of the channel to send the message onmessage - the string message to send on the channelsystemMsg - true to format as a system message, false for a normal chat messageChannelsLibrary.sendChannelCMMsgTo(Session, boolean, int, CMMsg, MOB)protected Language getCommonLanguage()
public boolean activate()
CMLibrary
activate in interface CMLibraryactivate in class StdLibraryCMLibrary.shutdown()
public boolean tick(Tickable ticking,
int tickID)
Tickable
tick in interface Tickabletick in class StdLibraryticking - a reference to this Tickable objecttickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Tickable,
ServiceEngine,
TickableGrouppublic boolean shutdown()
CMLibrary
shutdown in interface CMLibraryshutdown in class StdLibraryCMLibrary.activate()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||