Ejemplo n.º 1
0
        void OnStateChangedProc(int state, byte[] resultdata)
        {
            ConnectorResult result = convertConnectorResult(resultdata);
            ConnectorState  s      = (ConnectorState)state;

            ADebug.Log("OnStateChangedProc state: " + s + " " + result.ToString());
            if (s == ConnectorState.Reconnected && result.IsSuccess())
            {
                Connected = true;
            }
            else
            {
                Connected = false;
            }

            if (StateChangedEvent != null)
            {
                try
                {
                    StateChangedEvent(s, result);
                } catch (Exception ex)
                {
                    ADebug.LogException(ex);
                }
            }
        }
Ejemplo n.º 2
0
        void OnDisconnectProc(byte[] data)
        {
            ConnectorResult result = convertConnectorResult(data);

            ADebug.Log("c#:OnDisconnectProc: " + result);
            if (result.IsSuccess())
            {
                Connected = false;
            }

            if (DisconnectEvent != null)
            {
                try
                {
                    DisconnectEvent(result);
                } catch (Exception ex)
                {
                    ADebug.LogException(ex);
                }
            }
        }