コード例 #1
0
 public override void Initialize(InsightClient insight, ModuleManager manager)
 {
     if (MaxMinutesOfIdle > 0)
     {
         InvokeRepeating("UpdateIdleState", MaxMinutesOfIdle * 60f, MaxMinutesOfIdle * 60f);
     }
 }
コード例 #2
0
        public override void Initialize(InsightClient _client, ModuleManager _manager)
        {
            Debug.Log("[ClientMatchMaker] - Initialization");
            client = _client;

            gameModule = _manager.GetModule <GameClientManager>();
        }
コード例 #3
0
 public virtual void Initialize(InsightClient clientTransport, string networkAddress, int networkHostId, int networkConnectionId)
 {
     address      = networkAddress;
     hostId       = networkHostId;
     connectionId = networkConnectionId;
     client       = clientTransport;
 }
コード例 #4
0
        public override void Initialize(InsightClient _client, ModuleManager _manager)
        {
            Debug.Log("[ChatClient] - Initialization");
            client = _client;

            RegisterHandlers();
        }
コード例 #5
0
ファイル: InsightModule.cs プロジェクト: Raystorms/Insight
 public virtual void Initialize(InsightClient client, ModuleManager manager)
 {
     if (client.logNetworkMessages)
     {
         Debug.LogWarning("[Module Manager] Initialize InsightClient not found for module");
     }
 }
コード例 #6
0
        public override void Initialize(InsightClient client, ModuleManager manager)
        {
            this.client = client;

            networkManagerTransport = Transport.activeTransport;

            RegisterHandlers();
        }
コード例 #7
0
        public override void Initialize(InsightClient _client, ModuleManager _manager)
        {
            Debug.Log("[ServerIdler] - Initialization");

            transport  = Transport.activeTransport;
            netManager = NetworkManager.singleton;

            RegisterHandlers();

            CheckIdle();
        }
コード例 #8
0
        public override void Initialize(InsightClient insight, ModuleManager manager)
        {
            client = insight;
            client.transport.OnClientConnected = SendGameRegistrationToGameManager;

            networkManagerTransport = Transport.activeTransport;

            RegisterHandlers();
            GatherCmdArgs();

            InvokeRepeating("SendGameStatusToGameManager", 30f, 30f);
        }
コード例 #9
0
        public override void Initialize(InsightClient insight, ModuleManager manager)
        {
            client = insight;

            insightTransport.OnClientConnected.AddListener(SendGameRegistrationToGameManager);

            RegisterHandlers();

            GatherCmdArgs();

            InvokeRepeating("SendGameStatusToGameManager", 30f, 30f);
        }
コード例 #10
0
        private void Awake()
        {
            server = GetComponent <InsightServer>();
            client = GetComponent <InsightClient>();

            if (server)
            {
                server.enabled = false;
            }
            if (client)
            {
                client.enabled = false;
            }
        }
コード例 #11
0
        public override void Initialize(InsightClient _client, ModuleManager _manager)
        {
            Debug.Log("[GameServerManager] - Initialization");
            client = _client;

            transport  = Transport.activeTransport;
            netManager = NetworkManager.singleton;

            GatherCmdArgs();

            RegisterHandlers();

            netManager.maxConnections = maxPlayers;
            netManager.StartServer();
        }
コード例 #12
0
ファイル: ModuleManager.cs プロジェクト: Raystorms/Insight
        void Awake()
        {
            client = GetComponent <InsightClient>();
            server = GetComponent <InsightServer>();

            if (client)
            {
                _cachedClientAutoStartValue = client.AutoStart;
                client.AutoStart            = false; //Wait until modules are loaded to AutoStart
            }

            if (server)
            {
                _cachedServerAutoStartValue = server.AutoStart;
                server.AutoStart            = false; //Wait until modules are loaded to AutoStart
            }
        }
コード例 #13
0
 void Awake()
 {
     if (DontDestroy)
     {
         if (instance != null && instance != this)
         {
             Destroy(gameObject);
             return;
         }
         instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         instance = this;
     }
 }
コード例 #14
0
 public virtual void Initialize(InsightClient _client, ModuleManager _manager)
 {
     Debug.LogWarning("[Module Manager] Initialize InsightClient not found for module");
 }
コード例 #15
0
ファイル: ModuleManager.cs プロジェクト: Raystorms/Insight
        public bool InitializeModules(InsightClient client, InsightServer server)
        {
            var checkOptional = true;

            // Initialize modules
            while (true)
            {
                var changed = false;
                foreach (var entry in _modules)
                {
                    // Module is already initialized
                    if (_initializedModules.Contains(entry.Key))
                    {
                        continue;
                    }

                    // Not all dependencies have been initialized
                    if (!entry.Value.Dependencies.All(d => _initializedModules.Any(d.IsAssignableFrom)))
                    {
                        continue;
                    }

                    // Not all OPTIONAL dependencies have been initialized
                    if (checkOptional && !entry.Value.OptionalDependencies.All(d => _initializedModules.Any(d.IsAssignableFrom)))
                    {
                        continue;
                    }

                    // If we got here, we can initialize our module
                    if (server)
                    {
                        entry.Value.Initialize(server, this);
                        Debug.LogWarning("[" + gameObject.name + "] Loaded InsightServer Module: " + entry.Key.ToString());
                    }
                    if (client)
                    {
                        entry.Value.Initialize(client, this);
                        Debug.LogWarning("[" + gameObject.name + "] Loaded InsightClient Module: " + entry.Key.ToString());
                    }

                    //Add the new module to the HashSet
                    _initializedModules.Add(entry.Key);

                    // Keep checking optional if something new was initialized
                    checkOptional = true;

                    changed = true;
                }

                // If we didn't change anything, and initialized all that we could
                // with optional dependencies in mind
                if (!changed && checkOptional)
                {
                    // Initialize everything without checking optional dependencies
                    checkOptional = false;
                    continue;
                }

                // If we can no longer initialize anything
                if (!changed)
                {
                    return(!GetUninitializedModules().Any());
                }
            }
        }
コード例 #16
0
ファイル: InsightModule.cs プロジェクト: uweenukr/Insight
 public virtual void Initialize(InsightClient client, ModuleManager manager)
 {
     logger.LogWarning("[Module Manager] Initialize InsightClient not found for module");
 }
コード例 #17
0
        public override void Initialize(InsightClient client, ModuleManager manager)
        {
            this.client = client;

            RegisterHandlers();
        }