Open JoeMatt opened 1 year ago
Here's a kit that allows you to automatically enable JIT. Usage is dead-simple:
import AltKit
ServerManager.shared.startDiscovering()
ServerManager.shared.autoconnect { result in
switch result
{
case .failure(let error): print("Could not auto-connect to server.", error)
case .success(let connection):
connection.enableUnsignedCodeExecution { result in
switch result
{
case .failure(let error): print("Could not enable JIT compilation.", error)
case .success:
print("Successfully enabled JIT compilation!")
ServerManager.shared.stopDiscovering()
}
connection.disconnect()
}
}
}
Since implementation is so simple, you could easily support several ways of enabling JIT, and just use whichever succeeds in connecting.
See: