Ticket destroyed.

How to handle "Ticket destroyed." type of events?

In the past and with the old "WebRTC Plugin", we where asked every now and then, how to handle connection closure events.

While the "LoveLetter's" might also return the Ticket destroyed. message, it's not the recommended way to react to these kind of events.

Arcware Cloud will disconnect the websocket, on any incident. That's why it's recommended to listen to the WebSocket closure event.

// Assuming you have your PixelStreaming of ArcwareInit at hand ...
PixelStreaming.websocketOnCloseHandler.add((event: CloseEvent) => {
    console.log(`WebSocket closed. CloseCode: ${event.code} Reason: ${event.reason}`);
});

The WebSocket default close codes can be found here.

Below you'll find a potentially outdated list of close codes custom to Arcware:

export enum CloseCode {
  UNAUTHORIZED = 4450,
  UNAUTHORIZED_NO_BYPASS_REGISTERED = 4451,

  SUSPENDED = 4453,

  NO_STREAM_AVAILABLE = 4501,
  NO_PACKAGENAME_PROVIDED = 4502,
  STREAM_DISCONNECTED = 4503,
  STREAM_KEY_ALREADY_CONNECTED = 4504,
  CLIENT_OCCUPATION_LIMIT_REACHED = 4505,
  CLIENT_AFK = 4506,
  CLIENT_RECCONECTING = 4507,
  CLIENT_NO_PONG = 4508,
  CLIENT_DESTROYED = 4509,

  CLOSE_ABNORMAL_CUSTOM = 4606,
  CLOSE_SHARE_NO_RESOURCES_LEFT = 4607,
  CLOSE_SHARE_ERROR = 4608,

  CLOSE_INTERNAL_SERVER_ERROR = 4666
}

Last updated