Skip to content
This repository has been archived by the owner on Feb 9, 2020. It is now read-only.

Adds gmcp support #24

Merged
merged 1 commit into from
Apr 5, 2018
Merged

Conversation

LiquidityC
Copy link
Contributor

I added an embryo of GMCP support. It's usable and works. I'd love some comments. And if it's approved I think it's up to someone with a bigger perspective on the project to decide how to use it. Some sort of JSON module would likely help.

Please get back with any improvement suggestions etc. I'm not assuming this will go straight into the devel branch ;)

@LiquidityC LiquidityC force-pushed the add_gmcp_support branch 3 times, most recently from 47c0676 to 7278b90 Compare March 22, 2018 19:13
@LiquidityC LiquidityC mentioned this pull request Mar 23, 2018
@zachflower
Copy link
Member

Thanks for the contribution @LiquidityC! The code itself looks solid, although I haven't had a chance to test it myself (I will prioritize that as soon as I get a chance). As we add features, I am curious how everyone feels about using isolated header files (in this case using a gmcp.h, rather than the catchall mud.h).

@rogersm @xenith Any opinion on that?

@xenith
Copy link
Collaborator

xenith commented Mar 23, 2018

I agree that smaller header files are generally a better idea. It's a balancing act around too many includes and circular includes.

gmcp = FALSE;
dsock->next_command[j] = '\0';
gmcpReceived(dsock);
dsock->next_command[j = 0] = '\0';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this too clever? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be. But I think it's one of those, "once you extend it you can clean it up a bit" situations. :D

Didn't want to overthink things now since I don't know how it will be used in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found funny doing the assignment inside array reference, never saw it before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never used it before. But I felt it was nicer to keep the line count low here.

Copy link
Member

@zachflower zachflower Mar 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rogersm Wow, great eye! Definitely a nuance I didn't notice, but I'm okay with the convention here.

@LiquidityC
Copy link
Contributor Author

Want me to separate the gmcp stuff from mud.h to gmcp.h?

@rogersm
Copy link
Contributor

rogersm commented Mar 29, 2018

@zachflower only for the 3 gmcp functions? I would say keep them in mud.h for now.

@zachflower
Copy link
Member

@rogersm I'm fine with that for now, we could always separate things out in a separate refactor in the future if we were so inclined.

Copy link
Member

@zachflower zachflower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally had a chance to test and only have one minor change! Quick fix to that and I think we're good to merge 👍

src/socket.c Outdated
@@ -33,6 +33,7 @@ const unsigned char compress_will [] = { IAC, WILL, TELOPT_COMPRESS, '\0' };
const unsigned char compress_will2 [] = { IAC, WILL, TELOPT_COMPRESS2, '\0' };
const unsigned char do_echo [] = { IAC, WONT, TELOPT_ECHO, '\0' };
const unsigned char dont_echo [] = { IAC, WILL, TELOPT_ECHO, '\0' };
const unsigned char gmcp_will [] = { IAC, WILL, TELOPT_GMCP, SE, '\0' };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the SE is unnecessary within the negotiation and causes the client (in my test case Mudlet) to try and render the line:

screenshot 2018-03-30 12 44 35

Would you update the negotiation to { IAC, WILL, TELOPT_GMCP, '\0' };?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely, weird that I added it in the first place. Must have made an editing mistake or something when I was cleaning up.

@LiquidityC
Copy link
Contributor Author

I added the changes but the commits are squashed so the fixes are in the same commit.

@zachflower
Copy link
Member

Looks good, thanks so much for the contribution @LiquidityC! If you haven't already joined us on Slack, please pop by (https://slack.mudcoders.com/) we'd love to have you!

@zachflower zachflower merged commit 1c0ed7b into mudcoders:develop Apr 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants