|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ChannelsLibrary
The main chat channels management library. This is one of the older libraries in the system, and as such, still reflects the use of indexed vectors that was common. It still makes sense given the way those numbers are used in CMMsg message codes to identify the channels. Over the years, the ability to filter the channels by user was added, along with flags to automatically insert information or enable other parts of the system to generate channel messages.
Nested Class Summary | |
---|---|
static class |
ChannelsLibrary.ChannelFlag
The channel flags that define extra stuff that appears in or gets automatically sent on a given channel. |
static interface |
ChannelsLibrary.ChannelMsg
The entry for the channel que, containing the CMMsg object that was sent as the original message as well as the timestamp when it was sent. |
static interface |
ChannelsLibrary.CMChannel
Basic Channel definition |
Method Summary | |
---|---|
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 channelNumber)
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,
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. |
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 |
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. |
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 channelNumber,
CMMsg msg,
MOB sender)
Sends the given channel message from the given sender to the given session on the given channelNumbered channel. |
Methods inherited from interface com.planet_ink.coffee_mud.Libraries.interfaces.CMLibrary |
---|
activate, getServiceClient, L, propertiesLoaded, shutdown |
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
---|
copyOf, ID, initializeClass, name, newInstance |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Method Detail |
---|
int getNumChannels()
getChannelIndex(String)
ChannelsLibrary.CMChannel getChannel(int channelNumber)
channelNumber
- the index of the channel
getNumChannels()
java.util.List<ChannelsLibrary.ChannelMsg> getChannelQue(int channelNumber, int numNewToSkip, int numToReturn)
channelNumber
- the channel id number/indexnumNewToSkip
- starting message number (0 based)numToReturn
- total number of messages to return
getChannelIndex(String)
,
ChannelsLibrary.ChannelMsg
boolean mayReadThisChannel(MOB sender, boolean areaReq, MOB M, int channelNumber)
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
getNumChannels()
,
mayReadThisChannel(MOB, int, boolean)
,
mayReadThisChannel(MOB, boolean, Session, int)
,
mayReadThisChannel(MOB, boolean, MOB, int, boolean)
boolean mayReadThisChannel(MOB sender, boolean areaReq, MOB M, int channelNumber, boolean offlineOK)
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
getChannelIndex(String)
,
mayReadThisChannel(MOB, int, boolean)
,
mayReadThisChannel(MOB, boolean, Session, int)
,
mayReadThisChannel(MOB, boolean, MOB, int)
boolean mayReadThisChannel(MOB sender, boolean areaReq, Session ses, int channelNumber)
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
getNumChannels()
,
mayReadThisChannel(MOB, int, boolean)
,
mayReadThisChannel(MOB, boolean, MOB, int)
,
mayReadThisChannel(MOB, boolean, MOB, int, boolean)
boolean mayReadThisChannel(MOB M, int channelNumber, boolean zapCheckOnly)
M
- the potential receiver of the message to confirmchannelNumber
- the channel index numberzapCheckOnly
- the channel index number
getChannelIndex(String)
,
mayReadThisChannel(MOB, boolean, MOB, int)
,
mayReadThisChannel(MOB, boolean, Session, int)
,
mayReadThisChannel(MOB, boolean, MOB, int, boolean)
void channelQueUp(int channelNumber, CMMsg msg)
channelNumber
- the channel index numbermsg
- the channel message msg that was sent aroundgetNumChannels()
,
getChannelIndex(String)
int getChannelIndex(java.lang.String channelName)
channelName
- the channel string to search for
getNumChannels()
int getChannelCodeNumber(java.lang.String channelName)
channelName
- the name of the channel
java.util.List<java.lang.String> getFlaggedChannelNames(ChannelsLibrary.ChannelFlag flag)
flag
- the flag to find channels for
ChannelsLibrary.ChannelFlag
java.lang.String getExtraChannelDesc(java.lang.String channelName)
channelName
- the name of the channel
java.util.List<ChannelsLibrary.CMChannel> getIMC2ChannelsList()
java.util.List<ChannelsLibrary.CMChannel> getI3ChannelsList()
java.lang.String[] getChannelNames()
getNumChannels()
java.lang.String findChannelName(java.lang.String channelName)
channelName
- the channel string to search for
getNumChannels()
java.util.List<Session> clearInvalidSnoopers(Session mySession, int channelNumber)
mySession
- the session to search for snoopers ofchannelNumber
- the channel number to cross reference snoopers by
getNumChannels()
,
restoreInvalidSnoopers(Session, List)
void restoreInvalidSnoopers(Session mySession, java.util.List<Session> invalid)
mySession
- the session to search restoring snooping oninvalid
- the list of sessions to force resnoopingclearInvalidSnoopers(Session, int)
int loadChannels(java.lang.String list, java.lang.String ilist, java.lang.String imc2list)
list
- the main game channel listilist
- the list of i3 channelsimc2list
- the list of imc2 channels
boolean sendChannelCMMsgTo(Session ses, boolean areareq, int channelNumber, CMMsg msg, MOB sender)
ses
- the session to send the channel message toareareq
- true if the sender and session must be in the same area, false otherwisechannelNumber
- the channel index number of the messagemsg
- the constructed CMMsg channel messagesender
- the sender of the channel message
getNumChannels()
,
createAndSendChannelMessage(MOB, String, String, boolean)
void createAndSendChannelMessage(MOB mob, java.lang.String channelName, java.lang.String message, boolean systemMsg)
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 messagesendChannelCMMsgTo(Session, boolean, int, CMMsg, MOB)
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)
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |