An idea like that, to have a "interceptor" between the MUD and the client would conceivably work, but be complex. You would need to maintain two data streams:
Incoming from MUD --> your program --> to normal client
Outgoing from client --> your program --> to MUD
This is because the client needs to connect to your program, and not the MUD.
In the network code you need to handle things like:
- Client connects to your program
- Your program accepts the connection
- Your program connects to the MUD
- (A few seconds later) The MUD accepts the connection
Then, later on, either the MUD or the client might drop the connection, so you need to recover from that, one way or another.
Until that happens you are intercepting packets flowing each way, and handling them in the way you see fit, and then forwarding most of them to the other end.
Bearing in mind what I said before that an incoming packet from the MUD is not necessarily a single line, it might be multiple lines of output, and it doesn't necessarily end at a "natural" place (like the end of a line).
Quote:
... anything tied to curing would be included in this executable ...
You also have a potential problem with a "go-between" program, namely this:
By having another program that intercepts data on the packet level, it is possible a message might arrive (inwards from the MUD) that seems to require some action "curing" the problem.
However in the outgoing packet stream, you might have a lengthy "tell" that you are in the middle of retransmitting back to the MUD. Thus you might send something like this:
tell Gore I think we might have to look around for another member for our group cure light wounds before we attempt to go into this cave.
In my example the long "tell" (being sent from client to server) is broken up by the intercepting program adding its own stuff (in bold in the example).
Quote:
One suggestion I would make would be to use Lua to script your client ...
That might well simplify things a bit, but would not meet his goal of learning C or C++.
My suggestion is, if you want to learn C++, try a simpler project. If you want to write a curing system, write it for MUSHclient (or zMUD), don't try to do something complicated like this for a first project.