コード例 #1
0
        public static DedicatedServerManager GetDedicatedServerManager()
        {
            if (AccelByteServerPlugin.dedicatedServerManager == null)
            {
                AccelByteServerPlugin.dedicatedServerManager = new DedicatedServerManager(
                    new DedicatedServerManagerApi(
                        AccelByteServerPlugin.config.DSMServerUrl,
                        AccelByteServerPlugin.config.Namespace,
                        AccelByteServerPlugin.httpWorker),
                    AccelByteServerPlugin.session,
                    AccelByteServerPlugin.coroutineRunner);
            }

            return(AccelByteServerPlugin.dedicatedServerManager);
        }
コード例 #2
0
        public static DedicatedServerManager GetDedicatedServerManager()
        {
            if (AccelByteServerPlugin.dedicatedServerManager != null)
            {
                return(AccelByteServerPlugin.dedicatedServerManager);
            }

            AccelByteServerPlugin.CheckPlugin();
            AccelByteServerPlugin.dedicatedServerManager = new DedicatedServerManager(
                new DedicatedServerManagerApi(
                    AccelByteServerPlugin.config.DSMControllerServerUrl,
                    AccelByteServerPlugin.config.Namespace,
                    AccelByteServerPlugin.httpClient),
                AccelByteServerPlugin.session,
                AccelByteServerPlugin.coroutineRunner);

            return(AccelByteServerPlugin.dedicatedServerManager);
        }
コード例 #3
0
        static AccelByteServerPlugin()
        {
#if UNITY_EDITOR // Handle an unexpected behaviour if Domain Reload (experimental) is disabled
            EditorApplication.playModeStateChanged += state =>
            {
                if (state == PlayModeStateChange.ExitingEditMode)
                {
                    hasBeenInitialized = false;

                    accessToken            = null;
                    server                 = null;
                    dedicatedServerManager = null;
                    ecommerce              = null;
                    statistic              = null;
                    qos           = null;
                    gameTelemetry = null;
                    achievement   = null;
                    lobby         = null;
                    cloudSave     = null;
                }
            };
        }
コード例 #4
0
        static AccelByteServerPlugin()
        {
#if UNITY_EDITOR // Handle an unexpected behaviour if Domain Reload (experimental) is disabled
            EditorApplication.playModeStateChanged += state =>
            {
                if (state != PlayModeStateChange.ExitingEditMode)
                {
                    return;
                }

                AccelByteServerPlugin.hasBeenInitialized     = false;
                AccelByteServerPlugin.accessToken            = null;
                AccelByteServerPlugin.server                 = null;
                AccelByteServerPlugin.dedicatedServerManager = null;
                AccelByteServerPlugin.ecommerce              = null;
                AccelByteServerPlugin.statistic              = null;
                AccelByteServerPlugin.qos           = null;
                AccelByteServerPlugin.gameTelemetry = null;
                AccelByteServerPlugin.achievement   = null;
                AccelByteServerPlugin.lobby         = null;
                AccelByteServerPlugin.cloudSave     = null;
                AccelByteServerPlugin.seasonPass    = null;
            };
        }