com.planet_ink.coffee_mud.core.intermud.packets
Interface ImudServices

All Known Implementing Classes:
IMudInterface

public interface ImudServices

This interface prescribes methods that need to be implemented by a class in the mudlib. These methods do mudlib specific handling of intermud packets as well as provide the Imaginary Intermud 3 System with mudlib specific information.


Method Summary
 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 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.
 

Method Detail

receive

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.

Parameters:
packet - the incoming packet

getChannels

java.util.Enumeration getChannels()
Returns:
an enumeration of channels this mud subscribes to

getLocalChannel

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";
 

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

getMudVersion

java.lang.String getMudVersion()
Returns:
the software name and version

getMudName

java.lang.String getMudName()
Returns:
the name of this mud

getMudState

java.lang.String getMudState()
Returns:
the status of this mud

getMudPort

int getMudPort()
Returns:
the player port for this mud

getRemoteChannel

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";
 

Parameters:
str - the local name of the desired channel
Returns:
the remote name of the specified local channel