|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.core.intermud.packets.Intermud
public class Intermud
The Intermud class is the central focus of incoming and outgoing Intermud 3 packets. It creates the link to the I3 router, handles reconnection, and routing of packets to the mudlib. The mudlib is responsible for providing two specific objects to interface with this object: an implementation of com.planet_ink.coffee_mud.core.intermud.packets.ImudServices an implementation of com.planet_ink.coffee_mud.core.intermud.persist.PersistentPeer To start up the Intermud connection, call the class method setup(). The class itself creates an instance of itself and serves as a way to interface to the rest of the mudlib. When the mudlib needs to send a packet, it sends it through a class method which then routes it to the proper instance of Intermud.
ImudServices,
PersistentPeer,
Serialized Form| Field Summary | |
|---|---|
int |
attempts
|
java.util.Hashtable |
banned
|
ChannelList |
channels
|
java.io.DataInputStream |
input
|
MudList |
muds
|
java.util.Vector |
name_servers
|
int |
password
|
static long |
serialVersionUID
|
boolean |
shutdown
|
| Fields inherited from interface com.planet_ink.coffee_mud.core.intermud.persist.Persistent |
|---|
DELETED, MODIFIED, NEW, UNMODIFIED |
| Method Summary | |
|---|---|
void |
addChannel(Channel c)
Adds a channel to the channel list. |
void |
addMud(Mud m)
Adds a mud to the list of known muds. |
static ChannelList |
getAllChannelList()
|
static MudList |
getAllMudsList()
|
ChannelList |
getChannelList()
|
static java.lang.String |
getLocalChannel(java.lang.String c)
Returns a String representing the local channel name for the specified remote channel by calling the ImudServices implementation of getLocalChannel(). |
MudList |
getMudList()
|
static NameServer |
getNameServer()
|
int |
getPassword()
|
static java.lang.String |
getRemoteChannel(java.lang.String c)
Returns a String representing the remote channel name for the specified local channel by calling the ImudServices implementation of getRemoteChannel(). |
static boolean |
isConnected()
|
static boolean |
isUp(java.lang.String mud)
Determines whether or not the specified mud is up. |
void |
removeChannel(Channel c)
Removes a channel from the channel list. |
void |
removeMud(Mud m)
Removed a mud from the list of known muds. |
void |
restore()
Prescribes a method for restoration from a data store. |
void |
run()
|
void |
save()
Prescribes a method for saving this object's data to a data store. |
void |
send(Packet p)
Sends any valid subclass of Packet to the router. |
static void |
sendPacket(Packet p)
Sends a packet to the router. |
void |
setChannelList(ChannelList list)
Sets the channel list to a new channel list. |
void |
setMudList(MudList list)
Sets the list of known muds to the specified list. |
void |
setPassword(int pass)
Sets the Intermud 3 password. |
static void |
setup(ImudServices imud,
PersistentPeer peer)
Creates the initial link to an I3 router. |
static void |
shutdown()
|
void |
stop()
Shuts down the connection to the router without reconnecting. |
static java.lang.String |
translateName(java.lang.String mud)
Translates a user entered mud name into the mud's canonical name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long serialVersionUID
public boolean shutdown
public java.io.DataInputStream input
public int attempts
public java.util.Hashtable banned
public ChannelList channels
public MudList muds
public java.util.Vector name_servers
public int password
| Method Detail |
|---|
public static void sendPacket(Packet p)
p - an instance of a subclass of com.planet_ink.coffee_mud.core.intermud.packets.PacketPacket
public static void setup(ImudServices imud,
PersistentPeer peer)
imud - an instance of the mudlib implementation of com.planet_ink.coffee_mud.core.intermud.packets.ImudServicespeer - and instance of the mudlib implementation of com.planet_ink.coffee_mud.core.intermud.packets.IntermudPeerImudServices,
PersistentPeerpublic static java.lang.String translateName(java.lang.String mud)
mud - the user entered mud name
public static java.lang.String getLocalChannel(java.lang.String c)
c - the remote channel name
ImudServices.getLocalChannel(java.lang.String)public static java.lang.String getRemoteChannel(java.lang.String c)
c - the local channel name
ImudServices.getRemoteChannel(java.lang.String)public static boolean isUp(java.lang.String mud)
mud - the name of the mud being checked
public static NameServer getNameServer()
public void restore()
throws PersistenceException
Persistent
restore in interface PersistentPersistenceException - thrown when an error occurs in restoringPersistentPeerpublic static boolean isConnected()
public void run()
run in interface java.lang.Runnable
public void save()
throws PersistenceException
Persistent
save in interface PersistentPersistenceExceptionPersistentPeerpublic void send(Packet p)
p - the packet to sendpublic void stop()
Runnable.run()public void addChannel(Channel c)
c - the channel to add to the list of known channelsImudServices.getChannels()public void removeChannel(Channel c)
c - the channel to removepublic ChannelList getChannelList()
public void setChannelList(ChannelList list)
list - the new channel listpublic void addMud(Mud m)
m - the mud to addpublic void removeMud(Mud m)
m - the mud to removepublic MudList getMudList()
public static MudList getAllMudsList()
public static ChannelList getAllChannelList()
public void setMudList(MudList list)
list - the new list of mudspublic int getPassword()
public void setPassword(int pass)
pass - the new passwordpublic static void shutdown()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||