Server-only/Client-only code
How to strip code from the server or client, making code server or client only.
Method 1: Server-only/Client-only methods
export default class ServerAndClientOnlyMethods extends AirshipBehaviour {
@Server()
public ServerOnlyMethod() {
print("This will only be on, and callable by the server!")
}
@Client()
public ClientOnlyMethod() {
print("This will only be on, and callable by the client!");
}
}Server/Client only lifecycle methods
Method 2: Conditional directives
Last updated