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 ➜ Plugins ➜ trying to make atcp2 plugin to work

trying to make atcp2 plugin to work

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


Pages: 1  2  3 4  5  6  7  8  9  

Posted by Maxhrk   USA  (76 posts)  Bio
Date Reply #30 on Thu 01 Jul 2010 12:05 AM (UTC)

Amended on Thu 01 Jul 2010 12:08 AM (UTC) by Maxhrk

Message
okay i have fixed the several problem that you raised and pushed it to github now... ah right i forgot i should test it before i push it. lol.. checking..

EDIT:
repushed. corrected a typo 'version()' to Version(). bah.
Top

Posted by Maxhrk   USA  (76 posts)  Bio
Date Reply #31 on Thu 01 Jul 2010 01:27 AM (UTC)
Message
Is there any way to invoke a function from other plugin? at the moment i know of was with the PPI.OnLoad function.
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #32 on Thu 01 Jul 2010 01:38 AM (UTC)
Message
Yes, something like this:

Service:
local foo

PPI.Expose("SetFoo", function(callback)
  foo = callback
end)

PPI.Expose("CallFoo", function()
  foo(42)
end)


Of course, you can call it anywhere once you have it, exposing a CallFoo was just the easiest way to demonstrate.


I'm about to push up my own changes. :)

'Soludra' on Achaea

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

Posted by Maxhrk   USA  (76 posts)  Bio
Date Reply #33 on Thu 01 Jul 2010 02:19 AM (UTC)
Message
oh well i was too hopeful for a simple example on client like this:

local dummy_service = PPI.Load(required_plugin)
dummy_service.hello() -- that should invoke that function to print 'hello' to the world!... or not.


oh well! :p
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #34 on Thu 01 Jul 2010 02:46 AM (UTC)

Amended on Thu 01 Jul 2010 02:47 AM (UTC) by Twisol

Message
Maxhrk said:

oh well i was too hopeful for a simple example on client like this:

local dummy_service = PPI.Load(required_plugin)
dummy_service.hello() -- that should invoke that function to print 'hello' to the world!... or not.


oh well! :p


Yeah, unfortunately it's not possible. You can't guarantee that one plugin will load completely before another, so you have to say "Hey, when this plugin loads, tell me." PPI handles this with OnLoad, and you just call PPI.Refresh() from OnPluginListChanged so it knows when things change.

Closest you can get is:

PPI.OnLoad(required_plugin, function(plugin)
  plugin.hello()
end)

function OnPluginListChanged()
  PPI.Refresh()
end

'Soludra' on Achaea

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

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #35 on Thu 01 Jul 2010 04:05 AM (UTC)
Message
At the risk of sounding like a broken record, would you mind not calling it GMCP? IRE somewhat appropriated that name for a community project then turned around and closed it, so it's more polite to just keep ATCP2, which is after all what it is. "GMCP" as IRE knows it isn't really what the people behind the name had in mind. :-|

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #36 on Thu 01 Jul 2010 04:05 AM (UTC)

Amended on Thu 01 Jul 2010 04:11 AM (UTC) by Twisol

Message
Okay, I've pushed up my lot of changes. Hope you don't mind!

It's hard to provide multiple plugins in one *.plugin folder (as I'm sure you noticed), so I removed the test XMLs and left the test Lua scripts in the examples folder. I'm not sure you need a test_service.lua file either, since GMCP -is- the service and users don't really need to see how to make their own.

[1] http://github.com/Twisol/gmcp.plugin

'Soludra' on Achaea

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

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #37 on Thu 01 Jul 2010 04:10 AM (UTC)
Message
David Haley said:

At the risk of sounding like a broken record, would you mind not calling it GMCP? IRE somewhat appropriated that name for a community project then turned around and closed it, so it's more polite to just keep ATCP2, which is after all what it is. "GMCP" as IRE knows it isn't really what the people behind the name had in mind. :-|


I would normally, but IRE's calling it GMCP and this is a plugin aimed at IRE's players. It would add an element of confusion where it's not needed. =/

'Soludra' on Achaea

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

Posted by Maxhrk   USA  (76 posts)  Bio
Date Reply #38 on Thu 01 Jul 2010 05:22 AM (UTC)
Message
Twisol, i have merged your branch into my own now. Thanks!
Top

Posted by Maxhrk   USA  (76 posts)  Bio
Date Reply #39 on Sat 03 Jul 2010 01:54 AM (UTC)
Message
Twisol,

I have noticed your lastest code caused a problem in particular with SendGMCP function:

two problems:


local content = json.encode({content})

it dont work well when trying neogitate with achaea so I removed the "{" and "}" and that solved the problem.

second:

SendPkt(codes.IAC_SB_GMCP .. message .. " " .. content[1] .. codes.IAC_SE)

cause error because it it attempted to concentrate "?". turn out it's content[1] that is culprit. As i guessed because you thought it was table which turn out to be a mere string after it is encoded.

So both are fixed and I will push latest code to github. After this post. :p





Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #40 on Sat 03 Jul 2010 02:24 AM (UTC)
Message
Yeah, actually I made a fix to that and I forgot to push it. Wrapping with {} is actually important, because it keeps things within the JSON spec. That is, the specification doesn't allow top-level values that aren't objects or arrays. ["Foo"] is valid, but "Foo" isn't. My intention was to serialize the Lua table {"Foo"} to become the JSON ["Foo"], then remove the [] from the ends, which is precisely the opposite operation to what I'm doing in OnPluginTelnetRequest.

(It's pushed now, by the by.)

'Soludra' on Achaea

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

Posted by Maxhrk   USA  (76 posts)  Bio
Date Reply #41 on Sat 03 Jul 2010 02:53 AM (UTC)
Message
tested and it is okay. thanks.
Top

Posted by Zugg   (1 post)  Bio
Date Reply #42 on Tue 13 Jul 2010 05:48 PM (UTC)
Message
CMUD also calls this GMCP, so ignore the naysayers that continue to call this protocol IRE-only. The JSON-based transport allows any MUD to create any packages they want. All IRE has done is define their own set of packages. As a data transport, GMCP is still the "Generic MUD Communication Protocol" and has nothing in it that is IRE-only.

Glad to see the progress on making a GMCP plugin for MUSHclient. Good job.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #43 on Tue 13 Jul 2010 06:07 PM (UTC)
Message
Zugg said:
All IRE has done is define their own set of packages.

No, that is not true. Among other things, they fixed the transport mechanism, which is in fact not JSON but some variation of it, despite the fact that it was being actively discussed. You also made a few executive decisions of your own, such as killing binary data or at the very least making it inconvenient, again despite the fact that there was not agreement and some strong opposition.

Please do not dismiss and insult people, as you have been doing here and elsewhere, simply because they do not agree with you. It's ok to disagree, but it's not ok to insult people because of disagreement.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #44 on Tue 13 Jul 2010 09:00 PM (UTC)
Message
Welcome to the MUSHclient forums, Zugg. :-)

- 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.


305,982 views.

This is page 3, subject is 9 pages long:  [Previous page]  1  2  3 4  5  6  7  8  9  [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.