[available] GMCP in Mudlet

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: [available] GMCP in Mudlet

Post by Vadi »

Added, new branch with this is bzr branch lp:~mudlet-makers/mudlet/gmcp-composer

Do test and report. Also, if someone is fluent with Lua and has some time, a little framework to help with gmcp module bookmeeping would be appreciated.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: [available] GMCP in Mudlet

Post by tsuujin »

Vadi wrote:Also, if someone is fluent with Lua and has some time, a little framework to help with gmcp module bookmeeping would be appreciated.
What needs to be done?

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: [available] GMCP in Mudlet

Post by Vadi »

The problem is that we currently enable some GMCP modules by default and forget about them. It's not all modules, and if a plugin wants to enable another module and then disable at some point, they run the risk of someone else using that module.

So what needs to be done is a sub-system that can be queried for modules that are currently enabled, plus have functions to enable/disable modules - and this subsystem should send the actual command to the server to enable a module if it's not already enabled, and send the actual command to disable a module if nobody else is using it.

Current enabled by default modules are: "Core.Supports.Set [ \"Char 1\", \"Char.Skills 1\", \"Char.Items 1\", \"Char.Items 1\", \"Comm.Channel 1\", \"Room 1\", \"Redirect 1\", \"IRE.Composer 1\" ]" so it starts off in sync at start.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: [available] GMCP in Mudlet

Post by tsuujin »

All right, I'll figure out a way to do this.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: [available] GMCP in Mudlet

Post by Vadi »

Cool thanks

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: [available] GMCP in Mudlet

Post by Rakon »

There's a slight bug in your code Vadi:

ctelnet.cpp::atcpComposerSave() Line 110

Code: Select all

 if (!enableGMCP) {
Should be

Code: Select all

 if (enableGMCP) {
Reasoning: With the ! there, it's using the ATCP table if GMCP is enabled, and then using GMCP table if ATCP is enabled. Changing the line to remove the !, the code works as expected.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: [available] GMCP in Mudlet

Post by Vadi »

I'm not seeing the problem.
Code: [show] | [select all] lua
              enableGMCP = true;
              sendTelnetOption( TN_DO, GMCP );

...

void cTelnet::atcpComposerSave( QString txt )
{
    //olesetbuf \n <text>
    string _h;

    /* we do this if ATCP is on */
    if (!enableGMCP) {
        _h += TN_IAC;
        _h += TN_SB;
        _h += 200;
        _h += "olesetbuf \n ";
        _h += txt.toLatin1().data();
        _h += '\n';
        _h += TN_IAC;
        _h += TN_SE;
    } else { /* we do this if GMCP is on */
        _h += TN_IAC;
        _h += TN_SB;
        _h += 201;
        _h += "IRE.Composer.SetBuffer \"";
        _h += txt.toLatin1().data();
        _h += "\"";
        _h += TN_IAC;
        _h += TN_SE;
    }

    socketOutRaw( _h );
    _h.clear();
    _h += "*s\n";
    socketOutRaw( _h );
    if( ! mpComposer ) return;
    mpComposer->close();
    mpComposer = 0;
}
It doesn't look great, but since both are IRE-specific, it won't be an issue. I tested and it saved new text fine for me that I remember.

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: [available] GMCP in Mudlet

Post by Rakon »

It wasn't working for me, with the original code. Mudlet was sending 'olesetbuf <text>' . At anyrate, if it's working for everyone else then, that's fine; I'll try and remember to change the code on my end if I recompile.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: [available] GMCP in Mudlet

Post by Vadi »

Then you probably had GMCP off? olesetbuf if supposed to be sent for ATCP only.

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: [available] GMCP in Mudlet

Post by Rakon »

Please don't condescend me, Vadi.

I 100% surely had GMCP turned on. Tested and verified multiple ways that GMCP was properly enabled. All of my GMCP scripts in Mudlet where working fine, GMCP from Mudbot to Mudlet fine, GMCP from Achaea straight to Mudlet, fine.
In all situations, your composer code sent the olesetbuf instead of the GMCP IRE.Composer.SetBuffer as it should, with GMCP enabled.

(Testing code below, with Mudbot as proxy, in order to log a bit more to console)

Original Code from BZR
Image 1 - GMCP Enabled:
Image
Image 2- Used Mudlet composer GUI to write a letter
Image
OleSetBuf, text NOT sent

Changed code (removed !), then recompiled and restarted Mudlet
Image 1- GMCP Enabled (still)
Image
Image 2 - Used Mudlet composer GUI to write a letter
Image
IRE.Composer.SetBuffer, text sent

What else could be changing the outcome of this particular set of code? If you have anything else you'd like me to test, to be sure let me know.

Post Reply