ID:94042
 
BYOND Version:464
Operating System:Windows Vista Home Premium 64-bit
Web Browser:Opera 9.80
Applies to:Dream Seeker
Status: Deferred

This issue may be low priority or very difficult to fix, and has been put on the back burner for the time being.
Descriptive Problem Summary:
I don't know how to describe these issues, other than either Dream Daemon or Dream Seeker are doing things that should be absolutely impossible for them to do.

The issues are I suspect caused by whatever network changes were made in version 463.1062, due to these issues only happening to other people, and only when there is more than 6-8 online.

Anyway, the issue is that some lines of code are either being entirely skipped, or executed multiple times by Dream Daemon.

There is no other way to describe it. One line of code is executed, the next is skipped, then the line after that is also executed.

Or a single line of code is executed several times, for no apparent reason.
There is no loop happening, the lines before and after are also executed once, and outputting only one debug message. But somehow this one line is looping 4-5 times.

As I say, I suspect this is some sort of issue with how networking is handled, and something to do with packets being messed up.

I cannot imitate it on my own, but when lag occurs in the game I am hosting (which for me is usually around 8-10 people), this problem seems fairly common.

Sorry the details are vague. But I cannot just make this happen, nor can I easily see it happening.

I cannot specifically pin point what is happening or why, just what seems to be happening.
What I do know however is these things should not be happening, and it should literally be impossible for them to happen, and it only happens due to server lag.

If you want more details then you'll need to be specific, and if it helps I don't mind providing someone with the source code, just to prove it is not a bug with the coding.
Code executed multiple times or skipped is very, very unlikely to be related to any networking issues, but I can take a look at the source sometime if you email it to me at [email protected]. I will however need to know what I'm supposed to be looking for and which lines of code seem to be skipped or repeated.

For now I'll mark this as unverified since the problem description is fairly vague and there's no information at all to reproduce the issue.
The only lines that appear to be skipped per your markings are winshow() calls. I think those are almost certain to be programmer error and should probably be handled on the developer forums. My guess is you're using an ambiguous name and the wrong window/control is showing up, or the window/control doesn't exist at the time you're calling it, or you have a bad client there. Check your Options & Messages window for clues as well. This appears to be unrelated to the multiple call issue.

The multiple call issue only shows up in places where you've called sleep() with a proc instead of with a hard value or a var. I don't think this is a coincidence. Now obviously sleep() should still work in those cases so if it's re-calling the code multiple times there's definitely a bug, but it's going to be in a deep, dark part of the interpreter so for that reason I'm deferring the issue. It looks like there are cases where your procs may accidentally return a null value, like in one call to Activate() that runs "del src" before a return 20 line, so that's something to look at.

As a general workaround, I advise calling all these procs before sleep() and storing their result in a var, and then passing that var to sleep(). That should avoid all the problems you've been having except with winshow(), which is a separate issue.
Just to be safe, please do retest this in an older version to see if there was a version where this suddenly appeared. However I think the workaround I provided should do the trick.
Lummox JR wrote:
The only lines that appear to be skipped per your markings are winshow() calls. I think those are almost certain to be programmer error and should probably be handled on the developer forums. My guess is you're using an ambiguous name and the wrong window/control is showing up, or the window/control doesn't exist at the time you're calling it, or you have a bad client there. Check your Options & Messages window for clues as well. This appears to be unrelated to the multiple call issue.

I have looked at Options & Messages, and it reported nothing. No error messages, or anything.
Also, some people have reported seeing... Part of a window. Usually the top right/left corner.
I've never had it happen, or seen the window myself, but it is definitely not part of the interface.
It could be some other bug or something, but I don't know enough about it to make any sort of report.

The multiple call issue only shows up in places where you've called sleep() with a proc instead of with a hard value or a var. I don't think this is a coincidence. Now obviously sleep() should still work in those cases so if it's re-calling the code multiple times there's definitely a bug, but it's going to be in a deep, dark part of the interpreter so for that reason I'm deferring the issue. It looks like there are cases where your procs may accidentally return a null value, like in one call to Activate() that runs "del src" before a return 20 line, so that's something to look at.

As a general workaround, I advise calling all these procs before sleep() and storing their result in a var, and then passing that var to sleep(). That should avoid all the problems you've been having except with winshow(), which is a separate issue.

I will try this. But in tests on my own, calling del src before a return value did not cause any strange behavior.

I will also try older versions of BYOND and see if anything happens.
But this may take a while, as I said, I cannot imitate this when I want, and it seems fairly random at best.