[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUDs
. -> [Folder]  General
. . -> [Subject]  Enabling GMCP

Enabling GMCP

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


Posted by Lerkista   (57 posts)  [Biography] bio
Date Thu 21 May 2020 04:30 AM (UTC)

Amended on Thu 21 May 2020 06:56 AM (UTC) by Lerkista

Message
Hi

Seeing the other GMCP thread, it looks easy to implement GMCP, so i decided to give a try

But it seems like Mushclient don´t want to use GMCP, my Mushclient version is 5.06, and when my Mud send:

IAC WILL MXP
IAC WILL GMCP
IAC WILL NAWS


The response from Mushclient is:

IAC WILL NAWS IAC DO MXP IAC DONT GMCP IAC WILL NAWS IAC SB NAWS 0 80 0 30 IAC SE


Muschlient responds with IAC DONT GMCP

Any idea of why this happend?

With Mudlet i get this response:

IAC DO MXP IAC DO GMCP IAC SB GMCP 67 111 114 101 46 72 101 108 108 111 32 123 32 34 99 108 105 101 110 116 34 58 32 34 77 117 100 108 101 116 34 44 32 34 118
101 114 115 105 111 110 34 58 32 34 52 46 56 46 50 34 125 IAC SE IAC SB GMCP 67 111 114 101 46 83 117 112 112 111 114 116 115 46 83 101 116 32 91 32 34 67 104 97
114 32 49 34 44 32 34 67 104 97 114 46 83 107 105 108 108 115 32 49 34 44 32 34 67 104 97 114 46 73 116 101 109 115 32 49 34 44 32 34 82 111 111 109 32 49 34 44 32
34 73 82 69 46 82 105 102 116 32 49 34 44 32 34 73 82 69 46 67 111 109 112 111 115 101 114 32 49 34 44 32 34 69 120 116 101 114 110 97 108 46 68 105 115 99 111 114 100
32 49 34 44 32 34 67 108 105 101 110 116 46 77 101 100 105 97 32 49 34 93 IAC SE IAC SB GMCP 69 120 116 101 114 110 97 108 46 68 105 115 99 111 114 100 46 72 101 108 
108 111 IAC SE IAC WILL NAWS IAC SB NAWS 0 100 0 37 IAC SE


Mudlet send the client name and version and what supports

But i don´t know why Mudlet allow GMCP but Mushclient don´t


EDIT: Forget it, i suppose Mushclient support GMCP by default, but you need to install a plugin, i installed GMCP_handler_NJG, and worked

The problem i have at this moment, is to handle the response from client, the client send the confirmation for all protocols in one line, so any ideas in how to parse each response and process it? some way to separate each protocol like:

Take the string and separate it in an array or something like that:

str[0]:
IAC DO MXP 

str[1]:
IAC DO GMCP 

str[2]:
IAC SB GMCP 67 111 114 101 46 72 101 108 108 111 32 123 32 34 99 108 105 101 110 116 34 58 32 34 77 117 100 108 101 116 34 44 32 34 118 101 114 115 105 111 110 34 58 32 34 
52 46 56 46 50 34 125 IAC SE 

str[3]:
IAC SB GMCP 67 111 114 101 46 83 117 112 112 111 114 116 115 46 83 101 116 32 91 32 34 67 104 97 114 32 49 34 44 32 34 67 104 97 114 46 83 107 105 108 108 115 32 49 34 44 32 
34 67 104 97 114 46 73 116 101 109 115 32 49 34 44 32 34 82 111 111 109 32 49 34 44 32 34 73 82 69 46 82 105 102 116 32 49 34 44 32 34 73 82 69 46 67 111 109 112 111 115 
101 114 32 49 34 44 32 34 69 120 116 101 114 110 97 108 46 68 105 115 99 111 114 100 32 49 34 44 32 34 67 108 105 101 110 116 46 77 101 100 105 97 32 49 34 93 IAC SE 

str[4]:
IAC SB GMCP 69 120 116 101 114 110 97 108 46 68 105 115 99 111 114 100 46 72 101 108 108 111 IAC SE 

str[5]:
IAC WILL NAWS

str[6]:
IAC SB NAWS 0 100 0 37 IAC SE

So i can evaluate each one


Can anyone help me with the logic to do that?

My mud is LPC based, and already have the code to handle each one, but i don´t know how to do the split

Thanks
[Go to top] top

Posted by Nick Gammon   Australia  (22,988 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 21 May 2020 06:53 AM (UTC)
Message
The GMCP stuff is not directly native to the client. You need to install a plugin (supplied with the client) as described here:

https://www.gammon.com.au/forum/?id=12834&reply=1#reply1

Then it will respond to the messages.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Lerkista   (57 posts)  [Biography] bio
Date Reply #2 on Thu 21 May 2020 06:57 AM (UTC)
Message
Yeah i figured that, i´ve edited my post, to another problem i have, thanks
[Go to top] top

Posted by Nick Gammon   Australia  (22,988 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Thu 21 May 2020 07:01 AM (UTC)

Amended on Thu 21 May 2020 07:07 AM (UTC) by Nick Gammon

Message

The problem i have at this moment, is to handle the response from client, the client send the confirmation for all protocols in one line, so any ideas in how to parse each response and process it?

The communication between client is not in “lines” in either direction. It is in packets. Your code needs to implement a state machine, allowing for the data to possibly span packets, or indeed to have multiple telnet sequences in a single packet.

There is something fundamentally wrong if you are treating incoming data as lines. It just isn’t. Possibly you are accustomed to one packet from the client being one “message”, but that is pure accident. A long message might span multiple packets.

Basically you should process incoming data, byte by byte. If you get an IAC character (0xFF) you switch to a new state. Then switch again depending on what follows. And so on, until you have left the subnegotiation state.

An example, to get you started, is here.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


11,619 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]