ID:1958133
 
BYOND Version:509 (please use Other... and specify minor build)
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 45.0.2454.101
Applies to:Dream Maker
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary: When a user logs out during an input, it will freeze that input in an indefinite loop. This will create serious glitches when incorporating them into my game and I don't feel like making my own input handler cause of this one issue.

Numbered Steps to Reproduce Problem:

Code Snippet (if applicable) to Reproduce Problem:
var/X = input(usr,"Test") as text //Logout here
world.log << "Test" //This will not happen


Expected Results:
I expected input to return null if the client does not exist anymore and the process to continue.

Actual Results: input() is still looping through itself forever.

Does the problem occur:
Every time? Or how often? Yes
In other games? Yes
In other user accounts? Yes
On other computers? Yes

When does the problem NOT occur?

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Workarounds: Create your own input handler.

I can confirm this, however after updating DD it seemed to have been fixed (I should note that I use Linux with DD from the command line and DS through wine)
I'm not so sure this is a bug. Is src in this proc also the same as usr? Was this proc initiated by another proc where usr is src?

If the mob is being deleted, any procs where that mob is src are also deleted. Any proc calls that proc is waiting to complete will be aborted.
Even when I updated, it is still happening. I am using it in Login() for the test.
hrm, that's a good point.

I know in one case where it happened src was NOT the mob but it definetly was the usr, and the stack started with src being the usr.

In another example I had this happen was src was the usr (client verb though).

EDIT: well this was supposed to be a reply to Lummox but it isn't showing? Maybe because @BlackProgrammer posted a reply between me starting to make the reply and saving it.
So just so I understand. input() will stop if the src is not present and the only reason it didn't in this case is because the src of this proc is what got deleted. Right?
In response to Lummox JR
Lummox JR wrote:
I'm not so sure this is a bug. Is src in this proc also the same as usr? Was this proc initiated by another proc where usr is src?

If the mob is being deleted, any procs where that mob is src are also deleted. Any proc calls that proc is waiting to complete will be aborted.

I can confirm that input() hangs after log out, even if it's called in a proc where usr==src.

These are my test cases:
//Test #1 (usr==src)
mob/verb/test()
world << src
world << usr
world.log << "hi"
promptforinput()
world.log << "usr lives" //Never outputs

mob/Login()
..()
mob/proc/promptforinput()
return input("") as text

//Test #2 (usr != src)
obj/verb/test()
world << src
world << usr
world.log << "hi"
input("") as text
world.log << "usr lives" //Never outputs

mob/Login()
..()
src.contents += new /obj


Compile each separately. Host this in DreamDaemon.
Connect. Use the test verb. Exit Dream Seeker without submitting the input. Log back in. Run ".debug status" in client menu -> command.
The test verb is shown as sleeping (because it's still waiting for input.)