Two Laptop Bag*
The moose likes Game Development and the fly likes MUD client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "MUD client" Watch "MUD client" New topic
Author

MUD client

Piter Smith
Ranch Hand

Joined: Feb 25, 2009
Posts: 31
I'm working on a MUD client, using Apache Telnet. Here's an excerpt from wikipedia for context:


Generally, a MUD client is a very basic telnet client that lacks VT100 terminal emulation and the capability to perform telnet negotiations.


http://en.wikipedia.org/wiki/Mud_client

Here's my basic structure:

src/
├── telnet
│   ├── IOUtil.java
│   └── TelnetConnection.java
└── weather
├── ActionsDequeuWrapper.java
├── Controller.java
├── Flag.java
├── Regex.java
├── WeatherAction.java
└── WeatherActionsSingleton.java



I'm having a major design problem:

TelnetConnection connects to the remote MUD server through Apache TelnetClient. Messages to the remote game server are managed here.

The IOUtil class is adapted from the Apache sample, and handles:

1.) console input
2.) console output
3.) redirecting output

The third point, redirecting remote output for regex parsing, is tricky. What, or where, should that output go? Currently, it goes to, not surprisingly, Regex for parsing. That part is okish, but then what does Regex do? The connection is back in TelnetConnection, which Regex doesn't have a reference to. IOUtil is all static methods, and doesn't have a reference to TelnetController, either.

Possibly TelnetController could be an Observer, but that seems wrong. TelnetController is a resource, and the Controller should send messages to TelnetConnection. But what messages? The messages are in Regex, which does not have a reference in the Controller. Only IOUtils has a reference to the Regex parser.


Hopefully, that problem description makes sense.

https://github.com/THUFIR/rainmaker/blob/master/src/telnet/TelnetConnection.java


Then, it gets messier.
 
wood burning stoves
 
subject: MUD client
 
Similar Threads
Guidance on Chat Server structures
Need Advice on creating a server that uses SSL!
unable to create directory using ftp task
NX:Client crashed cause deadlock in LockManager
ANSI to plain text for regex