A lot of LU functions take a string or pointer to a callback function. However, there seems to be no way to point to a function within a class.
Take the code below for example:
class Example {
mainSocket = null;
constructor(port){
mainSocket = NewSocket( this.ReceiveData );
mainSocket.SetNewConnFunc( this.Connected );
mainSocket.Start( port, 64 );
::print("Loaded example class and opened socket");
}
function Connected( socket, clientID, clientIP, clientPort ){
::print("Socket connected");
}
function ReceiveData( socket, clientID, data ){
::print("Received data");
}
}
ExampleClass <- Example(2345);
The socket is opened and can be connected to. However, the functions Connected and ReceiveData never get called. Script generates no errors. I've tried to make every possible reference to these functions I could think of, but nothing happens. Am I missing something, or is this just impossible to do?