Ejemplo n.º 1
0
 private void OnDestroy()
 {
     Debug.Log("[Arena] OnDestroy");
     OnConnected -= ReadyReConnect;
     UnsubsribeEvents();
     Disconnect();
     Instance = null;
 }
Ejemplo n.º 2
0
 void initAnszuClient()
 {
     if (!PTK.Ansuz.Ansuzinitialized)
     {
         ansuzClient                 = gameObject.AddComponent <PTK.Ansuz>();
         ansuzClient.OnConnected    += arenaConnected;
         ansuzClient.OnDisconnected += arenaDisonnected;
     }
 }
Ejemplo n.º 3
0
        public ArenaReceiver(Ansuz instance, string subscribeTopic, int requestID)
        {
            ansuz = instance;
            topic = subscribeTopic;

            arenaID      = instance.ArenaID;
            uid          = instance.UID;
            ownRequestID = requestID;
            ///instance.RegisterReceiver(subscribeTopic, this);
        }
Ejemplo n.º 4
0
        public void Init()
        {
            if (Instance != null)
            {
                enabled = false;
                DestroyImmediate(this);
                return;
            }
            Instance = this;

            GetDeviceToken();

            string defaultTopic = "arena/" + DeviceID;

            _qosMap[defaultTopic] = MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE;

            Ansuzinitialized = true;
        }
Ejemplo n.º 5
0
 public AnsuzTask(Ansuz instance, AnsuzRequest request)
 {
     ansuz        = instance;
     _requestJson = JsonUtility.ToJson(request);
 }