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
➜ Bug reports
➜ ChatMessage not working
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Mr.lundmark
(51 posts) Bio
|
Date
| Sat 23 Oct 2010 09:52 AM (UTC) |
Message
| Hey!
I've set up a chat connection using
ChatAcceptCalls(23)
and
ChatCall("localhost", 23)
Once that is done, I try to iterate through all the connection id's we have and:
ChatMessage(id, 7, "Test")
That message is never received on the other user's OnPluginChatMessage. I'm currently connecting to my own computer from one mushclient to another. I'm using python-scripting for this. | Top |
|
Posted by
| Mr.lundmark
(51 posts) Bio
|
Date
| Reply #1 on Sat 23 Oct 2010 09:54 AM (UTC) |
Message
| I've tried connecting from one computer to another, still not working. | Top |
|
Posted by
| LezChap
(36 posts) Bio
|
Date
| Reply #2 on Sat 23 Oct 2010 05:23 PM (UTC) |
Message
| Is your router/firewall blocking it? | Top |
|
Posted by
| Mr.lundmark
(51 posts) Bio
|
Date
| Reply #3 on Sat 23 Oct 2010 06:39 PM (UTC) |
Message
| It shouldn't, since it allows connections to go through. It also allows disconnect-messages to go through. Everything is set up fine except the passing of messages. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #4 on Sat 23 Oct 2010 07:55 PM (UTC) |
Message
| You found a bug, introduced in version 4.62 which had a lot of code cleanups for plugins.
Due to the way it was calling the plugins it assumed that your attempt to send a message was being rejected. You may have also noticed that even without using plugins no messages were appearing when you started chat sessions.
Fixed, I hope, in version 4.65
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Mr.lundmark
(51 posts) Bio
|
Date
| Reply #5 on Sun 24 Oct 2010 07:11 AM (UTC) |
Message
| I think you managed to solve the bug Nick, awesome!
However, directly afterwards I think I found another bug.
My client (not the server) crashes upon connecting to the server.
I can actually see the log though:
Calling server at 127.0.0.1 port 23
Session established to localhost.
And then it crashes :/
Want me to supply the code?
| Top |
|
Posted by
| Mr.lundmark
(51 posts) Bio
|
Date
| Reply #6 on Sun 24 Oct 2010 07:16 AM (UTC) Amended on Sun 24 Oct 2010 07:17 AM (UTC) by Mr.lundmark
|
Message
| I narrowed down the crash.
It's when I add this code:
def OnPluginChatDisplay(message, text):
world.Note("OnPluginChatDisplay, message: " + str(message) + " text : " + str(text))
return True
| Top |
|
Posted by
| Mr.lundmark
(51 posts) Bio
|
Date
| Reply #7 on Sun 24 Oct 2010 07:23 AM (UTC) |
Message
| OnPluginChatMessage seems to work much better though. | Top |
|
Posted by
| Worstje
Netherlands (899 posts) Bio
|
Date
| Reply #8 on Sun 24 Oct 2010 12:11 PM (UTC) |
Message
| Try returning 0, or alternatively, 1.
Something in combination with Python, MUSHclient and the WSH means random errors if you return certain values. For example, in the past I have experienced crashes when not sending a return value back, but setting an explicit 0 return magically fixed it.
Whether it is a bug in Python, a bug in MUSHclient, or some weird no-mans-land of developers reading the APIs differently, I don't know, but that might very likely fix it.
But for now, try to stick to ints. And strings for callbacks wanting strings back. | Top |
|
Posted by
| Mr.lundmark
(51 posts) Bio
|
Date
| Reply #9 on Sun 24 Oct 2010 03:09 PM (UTC) |
Message
| Yeah that seems to solve it.
I don't understand why one function works with booleans while the other require ints? | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #10 on Sun 24 Oct 2010 08:01 PM (UTC) |
Message
| The partial answer is that the hard-coded calls use the type definitions in the .ODL file, for example:
[id(188)] long ChatGroup(BSTR Group, BSTR Message, BOOL Emote);
Now in this case I presume Python would enforce that you get back a long and not something else.
But the plugin callbacks use a "generic" caller (one that takes a VARIANT result I think) so they are more accepting of the data type you return. However I think Python still requires *some* sort of returned result, whereas other script languages may default to a NULL variant if you don't supply anything explicitly.
To be honest, I find the WSH interface quite confusing. Finding documentation on it is hard enough. |
- 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.
29,338 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top