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, confirm your email, resolve issues, 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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Suggestions ➜ GMCP Data open to non-plugins

GMCP Data open to non-plugins

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


Pages: 1 2  3  

Posted by Dontarion   USA  (62 posts)  Bio
Date Fri 22 Jul 2011 08:18 PM (UTC)
Message
From what I can tell the only things that have been addressed for GMCP-type data is a plugin that broadcasts the data and is only available to other plugins.

Has any strides been made to push GMCP data to the main Lua environment or made so that I can run a function from inside my main Lua script that will pickup those broadcasts?

It would be nice to see GMCP/ATCP data capture and storage built into the client since it is catching on or the ability for the main environment (non-plugin) to be able to receive broadcasts and/or easily pass tables.
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #1 on Fri 22 Jul 2011 10:13 PM (UTC)
Message
The main issue is that plugins are more privileged than the main world. That is, plugins have more hooks available (OnPluginSubnegotiation being the key one here). It's also hard to reliably pass the data from a plugin to the world, as CallPlugin can't call into the world's script space.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Dontarion   USA  (62 posts)  Bio
Date Reply #2 on Sat 23 Jul 2011 01:59 AM (UTC)
Message
What you posted is exactly what I've found out. I've tried to hook a specialty plugin back into the main environment but its troubled and requires things I really hate doing. Not to mention its messy and doesn't seem to be reliable.

That's why I'd like to see something done on the client side to deal with GMCP or ATCP if GMCP isn't available on a particular mud.

Why can't broadcast and other plugin functionalities be setup in the main environment? Is the a limitation of the framework or just how it was designed and could be easily changed?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Sat 23 Jul 2011 10:36 PM (UTC)
Message
The design evolved over the years, and plugins were done in a more modular way. I suppose it could be done, anything is possible after all, but why do you really need it? Plugins are much more useful if you have multiple worlds (eg. multiple characters even, on the same MUD) because you can share them and not have to make a minor fix to every world if you find a bug.

There are ways of communicating with the main script space easily enough. For example with GMCP if you change rooms the GMCP/ATCP plugin could just do something like (in the plugin):


Execute ("{roomnum} " .. current_room)


Then in the main world you make an alias that matches:


{roomnum} *


That way you find if you have changed rooms, and what the new room is. Ditto for other messages.

- Nick Gammon

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

Posted by Dontarion   USA  (62 posts)  Bio
Date Reply #4 on Sat 23 Jul 2011 11:03 PM (UTC)
Message
That's true but Achaea is sending a great deal of information through GMCP every prompt, look, inventory, etc. I dislike serializing and then recreating the tables (and tables within tables) of information every single time.

That would be multiple aliases executed per prompt (and if in combat I can see 1-5 prompts+ during raids). I've never tested if MUSH can handle that but I think it's a bit excessive.

I hate using plugins only because when I convert things to plugin format I end up having to change so much. I've been thinking about pushing my entire system to a plugin but it just NEVER works out right in regards to variables and even some functions I think I had issues with in the past.

When I converted a large amount of triggers for something called a wholist to plugin it took forever for me to make it work right in plugin form.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #5 on Sun 24 Jul 2011 03:48 AM (UTC)
Message
Dontarion said:

When I converted a large amount of triggers for something called a wholist to plugin it took forever for me to make it work right in plugin form.


That shouldn't happen. Can you describe in detail what problems you had?

- Nick Gammon

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

Posted by Dontarion   USA  (62 posts)  Bio
Date Reply #6 on Tue 02 Aug 2011 12:43 AM (UTC)
Message
It was many versions ago when I first started using MUSH (multiple years ago) and I just have stayed away from it since then.
Top

Posted by Kevnuke   USA  (145 posts)  Bio
Date Reply #7 on Sat 31 Dec 2011 09:41 PM (UTC)
Message
Why not assign whatever you want to have in the main Lua environment to a variable in the plugin and then call GetPluginVariable() from the script file or trigger etc? Unless I'm just a noob and that function can only be used in a plugin :P
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #8 on Sat 31 Dec 2011 10:13 PM (UTC)
Message
The issue is how to notify the main script environment that there's new data to get.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #9 on Sun 01 Jan 2012 07:50 PM (UTC)
Message
You can call GetPluginVariable from anywhere.

The plugin that detects the GMCP stuff could do a world.Execute, and use that to notify aliases in the main script that there is new data.

- Nick Gammon

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

Posted by Kevnuke   USA  (145 posts)  Bio
Date Reply #10 on Wed 04 Jan 2012 01:06 AM (UTC)
Message
This might be a stupid question, but if I used the telnet plugin callbacks in a plugin that doesn't send it's information from OnPluginTelnetSubnegotiation outside the plugin it's in, do i even need to use PPI. Can i just assign it to a local variable in the plugin and have it completely self contained?
Top

Posted by Kevnuke   USA  (145 posts)  Bio
Date Reply #11 on Wed 04 Jan 2012 01:44 AM (UTC)
Message
Personally, I'm also in favor of having the functionality of OnPluginTelnetRequest and OnPluginTelnetSubnegotiation as a client function in the main script space, so that they could be called in my script file or make them a premade hard-coded trigger that's available each time you create a new world file. MUSHclient already handles MCCP MXP and Pueblo in a behind the scenes manner. Why not ATCP and GMCP the same way?

It seems kinda stupid when I spend more time trying to figure out how to make a new idea work than actually playing the game that it's for when I want certain information to come from GMCP instead of from triggers or defining the variables manually myself.

Couldn't it be as simple as this?

health, maxhealth, mana, maxmana, endurance, maxendurance, willpower, maxwillpower, levelpercent = GetGMCPInfo ("Char.Vitals")

or

ash, bayberry, bellwort, bloodroot, cohosh, echinacea, elm, ginseng, goldenseal, hawthorn, kelp, kola, lobelia, moss, myrrh, pear, sileris, skullcap, valerian = GetGMCPInfo ("IRE.Rift")

and have a little check box for whether you want MUSHclient to tell the server to send GMCP data or not.

My system is just for my personal use, so why should i need to make a plugin to do all that?

Lets spend more time gaming and less time messing with code, seriously..
Top

Posted by Kevnuke   USA  (145 posts)  Bio
Date Reply #12 on Wed 04 Jan 2012 02:08 AM (UTC)
Message
One more thing. Twisol, in the GMCP plugin you made codes.IAC_DO_GMCP is initialized but I don't see it actually used anywhere in the plugin. Is it there and i missed it, or is that index unnecessary?
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #13 on Wed 04 Jan 2012 04:28 AM (UTC)
Message
Kevnuke said:
This might be a stupid question, but if I used the telnet plugin callbacks in a plugin that doesn't send it's information from OnPluginTelnetSubnegotiation outside the plugin it's in, do i even need to use PPI. Can i just assign it to a local variable in the plugin and have it completely self contained?

You can, and there's nothing inherently wrong with that. The reason we have reusable protocol plugins is so that you don't have to handle the protocol-level details. Also, there can be issues with multiple plugins attempting to negotiate with the server, so it's better to have a single plugin do the talking.

The GMCP plugin I posted is a self-contained module that makes its data accessible to other plugins. It needs PPI or some other mechanism to do that. For example, the ATCP plugin I originally inherited used BroadcastPlugin() and the OnPluginBroadcast hook to notify plugins about new data, but it wasn't especially flexible. And neither approach can reliably call back to the world script-space.

Kevnuke said:
Personally, I'm also in favor of having the functionality of OnPluginTelnetRequest and OnPluginTelnetSubnegotiation as a client function in the main script space, so that they could be called in my script file or make them a premade hard-coded trigger that's available each time you create a new world file. MUSHclient already handles MCCP MXP and Pueblo in a behind the scenes manner. Why not ATCP and GMCP the same way?

From a design perspective, it's better to make things modular. Certainly the interfaces we have now aren't the greatest, but MUSHclient is over 15 years old at this point. It's pretty hard to tell what you're going to need 15 years down the road.

From a practical perspective, the codebase is now old and crufty, and it's a testament to Nick's skill that the client is one of the best I've used. It might not be worthwhile to add another protocol in a part of the code that hasn't been touched in a long time.

That said, I'm in favor of giving the world space more of the plugin-only callbacks. I also wish we could use CallPlugin to call into the world, since that's the only reason I remember why you can't use PPI from the world to talk to the GMCP plugin.


Kevnuke said:
It seems kinda stupid when I spend more time trying to figure out how to make a new idea work than actually playing the game that it's for when I want certain information to come from GMCP instead of from triggers or defining the variables manually myself.

Couldn't it be as simple as this?

health, maxhealth, mana, maxmana, endurance, maxendurance, willpower, maxwillpower, levelpercent = GetGMCPInfo ("Char.Vitals")

or

ash, bayberry, bellwort, bloodroot, cohosh, echinacea, elm, ginseng, goldenseal, hawthorn, kelp, kola, lobelia, moss, myrrh, pear, sileris, skullcap, valerian = GetGMCPInfo ("IRE.Rift")

Not really. Imagine if you just want the valerian? And how does the computer know what order to return the numerous (potentially optional) fields in? It'd be better to return a table and let you pick what fields you want, like the GMCP plugin does now.

Kevnuke said:
One more thing. Twisol, in the GMCP plugin you made codes.IAC_DO_GMCP is initialized but I don't see it actually used anywhere in the plugin. Is it there and i missed it, or is that index unnecessary?

That's a remnant from before OnPluginTelnetRequest, when we had to hijack OnPluginPacketReceived and send our own IAC DO GMCP request. It's not necessary, no.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #14 on Wed 04 Jan 2012 05:06 AM (UTC)
Message
Kevnuke said:

Couldn't it be as simple as this?

health, maxhealth, mana, maxmana, endurance, maxendurance, willpower, maxwillpower, levelpercent = GetGMCPInfo ("Char.Vitals")


With a fairly simple GMCP plugin running in the background getting information as the MUD sends it, it should be pretty trivial to make an interface function in the main world script space that gets what you want (by doing a GetPluginVariable call) in much the way you describe it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


93,880 views.

This is page 1, subject is 3 pages long: 1 2  3  [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.