I've been troubleshooting and debugging this issue for a while now and I've pinpointed it to the part where Blockland crashes. I have a couple functions that get called one after another that talk between the client and the server, but on the last clientCmd function, I schedule a call 2000 ms later to perform a function that sends a command to the server. When that function gets called, Blockland crashes.
I'll post the snips of code and what the console is saying at time of crash.
So the schedule that has the 2000 ms delay and calls "relayFunction" is what we're looking at. (The "UG_addItem" function says that it finishes up in the console, and the crash happens after the 2000 ms has passed, that's how I know it is the "relayFunction" function)
lilDebug("clientCmdUG_addItem: Checked spaces");
if(%check)
{
lilDebug("clientCmdUG_addItem: Space was found at ["@%x@","@%y@"]");
schedule(1000,0,"UG_addItem",%itemID,%x,%y);
lilDebug("Set schedule for relayFunction");
schedule(2000,0,"relayFunction");
}
Here is the relayFunction that gets called. (lilDebug is a simple function that echoes if a variable is true)
function relayFunction()
{
lilDebug("relayFunction called");
commandToServer("SayHi");
lilDebug("relayFunction ending");
}
The serverCmd that gets called. Extremely simple, nothing should go wrong.
function serverCmdSayHi(%client)
{
announce(%client.getPlayerName()@" says hi!");
}
Here is the console.log part just before crash:
Entering lilDebug(Set schedule for relayFunction)
Set schedule for relayFunction
Leaving lilDebug() - return
Leaving clientCmdUG_AddItem() - return
Entering UG_addItem(0:04:08, 1, 2)
[This is unnecessary code within UG_addItem that will just clutter]
Entering lilDebug(UG_addItem: Finishing up function)
UG_addItem: Finishing up function
Leaving lilDebug() - return
Leaving UG_addItem() - return
Entering relayFunction()
Entering lilDebug(relayFunction called)
relayFunction called
And that is where Blockland crashes. So the relay function gets called after the 2000 ms, but it never actually processes the serverCmd it should be calling.
So one thought that comes to mind, would be that it might be a Mac instability issue. My BL has been known to crash when many things happen at once or something similar, but those with the Windows version didn't. So maybe try running a similar script? Or maybe you see an issue my syntax? Or a blatant error I made? Thanks for any attempts at helping