com.planet_ink.coffee_mud.core.intermud
Class IMudInterface

java.lang.Object
  extended by com.planet_ink.coffee_mud.core.intermud.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.lang.String[][] channels
           
 java.lang.String i3state
           
 java.lang.String name
           
 int port
           
static long serialVersionUID
           
 java.lang.String version
           
 
Constructor Summary
IMudInterface(java.lang.String Name, java.lang.String Version, int Port, java.lang.String i3status, java.lang.String[][] Channels)
           
 
Method Summary
 void destroymob(MOB mob)
           
protected  MOB findSessMob(java.lang.String mobName)
           
 java.lang.String fixColors(java.lang.String str)
           
 java.lang.String getChannelMask(java.lang.String str)
          Given a local channel name, returns the level required.
 java.util.Enumeration getChannels()
           
 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 I3 channel name, this method should provide the local level 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.
 void receive(Packet packet)
          Handles an incoming I3 packet asynchronously.
 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

port

public int port

channels

public java.lang.String[][] channels
Constructor Detail

IMudInterface

public IMudInterface(java.lang.String Name,
                     java.lang.String Version,
                     int Port,
                     java.lang.String i3status,
                     java.lang.String[][] Channels)
Method Detail

findSessMob

protected MOB findSessMob(java.lang.String mobName)

fixColors

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

socialFixIn

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

destroymob

public void destroymob(MOB mob)

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

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 I3 channel name, this method should provide the local level for that channel. Example:
 if( str.equals("imud_code") ) return "intercre";
 

Parameters:
str - the remote name of the desired channel
Returns:
the local channel name for a remote channel
See Also:
getRemoteChannel(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

getChannelMask

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

Parameters:
str - the local name of the desired channel
Returns:
the remote name 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