Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUDs ➜ General ➜ Is GMCP still a thing?

Is GMCP still a thing?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2  3  4  5  6 7  

Posted by Xinefus   (106 posts)  Bio
Date Reply #75 on Wed 13 May 2020 06:29 PM (UTC)

Amended on Wed 13 May 2020 08:19 PM (UTC) by Xinefus

Message
Just to further my ability to write some more plugins for MUSH, I downloaded the entire https://github.com/nickgammon/smaugfuss/tree/status_messages .

Had a few compile errors, will work them out another time.
Top

Posted by Nick Gammon   Australia  (23,068 posts)  Bio   Forum Administrator
Date Reply #76 on Wed 13 May 2020 08:29 PM (UTC)
Message
Fiendish said:

Nick Gammon said:
I think you compile with g++ rather than gcc to fix that.

It's a little weird to switch a C project to C++ to bring in string.h, lol.


You mean <string> not <string.h>.


The STL has some nice features, I don't see why we can't use them. Some of the string handling in straight C is rather tedious.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #77 on Wed 13 May 2020 11:10 PM (UTC)

Amended on Wed 13 May 2020 11:11 PM (UTC) by Fiendish

Message
The file behind <string> is string.h

Quote:
The STL has some nice features, I don't see why we can't use them. Some of the string handling in straight C is rather tedious.

That's true. It just requires switching languages is all. :)

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Xinefus   (106 posts)  Bio
Date Reply #78 on Wed 03 Jun 2020 01:36 PM (UTC)
Message
Nick Gammon said:

I think you compile with g++ rather than gcc to fix that.


I'm not sure to laugh or cry at this one. Hehe.

Happy June everyone!

I have been able to get the https://github.com/nickgammon/smaugfuss/tree/status_messages MUD running and playing around with it. But it is going to be a bit until I will use what I'm learning in there in the actual MUD I'm working on.

Right now, I am a bit stuck between a rock and a hard place. I have requested to become a coder for a specific MUD, but they have given me a task to prove myself and it is a bit of a movement backwards. Backwards meaning that the task is to get an old version of a mud working, it's based on SMAUG 1.4, it compiles only in gcc-3.4 and try and implement gmcp to prove how I would do it. With this, I can then get access to the actual MUD codebase.

So what I have tried to do is implement gmcp with the info in http://www.gammon.com.au/forum/?id=10043&reply=7#reply7 (also using \xC9 btw vice \x66).

Like a previous post here, when I get those code snippets implemented I end up with a login error wherein I have to put in the name twice (in MUSHClient) before it will work. It also seems that GMCP is always enabled, even for a client that has no telnet negotiation capability (I'm thinking of GMUD in this case). I was hoping that by default it would be off, and that if someone was using an old client such as gmud (we try to tell them not to) they wouldn't see the code. But so far it still shows up.

So it boils down to the fact that I have it working but there are still a few bugs to iron out and I would like a bit of guidance. Not sure if this forum is the right place to do so, but you guys seem at least active and responsive so I thought I would try here.

How can I get this working on a very old codebase (I can share it if needed as I just downloaded it from afkmuds and can post it to git for ease of collaboration).

Once I can get this shown to work (without the negotiation error) I will then be able to implement it on a MUD that is compiled in g++, and hopefully will be able to use more of the snippets from the github link stated above.
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #79 on Thu 04 Jun 2020 02:19 AM (UTC)

Amended on Thu 04 Jun 2020 02:47 AM (UTC) by Fiendish

Message
I have enough of my own projects that I don't really want to "collaborate" on this, but I can answer specific questions and give guidance about how to debug code. Though if you want to be a coder for that MUD, these are the kinds of things that you're going to need to be able to figure out.

Quote:
I end up with a login error wherein I have to put in the name twice

Add print statements in the server code that display everything being received and sent, so that you can see everything that goes back and forth in the order that it is sent and received. You can't fix what you don't see.

Quote:
It also seems that GMCP is always enabled, even for a client that has no telnet negotiation capability (I'm thinking of GMUD in this case). I was hoping that by default it would be off

It should be. Maybe you didn't apply the changes correctly.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,068 posts)  Bio   Forum Administrator
Date Reply #80 on Thu 04 Jun 2020 06:22 AM (UTC)
Message
Quote:

... when I get those code snippets implemented I end up with a login error wherein I have to put in the name twice (in MUSHClient) before it will work



This was a thing in the past, and it was because the server wasn't processing IAC ... message properly. For example, the client might be sending some sort of subnegotiation query. Now if you login with your name, and the query response has been automatically sent by the client, and the server hasn't processed it and stripped it out then the IAC stuff becomes part of the player name and it is rejected.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Xinefus   (106 posts)  Bio
Date Reply #81 on Thu 04 Jun 2020 11:29 AM (UTC)

Amended on Thu 04 Jun 2020 11:36 AM (UTC) by Xinefus

Message
Good morning (least where I am),

Is there a way to implement (enable/disable) GMCP through similar method through config such as how ANSI or TELNET_GA is turned on and off?

Right now, I'm not savvy enough in C to convert update the whole of read_from_buffer so that IAC will work correctly with MCCP and GMCP simultaneously.

I've been trying to look within act_info and create the link between a gmcp toggle and the ability to enable the messages. Any recommendations on this way ahead?

Would this remove the requirement for auto-telnet-negotiation, or am I just making more work for myself before I get this working correctly?
Top

Posted by Xinefus   (106 posts)  Bio
Date Reply #82 on Thu 04 Jun 2020 06:38 PM (UTC)

Amended on Thu 04 Jun 2020 06:40 PM (UTC) by Xinefus

Message
Alright, so I want to explain how/what I have done and because I do not have a lot of experience with the do's and don'ts of MUDs I hope that you can tell me if I have done a grave error or not.

What I opted for doing at this time due to my limited knowledge in C is to create a GMCP toggle (such as the ANSI/RIP toggle) under the config command.

Here was my process:

Within mud.h:

#define IAC_SB_GMCP        "\xFF\xFA\xC9"
#define IAC_SE             "\xFF\xF0"

...

typedef enum
{
PLR_GMCP // under act bit/flag 
} player_flags;

...

bool    is_gmcp         args( ( CHAR_DATA *ch ) );

Within player.c:

bool is_gmcp( CHAR_DATA *ch )
{
    if( xIS_SET(ch->act, PLR_GMCP ) )
      return TRUE;

    return FALSE;
}

Within act_info.c

in void do_config()

...

send_to_char( "\n\r\n\rMisc:      ", ch );
set_char_color( AT_GREY, ch );
ch_printf( ch, "%-12s   %-12s   %-12s   %-12s  
 %-12s\n\r",
   xIS_SET(ch->act, PLR_GMCP ) ? "[+] GMCP"
  : "[-] gmcp" );

...

else if ( !str_prefix( arg + 1, "gmcp"	) )
  bit = PLR_GMCP;

Within comm.c

/* GMCP */
#define  MUD_SPECIFIC       '\xC9'

...

display_prompt()

...

send_to_char( buf, ch );
  if( is_gmcp(ch) )
  {
  	ch_printf (ch, IAC_SB_GMCP "Char.Status {\"hp\": %d}" IAC_SE, ch->hit);
  }
  return;
} // end display_prompt

Now I do understand that this does not work if prompt is turned off. But all I would have to do in this case is declare a void show_status( CHAR_DATA *ch ); and append the right info inside of it.

Does this sound/look like a good way forward?
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #83 on Thu 04 Jun 2020 10:25 PM (UTC)

Amended on Thu 04 Jun 2020 10:26 PM (UTC) by Fiendish

Message
If possible, please put your code up on github somewhere and then reference code sections by permalinking multiline selections so that we can see all of the context. ( https://help.github.com/en/github/managing-your-work-on-github/creating-a-permanent-link-to-a-code-snippet )

Or maybe just show more context.

Quote:
Alright, so I want to explain how/what I have done and because I do not have a lot of experience with the do's and don'ts of MUDs I hope that you can tell me if I have done a grave error or not.

Honestly when it comes to MUDs (servers anyway) I'm an extreme novice. I'm a rather good programmer, though, so maybe I'll be able to follow.

Quote:
What I opted for doing at this time due to my limited knowledge in C is to create a GMCP toggle (such as the ANSI/RIP toggle) under the config command.

I'm sure you understand why that's not ideal, but for now if it works then ok.

Quote:
typedef enum
{
PLR_GMCP // under act bit/flag
} player_flags;

I assume that it doesn't actually look exactly like this and that this is merely a condensed view of the player_flags enum with all the other values hidden away?

Quote:
bool is_gmcp args( ( CHAR_DATA *ch ) );

What is args here? A typical function declaration does not say "args".

Quote:
#define MUD_SPECIFIC '\xC9'

Are you using this?

Quote:
Does this sound/look like a good way forward?

It sounds like it should work as long as the client doesn't care whether you've negotiated. It's obviously not as good as negotiating with the client automatically.

Does it work?

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,068 posts)  Bio   Forum Administrator
Date Reply #84 on Fri 05 Jun 2020 05:03 AM (UTC)
Message

What is args here? A typical function declaration does not say “args”.

It’s some sort of #define that Smaug uses to handle old C-style argument lists.

You can probably assume it evaluates to its arguments.

i.e.

Would be the same as:


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Xinefus   (106 posts)  Bio
Date Reply #85 on Fri 05 Jun 2020 09:17 AM (UTC)

Amended on Fri 05 Jun 2020 10:40 AM (UTC) by Xinefus

Message
Well...


After all that work, a few months of discussions - I have found out that the mud I am looking to code for has a protocol snippet by Kavir installed. Included in that snippet is (as the readme states):
https://github.com/Xavious/MSDP_Protocol_Handler

  • Out-of-band communication between mud and client (MSDP);
  • Extended colours (xterm);
  • Client detection;
  • Clickable links;
  • Unicode support;
  • MSSP; and
  • Sound support

Once I showed the snippet of GMCP that I added as an example, he wanted to know if it would conflict with Kavir's snipped. After looking into the snippet, if most certainly would.
When I asked him why he didn't just tell me he added this snippet, he said he didn't know about MSDP and only added the snippet to get xterm colour support! Haha.

So, I've cobbled together a handler and am trying to find out all the diff items I am able to receive from the MUD.

I have learned so much! Not even a waste of time and I wan to thank all of you for it.

I believe I will let this discussion end here for now as my next step I will be towards jumping into MUSHclient plugins.

Thank you!
Top

Posted by Nick Gammon   Australia  (23,068 posts)  Bio   Forum Administrator
Date Reply #86 on Sat 06 Jun 2020 06:13 AM (UTC)
Message

I just want to point out that GMCP and MSDP do not have to clash at all. They are both telnet subnegotiation protocols, and the messages will be distinguished by the protocol number. That is, you could have:

IAC SB MSDP ... some stuff ... IAC SE

And then:

IAC SB GMCP ... some stuff ... IAC SE

The client will parse them separately and hand them off to the appropriate plugin, if any.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #87 on Mon 08 Jun 2020 06:05 PM (UTC)
Message
Just adding to what Nick said...

If the MSDP handling is implemented sanely, it would make adding GMCP easier not harder.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Xinefus   (106 posts)  Bio
Date Reply #88 on Mon 08 Jun 2020 06:39 PM (UTC)
Message
I agree that they should work very well alongside eachother and even should be able to complement each other.

The implementation of MSDP,as I have been told, followed the SMAUG readme as per: https://github.com/Xavious/MSDP_Protocol_Handler?files=1

I didn't go into the code as I pretty much wanted to start writing plugins since it had a lot of data already available. However, I did see that somewhere in there it said that it currently was not compatible with GMCP as currently, MSDP strips out any other AIC SB...
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #89 on Mon 08 Jun 2020 09:07 PM (UTC)
Message
Negotiating GMCP activation would be trivial with that code. You just have to add a case for the GMCP identifier byte to PerformHandshake.

https://github.com/fiendish/aardwolfclientpackage
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


195,625 views.

This is page 6, subject is 7 pages long:  [Previous page]  1  2  3  4  5  6 7  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.