com.planet_ink.coffee_mud.core.intermud.i3
Class IMudInterface

java.lang.Object
  extended by com.planet_ink.coffee_mud.core.intermud.i3.IMudInterface
All Implemented Interfaces:
ImudServices, java.io.Serializable

public class IMudInterface
extends java.lang.Object
implements ImudServices, java.io.Serializable

See Also:
Serialized Form

Field Summary
 java.util.List<ChannelsLibrary.CMChannel> channels
           
 java.lang.String i3state
           
 java.lang.String name
           
 int port
           
static long serialVersionUID
           
 Room universalR
           
 java.lang.String version
           
 
Constructor Summary
IMudInterface(java.lang.String Name, java.lang.String Version, int Port, java.lang.String i3status, java.util.List<ChannelsLibrary.CMChannel> Channels)
           
 
Method Summary
 boolean addChannel(ChannelsLibrary.CMChannel chan)
          Register a fake channel
 boolean delChannel(java.lang.String remoteChannelName)
          Remote a channel
protected  MOB findSessMob(java.lang.String mobName)
           
 java.lang.String fixColors(java.lang.String str)
           
 java.util.Enumeration getChannels()
           
 long getLastPacketReceivedTime()
           
 java.lang.String getLocalChannel(java.lang.String str)
          Given a I3 channel name, this method should provide the local name for that channel.
 java.lang.String getLocalMask(java.lang.String str)
          Given a local channel name, this method should provide the local mask for that channel.
 java.lang.String getMudName()
           
 int getMudPort()
           
 java.lang.String getMudState()
           
 java.lang.String getMudVersion()
           
 java.lang.String getRemoteChannel(java.lang.String str)
          Given a local channel name, returns the remote channel name.
 java.lang.String getRemoteMask(java.lang.String str)
          Given a remote channel name, returns the mask required.
protected  Room getUniversalRoom()
           
 java.lang.String L(java.lang.String str, java.lang.String... xs)
           
 void receive(Packet packet)
          Handles an incoming I3 packet asynchronously.
 void resetLastPacketReceivedTime()
          reset the last packet received time
 void setChannelsMap(java.util.List<ChannelsLibrary.CMChannel> channels)
           
 java.lang.String socialFixIn(java.lang.String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

version

public java.lang.String version

name

public java.lang.String name

i3state

public java.lang.String i3state

universalR

public Room universalR

port

public int port

channels

public java.util.List<ChannelsLibrary.CMChannel> channels
Constructor Detail

IMudInterface

public IMudInterface(java.lang.String Name,
                     java.lang.String Version,
                     int Port,
                     java.lang.String i3status,
                     java.util.List<ChannelsLibrary.CMChannel> Channels)
Method Detail

L

public java.lang.String L(java.lang.String str,
                          java.lang.String... xs)

setChannelsMap

public void setChannelsMap(java.util.List<ChannelsLibrary.CMChannel> channels)

findSessMob

protected MOB findSessMob(java.lang.String mobName)

getUniversalRoom

protected Room getUniversalRoom()

fixColors

public java.lang.String fixColors(java.lang.String str)

socialFixIn

public java.lang.String socialFixIn(java.lang.String str)

getLastPacketReceivedTime

public long getLastPacketReceivedTime()
Specified by:
getLastPacketReceivedTime in interface ImudServices
Returns:
the last packet received time

resetLastPacketReceivedTime

public void resetLastPacketReceivedTime()
Description copied from interface: ImudServices
reset the last packet received time

Specified by:
resetLastPacketReceivedTime in interface ImudServices

receive

public void receive(Packet packet)
Handles an incoming I3 packet asynchronously. An implementation should make sure that asynchronously processing the incoming packet will not have any impact, otherwise you could end up with bizarre behaviour like an intermud chat line appearing in the middle of a room description. If your mudlib is not prepared to handle multiple threads, just stack up incoming packets and pull them off the stack during your main thread of execution.

Specified by:
receive in interface ImudServices
Parameters:
packet - the incoming packet

getChannels

public java.util.Enumeration getChannels()
Specified by:
getChannels in interface ImudServices
Returns:
an enumeration of channels this mud subscribes to

addChannel

public boolean addChannel(ChannelsLibrary.CMChannel chan)
Register a fake channel

Specified by:
addChannel in interface ImudServices
Parameters:
chan - the remote channel name
Returns:
the local channel name for the specified new local channel name
See Also:
ImudServices.getLocalChannel(java.lang.String)

delChannel

public boolean delChannel(java.lang.String remoteChannelName)
Remote a channel

Specified by:
delChannel in interface ImudServices
Parameters:
remoteChannelName - the remote name
Returns:
true if remove succeeds

getLocalChannel

public java.lang.String getLocalChannel(java.lang.String str)
Given a I3 channel name, this method should provide the local name for that channel. Example: if( str.equals("imud_code") ) return "intercre";

Specified by:
getLocalChannel in interface ImudServices
Parameters:
str - the remote name of the desired channel
Returns:
the local channel name for a remote channel
See Also:
getRemoteChannel(java.lang.String)

getLocalMask

public java.lang.String getLocalMask(java.lang.String str)
Given a local channel name, this method should provide the local mask for that channel. Example: if( str.equals("ICODE") ) return "";

Parameters:
str - the local name of the desired channel
Returns:
the local channel mask for a remote channel
See Also:
getLocalMask(java.lang.String)

getMudName

public java.lang.String getMudName()
Specified by:
getMudName in interface ImudServices
Returns:
the name of this mud

getMudVersion

public java.lang.String getMudVersion()
Specified by:
getMudVersion in interface ImudServices
Returns:
the software name and version

getMudState

public java.lang.String getMudState()
Specified by:
getMudState in interface ImudServices
Returns:
the software name and version

getMudPort

public int getMudPort()
Specified by:
getMudPort in interface ImudServices
Returns:
the player port for this mud

getRemoteMask

public java.lang.String getRemoteMask(java.lang.String str)
Given a remote channel name, returns the mask required. Example: if( str.equals("intercre") ) return "";

Specified by:
getRemoteMask in interface ImudServices
Parameters:
str - the remote name of the desired channel
Returns:
the remote mask of the specified local channel

getRemoteChannel

public java.lang.String getRemoteChannel(java.lang.String str)
Given a local channel name, returns the remote channel name. Example: if( str.equals("intercre") ) return "imud_code";

Specified by:
getRemoteChannel in interface ImudServices
Parameters:
str - the local name of the desired channel
Returns:
the remote name of the specified local channel