Closed AardCrowley closed 3 years ago
Can you do me a favor? Type 'config' and post what your game prompt is set to. I have a suspicion, and though I can confirm it easily on my end, it helps having another example to work with.
I think i figured out the issue with pagesize. If I figured correctly there is a race condition going on. the command "pagesize 0" is a server command. It goes to server and comes back with the result. While the plugin is local. So, when you execute "areas 1 300 keyword" right after disabling page size, it executes simultaneously with disable pagesize command. So, in the network race, if pagesize 0 reaches server first, we get ok result. Otherwise, it hangs. That's probably the reason I was getting random success if I keep spamming "xset index areas".
-- [[ Area index process ]]
function area_index_process()
DebugNote("Processing area index")
Execute("xset suspend page size") -- this command racing with command below
-- add wait here
DoAfterSpecial(0.1, [[ SendNoEcho("areas 1 300 keyword") ]], sendto.script) -- fast
end
I added a delay in the place mentioned above, and it worked fine. When removed again, it borked.
Now, since this is a command over the network, the wait may be unreliable. Because, if people lagging, it may take more time than you thought. Best would be to wait for "paging disable" text reply from server from the output of "pagesize 0".
Then you can process the areas.
Hmm, what's interesting is that it has ALWAYS been that way with no prior issues. I may rework the code to use 'wait' instead since it can match a trigger and proceed from there. Thanks for debugging it!
Simple fix, but to reproduce:
You will see the page break at some point.