|
|||||||||
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 CMObject
ID
in class StdLibrary
public int getNumChannels()
ChannelsLibrary
getNumChannels
in interface ChannelsLibrary
ChannelsLibrary.getChannelIndex(String)
public ChannelsLibrary.CMChannel getChannel(int channelNumber)
ChannelsLibrary
getChannel
in interface ChannelsLibrary
channelNumber
- 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 ChannelsLibrary
name
- 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 ChannelsLibrary
channelNumber
- 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 ChannelsLibrary
sender
- 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 ChannelsLibrary
sender
- 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 ChannelsLibrary
sender
- 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 ChannelsLibrary
M
- 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 ChannelsLibrary
channelNumber
- 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 ChannelsLibrary
channelName
- the channel string to search for
ChannelsLibrary.getNumChannels()
public int getChannelCodeNumber(java.lang.String channelName)
ChannelsLibrary
getChannelCodeNumber
in interface ChannelsLibrary
channelName
- the name of the channel
public java.lang.String findChannelName(java.lang.String channelName)
ChannelsLibrary
findChannelName
in interface ChannelsLibrary
channelName
- the channel string to search for
ChannelsLibrary.getNumChannels()
public java.util.List<java.lang.String> getFlaggedChannelNames(ChannelsLibrary.ChannelFlag flag)
ChannelsLibrary
getFlaggedChannelNames
in interface ChannelsLibrary
flag
- the flag to find channels for
ChannelsLibrary.ChannelFlag
public java.lang.String getExtraChannelDesc(java.lang.String channelName)
ChannelsLibrary
getExtraChannelDesc
in interface ChannelsLibrary
channelName
- the name of the channel
public java.util.List<ChannelsLibrary.CMChannel> getIMC2ChannelsList()
ChannelsLibrary
getIMC2ChannelsList
in interface ChannelsLibrary
public java.util.List<ChannelsLibrary.CMChannel> getI3ChannelsList()
ChannelsLibrary
getI3ChannelsList
in interface ChannelsLibrary
public java.lang.String[] getChannelNames()
ChannelsLibrary
getChannelNames
in interface ChannelsLibrary
ChannelsLibrary.getNumChannels()
public java.util.List<Session> clearInvalidSnoopers(Session mySession, int channelCode)
ChannelsLibrary
clearInvalidSnoopers
in interface ChannelsLibrary
mySession
- 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 ChannelsLibrary
mySession
- 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 ChannelsLibrary
list
- 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 ChannelsLibrary
ses
- 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 ChannelsLibrary
mob
- 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 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 Tickable
Tickable
,
ServiceEngine
,
TickableGroup
public boolean shutdown()
CMLibrary
shutdown
in interface CMLibrary
shutdown
in class StdLibrary
CMLibrary.activate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |