Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MUD client

 
Piter Smith
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic