disconnect() calls a sysDisconnectEvent of it's own

Bug #1676956 reported by Roland Goldberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mudlet
New
Undecided
Unassigned

Bug Description

Sample Code:

function doubleEcho()
  cecho("\n<black:yellow>This will echo twice, but only if currently connected to the MUD when disconenct() is called")
end

registerAnonymousEventHandler("sysDisconnectionEvent","doubleEcho")

disconnect()

Explanation:

sysDisconnectEvent is designed to let you know that the connection to the MUD has been terminated. However, regardless of whether there is a connection to the MUD, calling the disconnect() function raises sysDisconnectEvent. When connected to a MUD, this results in sysDisconnectEvent being called twice if you manually run a disconnect(). If the MUD disconnects you on the other hand, you only get one sysDisconnectEvent, as proper.

Usually this is no problem. However, sometimes a function that is registered to sysDisconnectEvent will have issues if it is run twice. Other times you may not want said function to run unless already connected to the MUD when disconnect() is called.

Revision history for this message
Stephen Lyons (slysven) wrote :

This looks like an accidental double-posting, see prior bug report.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.