Beispiel #1
0
        public static void InitService(UCSSprotocols protocol, string serviceName, string host, EventHandlerServiceInited initedCallback = null, EventHandlerServiceError errorCallback = null)
        {
            if (string.IsNullOrEmpty(serviceName))
            {
                throw new System.ArgumentNullException("serviceName");
            }
            if (string.IsNullOrEmpty(host))
            {
                throw new System.ArgumentNullException("host");
            }

            if (UCSS.Instance._initedProtocols.Count > 0 && UCSS.Instance._initedProtocols.ContainsKey(serviceName))
            {
                throw new System.InvalidOperationException("serviceName [" + serviceName + "] already exists in CSS");
            }

            BaseProtocol selectedProtocol = null;

            switch (protocol)
            {
            case UCSSprotocols.amf:
                break;

            default:
                throw new System.InvalidOperationException("protocol [" + protocol + "] is NOT found in InitService");
            }
            if (selectedProtocol != null)
            {
                UCSS.Instance._initedProtocols.Add(serviceName, selectedProtocol);
            }
            //Debug.Log("CSS.Instance._initedProtocols = " + UCSS.Instance._initedProtocols.Count);
        } // InitService
Beispiel #2
0
        public static void InitService(UCSSprotocols protocol, string serviceName, string host, EventHandlerServiceInited initedCallback = null, EventHandlerServiceError errorCallback = null)
        {
            if (string.IsNullOrEmpty(serviceName))
            {
                throw new System.ArgumentNullException("serviceName");
            }
            if (string.IsNullOrEmpty(host))
            {
                throw new System.ArgumentNullException("host");
            }

            if (UCSS.Instance._initedProtocols.Count > 0 && UCSS.Instance._initedProtocols.ContainsKey(serviceName))
            {
                throw new System.InvalidOperationException("serviceName [" + serviceName + "] already exists in CSS");
            }

            BaseProtocol selectedProtocol = null;
            switch (protocol)
            {
                case UCSSprotocols.amf:
                    break;
                default:
                    throw new System.InvalidOperationException("protocol [" + protocol + "] is NOT found in InitService");
            }
            if (selectedProtocol != null)
            {
                UCSS.Instance._initedProtocols.Add(serviceName, selectedProtocol);
            }
            //Debug.Log("CSS.Instance._initedProtocols = " + UCSS.Instance._initedProtocols.Count);
        }
Beispiel #3
0
 public static void InitService(UCSSprotocols protocol, UCSSservices serviceName, string host, EventHandlerServiceInited initedCallback = null, EventHandlerServiceError errorCallback = null)
 {
     UCSS.InitService(protocol, serviceName.ToString(), host, initedCallback, errorCallback);
 }
Beispiel #4
0
 public static void InitService(UCSSprotocols protocol, UCSSservices serviceName, string host, EventHandlerServiceInited initedCallback = null, EventHandlerServiceError errorCallback = null)
 {
     UCSS.InitService(protocol, serviceName.ToString(), host, initedCallback, errorCallback);
 }