KazDragon / paradice9

Telnet Chatter in C++14
Other
8 stars 2 forks source link

Implementation question #204

Open KennethThompson opened 7 years ago

KennethThompson commented 7 years ago

I've incorporated your telnetpp/sessionpp classes into my own mud and very much appreciate your efforts. However, I am trying to understand why in your Paradice code you use a partial class implementation. For instance, your connection class has a impl struct that has the logic that can only indirectly communicate with the connection class instance.

What is the rationale behind this type of implementation? I haven't seen anything like it with regard to ASIO and want to understand why you chose to use it.

KazDragon commented 7 years ago

Hi, CalielOfSeptem.

I have a user! Fantastic! Did you take it straight out of Paradice, or did you using the separate Telnet++ library?

If I understand correctly, you're asking why I've been consistently using the "pimpl" pattern throughout the codebase? The answer is that it was mostly an experiment in trying to keep implementation details away from users. In particular, this allows me to treat a connection as a source/sink of bytes, with a couple of callbacks, and all of the Telnet junk below is completely hidden from the user. It reduces compilation dependencies as well - adding the MCCP layer to the Telnet stack, for example, didn't require recompilation of more than connection.cpp.

I hope that answers your question. If not, please feel free to clarify. I promise I'll respond quicker as well!

KennethThompson commented 7 years ago

I took the implementation from Paradice as far as the connection classes went and the odin code. But for the telnet and console I left those as static libs. I continue to use your partial implementation approach, although I'm not sure it benefits my particular implementation.

In any event, your code is solid work and saved me the hassle of having to deal with a bunch of telnet/asio/tcp code that would just detract from the core of my mud. Your headers remain, although my mud is a private repository on github for now. I may eventually release the mud, or not, I'm not sure. I believe I am the first to produce a mudlib that includes a C++ driver with embedded lua scripting... but I could be wrong.

KennethThompson commented 7 years ago

Also, I added you as a collaborator if you were curious as to how I used the code.

KazDragon commented 7 years ago

I'm definitely interested in seeing it used. Eager, even. Which repo is it?

KazDragon commented 7 years ago

E-mails. Right.

KazDragon commented 7 years ago

I think it's really awesome that you just picked up my work, stripped out a few bits you didn't need, and dropped it into your own. I see you've also imported Terminal++, but haven't used it yet beyond a stray header. I hope it can be of use to you as well, even if it's just for formatting coloured text :)

Please let me know if you think anything can be improved. If my work improves yours as a side-effect, then that's just awesome. Thanks so much for letting me know about this.

KennethThompson commented 7 years ago

I'm not entirely sure how to use telnetpp quite yet, but I suspect I will end up using it. Did you ever play DragonRealms (DR)? My mud is heavily inspired by DR.

No, thank you! I was relieved to find a modern C++ approach to telnet code. I was a programmer for years, primarily C++, but have been out of the game for 5 years now. This mud project has been a great way to get back into C++ and explore new C++11/14 features.

I will let you know if anything comes up.