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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  Plugin crashes MUSHclient

Plugin crashes MUSHclient

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


Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Fri 28 May 2004 10:32 PM (UTC)
Message
This plugin crashes MUSHclient 3.50, and I have no idea why.


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
   name="AutoUpdater"
   author="Poromenos"
   id="e17f476a9a92ddb464f419f3"
   language="VBscript"
   purpose="Updates plugins automatically."
   save_state="y"
   date_written="2004-05-29 01:06:58"
   requires="3.49"
   version="1.0"
   >

</plugin>
<aliases>
  <alias
   script="sbReload"
   match="test"
   enabled="y"
   sequence="100"
  >
  </alias>
</aliases>
<script>
<![CDATA[
Sub sbReload(strName, strLine, strWildcards)
    Dim lstPlugins

    lstPlugins = World.GetPluginList

    If Not IsEmpty (lstPlugins) Then

        For Each itmPlugin In lstPlugins
            If itmPlugin <> "e17f476a9a92ddb464f419f3" Then
                ReloadPlugin itmPlugin
                Note "Reloaded " & itmPlugin & " (" & GetPluginInfo (itmPlugin, 1) & ")"
            Else
                note "hi"
            End If
        Next

    End If
End Sub
]]>
</script>
</muclient>

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #1 on Fri 28 May 2004 10:33 PM (UTC)
Message
It produces the error page, and if you don't click OK fast enough, it crashes. If you do click OK and it doesn't crash, it crashes when you try to remove the plugin from the plugins page, so test that too.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Fri 28 May 2004 11:42 PM (UTC)

Amended on Fri 28 May 2004 11:43 PM (UTC) by Nick Gammon

Message
OK, I didn't test reloading plugin A from plugin B, and it does indeed crash.

I have fixed that in version 3.51.

For now make an alias in the main world (not a plugin) for reloading a plugin you are working on.

- Nick Gammon

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

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #3 on Fri 28 May 2004 11:45 PM (UTC)
Message
It's supposed to reload all plugins on command, it's ok, i can wait for the next version... also, i added a LoadPlugin "whatever.xml" line in that plugin, and that also crashes it.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #4 on Fri 28 May 2004 11:47 PM (UTC)

Amended on Fri 28 May 2004 11:48 PM (UTC) by Poromenos

Message
Also, this crashes too:
DoAfterSpecial 2, "ReloadPlugin """ & itmPlugin & """", 12
I guess it's normal, if it executes in the plugin's script space...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Sat 29 May 2004 03:36 AM (UTC)
Message
I can't reproduce the DoAfterSpecial one - did you take out the other line? The DoAfterSpecial should not execute in the plugin script space.

- Nick Gammon

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

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #6 on Sat 29 May 2004 10:33 AM (UTC)
Message
Let me check again, maybe it's not it. Yes, it crashes. In the autoupdater plugin, replace the code with this:

Sub sbReload(strName, strLine, strWildcards)
    Dim lstPlugins

    lstPlugins = World.GetPluginList

    If Not IsEmpty (lstPlugins) Then

        For Each itmPlugin In lstPlugins
            DoAfterSpecial 2, "ReloadPlugin """ & itmPlugin & """", 12
        Next

    End If
End Sub


How about LoadPlugin? Does that crash too?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Sat 29 May 2004 10:43 PM (UTC)
Message
I can reproduce that with 3.50 (I had the other if test in), however it seems OK with 3.51.

I haven't tested LoadPlugin from a plugin but I guess it will have the same problem. I have applied the same fix.

Basically the fix is to save the current plugin "space" during the load, and restore it afterwards, otherwise the plugin script space switches to the newly-loaded one.

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


15,929 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]