Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite sockets code to use libtelnet instead #4

Open
marado opened this issue Nov 28, 2014 · 14 comments
Open

Rewrite sockets code to use libtelnet instead #4

marado opened this issue Nov 28, 2014 · 14 comments

Comments

@marado
Copy link
Contributor

marado commented Nov 28, 2014

Amnuts is still unstafe in the way it handles sockets. Instead of dealing with sockets directly, it could/should use a library that properly handles telnet connections (my suggestion being https://github.com/seanmiddleditch/libtelnet ).

I am aware that this is a big enterprise, and would warrant itself a new version. I am creating this issue as a kind of 'note to self', maybe I'll end up creating a branch for this, and slowly do the work myself.

@amnuts
Copy link
Owner

amnuts commented Nov 28, 2014

Just checked out the library you suggested and it looks pretty neat - certainly seems beneficial to use it and correctly handle telnet negotiation and options. The utils/telnet-chatd.c shows the implementation quite nicely... even for me, someone who hasn't touched C or the talker code for way too many years! ;-)

@Uzume
Copy link

Uzume commented Oct 22, 2015

I have been wanting to do something like this for a long time. Although I can foresee just rewriting the entire thing from scratch as useful too (then we can get rid of the linked-list of users bugs where one user causes another to be deleted--aka the .kill bug; I always thought an array of pointers would be best). We could also jettison netlinks too in favor of intermud or something similarly better defined. Not to mention allow for multiple connections methods, e.g. ssh, in addition to telnet, etc.

@marado
Copy link
Contributor Author

marado commented Oct 22, 2015

Yeah, I confess that the work is huge enough to make me think I better work on a new code base instead of rewriting much of Amnuts.
I've been working on a new talker base at https://github.com/marado/TalkerNode , but even there... the fact that it's only me coding for it doesn't give me much energy to spend time on the project as much as I could.
In the end, I guess I'll keep working on TalkerNode instead of contributing on Amnuts until the sittuation changes, but I'd probably favor the solution with more people developing in.

@amnuts
Copy link
Owner

amnuts commented Oct 22, 2015

Total rewrite? Wow... Isn't it all the little bugs that make it fun to play with? What do you mean, "no"?!?

I did have a very quick peek at the libtelnet thing, although for the most part I just managed to seg-fault the talker. A lot. But in theory I think only a few sections need to change (though I may, admittedly, not be thinking the whole thing through very much). But basically adding the telnet opts (probably to globals.h), tweaking accept_connection() to telnet_init and telnet_negotiate, and I also shifted some of the main loop out to another function to handle the user input part. I think from there it's really the write_user() function that needs updating as the majority of output to the user goes through that. Outside of the code there already it's a case of creating the telnet event handling and compiling it all together. Haven't touched it from my first quick play in about six months, though.

But if we're talking a major rewrite/from scratch, can I but my request in for a nicer format for storing the user/board/mail/etc data? SQLite, or at the very least JSON. (Unified user format that'd work on TalkerNode as well? ;-) )

As for netlinks removal... Well, it's pretty much not there if you don't use the compile flag, but I see what you mean. Doesn't InterMUD require a centralised server to route message through, or can you do it directly from talker to talker? That's one of the good things about netlinks, it's just a direct connection. But, to be honest, are there even that many talkers around these days that would make connecting up worth while? I remember in Way Out West's heyday I only had about four talkers that we'd have netlinks with.

@Uzume
Copy link

Uzume commented Oct 28, 2015

There are already some node.js based talkers/MUDs out there. I was also thinking of moving in that direction (if I never get to the rewrite concept).

Netlinks can be compiled out but there are still a number of dependencies that cannot be cleaned up until the other code is removed.

@marado
Copy link
Contributor Author

marado commented Oct 28, 2015

@amnuts - my two biggest issues with Amnuts are (1) telnet-related bugs and (2) unicode-related bugs (I run a Portuguese talker, meaning most sentences passing around have 8 bit characters somewhere). Talking about a total rewrite might be an exaggeration, but after spending some time reading gcc code to understand what the hell was happening with Amnuts in a specific arch (utf8 character triggering a SEGFAULT)... well, I sort of got tired. While the sockets part can be solved with libtelnet, I don't really know (but I didn't spend time digging into it) any easy/clean way to properly deal with charsets and weird characters on Amnuts, and I guess it would at least mean revisit every single buffer, array, struct and whatever else to recalculate its size. It might still not be a complete rewrite, but I'm not convinced that fixing those two issues wouldn't take more time than writing a talker base from scratch on Node.js... and that's why I started TalkerNode.

@Uzume - I did an extensive (re)search on what was available out there (on other languages, not only Node.js), nothing would quite suite my needs when I started TalkerNode. That being said, I'd be happy to be proven wrong (and test/comment on whatever solutions you might think fit) - and I would also be happy to accept contributions to TalkerNode ;-)

@Uzume
Copy link

Uzume commented Oct 28, 2015

Well I have not done a comprehensive review but a quick search revealed:

And of course your project too of course. Likely there are other less well known ones in hiding somewhere.

@amnuts
Copy link
Owner

amnuts commented Oct 29, 2015

I totally get what you're saying, @marado. Amnuts (well, almost any NUTS-based talker, I guess) was never constructed with utf-8 in mind and doesn't really support that too well in the way it's constructed. And, yeah, it'd probably take more time to fix than rewrite from scratch. I personally started to do it in PHP to play around with some libs there, but didn't take it anywhere near to a complete rewrite of Amnuts.

@marado
Copy link
Contributor Author

marado commented Oct 31, 2015

@Uzume thanks for the list. I went through them, ranviermud seems promising. The original project seems stopped (quite a number of ignored PRs and so on), but there's a fork that was active until July ( https://github.com/seanohue/ranviermud ). The code isn't quite stable (in fact, I had to make some pull requests already), but if it is active... well, it's a code base with two working on it instead of just one, so I quite might give it a shot. I will be waiting to see the feedback on my pull requests till now, tho ( https://github.com/seanohue/ranviermud/pulls ), even as a way of measuring the pulse to the project (if the fork is still active or what).

The others... well, none of them would make me turn my attention from TalkerNode to them.

@Uzume
Copy link

Uzume commented Nov 2, 2015

@marado I see your PRs got merged in a timely fashion. It seems he is not good at seeing updates to PRs (e.g., PR #11) but it seems if the patch is good from the start he is fairly quick merge it.

@marado
Copy link
Contributor Author

marado commented Nov 2, 2015

@Uzume , Hm, You're talking about the two (minor) PRs I submitted to shawncplus/ranviermud, but I'm more curious about what's going to happen to the ones I submitted to seanohue/ranviermud . While my two PRs were accepted upstream, the project seems otherwise stalled (since 2013), including feedback on other PRs (some trivial) and issues.

I mean,... seanohue/ranviermud seems more (potentially) active and, between the two, I guess I'd rather work on the fork (even if always open to push contributions upstream, if there's interest by the project owner).

@Uzume
Copy link

Uzume commented Sep 21, 2019

@marado, I know the discussion here has gotten way off topic and though this is still technically open, it is also mostly stalled. With that said, I have been considering dabbling in Rust and Wasm.

This way it can run in node.js (and possibly in the browser too). I am not sure if it will be a talker as per se though as I have been looking at game engines as well (then again MUDs and interactive fiction game engines are close concepts to talkers in some ways).

And if I need a more established user interface I could add electron/electron to the node.js mix (and perhaps some library to WebGL if I need some more serious graphics).

I totally agree that anything with any significant textual content (e.g., a talker) should definitely consider internationalization (including Unicode) and localization (often this implies some sort of scripting). Sadly the history with talkers and MUDs has not supported this well (things had to start somewhere though I suppose).

@marado
Copy link
Contributor Author

marado commented Sep 21, 2019

Hi @Uzume ,

While I have made sporadic contributions here and there to other code bases, I have been still focusing on my work on TalkerNode[1], despite it still being a one-man effort with sporadic contributions from others. The work with TalkerNode is progressing slowly, and it still doesn't have feature-parity with Amnuts, something I wish to achieve[2], but things are going in the right direction, so I don't see any particular incentive in starting a new effort from scratch. However, if you plan to do something on this field (either on rust, wasm or something else, I have no technological preference) do let me know, and I might end up contributing to it, or, if I see it as (due to having more than one developer) having a more constant development cycle, I might be inclined into shifting my development attention in that direction instead.

[1] https://github.com/marado/TalkerNode
[2] https://github.com/marado/TalkerNode/milestone/9

@blindsight
Copy link
Contributor

Would it be better to just reunify against a single project? integrating libtelnet could possibly help with standardization and utf-8. I haven't looked into the library yet. There just seems to be a lot of random talker projects.

I've personally played around with writing talkers in other languages:
Go
https://github.com/blindsight/gotalker
C#
https://github.com/blindsight/Talker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants