private void onRecFailed(SocketIOEvent obj)
 {
     if (parent.reconnectMode)
     {
         parent.reconnectMode = false;
         onReconnectFailed();
         this.onDCCallBack = null;
         io.Close();
     }
 }
示例#2
0
 public void Disconnection()
 {
     socket.Close();
     connecting = false;
     name       = "";
     id         = "";
 }
示例#3
0
 void OnDisable()
 {
     if (_Socket)
     {
         _Socket.Close();
     }
 }
示例#4
0
 /// <summary>
 /// Close this instance.
 /// </summary>
 internal void Close()
 {
     if (IsConnected())
     {
         socket.sid = "";
         socket.Close();
     }
 }
 void DoClose()
 {
     if (socket != null)
     {
         socket.Close();
         socket = null;
     }
 }
示例#6
0
 public void StopSocket()
 {
     socketIo.AllOff();
     socketError = false;
     socketIo.Close();
     connectBtn.sprite      = connectIcon;
     socketURL.interactable = true;
 }
 public virtual void OnClose(SocketIOEvent e)
 {
     Debug.Log("[SocketIO] Close: " + e.data);
     if (socket)
     {
         if (socket.IsConnected)
         {
             socket.Close();
         }
     }
 }
示例#8
0
 public void Disconnect()
 {
     if (socket.IsConnected)
     {
         socket.Close();
     }
     else
     {
         Debug.LogWarning("Socket is not connected.");
     }
 }
示例#9
0
    public void Disconnect()
    {
        if (!socket.IsConnected)
        {
            return;
        }

        Debug.Log("Disconnecting from game lobby service...");
        socket.Close();
        RoomCode    = string.Empty;
        ClientCount = 0;
    }
示例#10
0
    private void Disconnect()
    {
        socket.Off("error", ErrorCallback);
        socket.Off("SUCCESS_CONNECT", OnSuccessConnect);
        socket.Off("INPUTTIME", OnSuccessSendData);

        socket.Close();

        if (UIManager.Instance.IsOpened <ConnectingUI>())
        {
            UIManager.Instance.CloseUI <ConnectingUI>();
        }
    }
示例#11
0
    private void Awake()
    {
        GameObject socketObj = GameObject.Find("SocketIO");

        if (socketObj != null)
        {
            SocketIOComponent socket = socketObj.GetComponent <SocketIOComponent>();
            socket.Close();

            GameObject.Destroy(socketObj);
            GameObject.Destroy(GameObject.Find("PlayerData"));
        }
    }
示例#12
0
 public static void SetDisconnect()
 {
     if (DDASocket.IsConnected)
     {
         DDASocket.Emit("gameEnded");
         DDASocket.Close();
     }
     if (GameSocket.IsConnected && !DDASocket.IsConnected)
     {
         GameSocket.Emit("gameEnded");
         GameSocket.Close();
         GameSocket = null;
     }
 }
示例#13
0
    public void btnDisconnect_OnClick()
    {
        #if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX
        try
        {
            SetWindowTitle(Application.productName);
        }
        catch (DllNotFoundException e)
        {
            Debug.Log(e.ToString());
        }
        #endif

        socket.Close();
    }
示例#14
0
    private void Update()
    {
        if (!IsClose)
        {
            if (pingElapsed >= PingTimeOut)
            {
                SocketComponent.Close();
#if UNITY_EDITOR
                Debugger.Log("Connection Closed");
#endif
            }

            Sync?.SyncUpdate();
        }
    }
示例#15
0
        protected void Start()
        {
            socket = GetComponent <SocketIOComponent>();
            OnStart();

#if UNITY_EDITOR
            if (socket.IsConnected)
            {
                //Complain at developer and select offending object
                Debug.LogError("Turn off AutoConnect on SocketIOComponent or it will break a Standalone build");
                UnityEditor.Selection.activeGameObject = socket.gameObject;

                socket.Close();
                socket.autoConnect = false;
            }
#endif

            #region Message Handlers
            //Connection Accepted
            socket.On("connect", HandleConnectedToSGServer);           //Connected, Send App Handshake with App Info
            socket.On("AppEndMsg", HandleDisconnected);                //Connected, Send App Handshake with App Info
                                                                       //Handshake Accepted
            socket.On("AppHandshakeMsg", HandleAppHandshake);          //App Handshake Accepted
                                                                       //Gamepad Connected
            socket.On("SGHandshakeMsg", HandleGamepadHandshake);       //Handshake a new Gamepad
                                                                       //Gamepad Update
            socket.On("SGUpdateMsg", HandleGamepadUpdate);             //Message for a single gamepad
                                                                       //Gamepad Timing Out
            socket.On("SGTimingOutMsg", HandleGamepadTimingOut);       //Gamepad Timeout Timer has begun
                                                                       //Gamepad Reconnect
            socket.On("SGReconnectMsg", HandleGamepadReconnect);       //Gamepad Reconnected
                                                                       //Gamepad Disconnected
            socket.On("SGDisconnectMsg", HandleGamepadDisconnected);   //Gamepad Disconnected
                                                                       //Latency Calculation
            socket.On("app-ping", HandlePing);                         //Ping Request from Server
            socket.On("app-latency", HandleLatency);                   //Ping Calculation from server
            #endregion

            AssignExtraHandlers();

            socket.Connect();
            Debug.Log("Connecting...");
        }
示例#16
0
 void OnDisconnect()
 {
     socket.Close();
 }
示例#17
0
 void OnDestroy()
 {
     Debug.Log("destroy");
     socket.Close();
 }
示例#18
0
 public void Close()
 {
     socket.Close();
 }
示例#19
0
 public void Disconnect()
 {
     socket.Close();
 }
示例#20
0
 internal void Close()
 {
     SktIO.sid = "";
     SktIO.Close();
 }
示例#21
0
 private void OnApplicationQuit()
 {
     timer?.Abort();
     SocketComponent?.Close();
 }
示例#22
0
 // can call restart if want generate a new room id
 public void Restart()
 {
     IoComponent.On("disconnect", Reconnect);
     IoComponent.Close();
 }
示例#23
0
 private void OnDestroy()
 {
     socket.Close();          //Close connection
 }
示例#24
0
 public void Disconnect()
 {
     sIO.Close();
 }
示例#25
0
 public void BackToMenu()
 {
     _socket.Close();
     SceneManager.LoadScene("menu_ar", LoadSceneMode.Single);
 }
示例#26
0
 public void Disconnect()
 {
     Log("Disconnecting from Server");
     signedIn = false;
     socket.Close();
 }
 public void Close()
 {
     socket.Close();
     UnityEditor.EditorApplication.isPlaying = false;
     Application.Quit();
 }
示例#28
0
 void OnApplicationQuit()
 {
     socket.Close();
 }
示例#29
0
 void OnDisable()
 {
     socket.Close();
 }
示例#30
0
 private void CloseConnection(SocketIOEvent e)
 {
     socket.Close();
     Connected = false;
 }