uZone Callbacks

uZone Callbacks

To receive callbacks from uZone, you will first need to add the GameObject as a subscriber to uZone. You do this by calling InstanceManager.Subscribe(this.gameObject). All callbacks takes an argument of the type EventData. This is represented as:

class uZone.EventData { int ticket; object data; }

where ticket is a request identifier and data is unique to the callback. An example function header can look like this: uZone_OnConnected(EventData data).

Available callbacks:

  • uZone_OnConnected
  • uZone_OnDisconnected
  • uZone_OnNodeConnected
    data should be casted to InstanceManager.Node.
  • uZone_OnNodeDisconnected
    data is an integer that denotes the node id.
  • uZone_OnInstanceStarted
    data should be casted to InstanceManager.GameInstance.
  • uZone_OnInstanceStopped
    data is a list of integers that denotes the ids of imstances stopped.
  • uZone_OnAvailableInstancesUpdate
    data is of type string[]. Contains all the available game types.
  • uZone_OnNodeListReceived
    Called when user has called InstanceManager.ListNodes() or InstanceManager.ListNodes(string nodeType). data should be casted to a List<InstanceManager.Node>.
  • uZone_OnInstanceTypeListReceived
    string list
  • uZone_OnInstanceListReceived
    Called when user has called InstanceManager.ListInstances(). data should be casted to List<InstanceManager.GameInstance>.
  • uZone_OnDataReceived