wheneverUserDisconnects static method

void wheneverUserDisconnects(
  1. OnSessionDisconnected onSessionDisconnected
)

Provide a method that gets executed whenever a user loses connection to the server.

Implementation

static void wheneverUserDisconnects(
    OnSessionDisconnected onSessionDisconnected) {
  globalSessionInstance.functionsToBeExecutedOnDisconnect
      .add(onSessionDisconnected);
}