Пример #1
0
        public override void Initialize(InsightServer _server, ModuleManager _manager)
        {
            Debug.Log("[ServerAuthentication] - Initialization");
            server = _server;

            RegisterHandlers();
        }
Пример #2
0
 public virtual void Initialize(InsightServer serverTransport, string networkAddress, int networkHostId, int networkConnectionId)
 {
     address      = networkAddress;
     hostId       = networkHostId;
     connectionId = networkConnectionId;
     server       = serverTransport;
 }
Пример #3
0
        //public abstract InsightCommon Insight { get; set; }

        //public abstract ModuleManager ModuleManager { get; set; }

        /// <summary>
        ///     Called by master server, when module should be started
        /// </summary>
        public virtual void Initialize(InsightServer server, ModuleManager manager)
        {
            if (server.logNetworkMessages)
            {
                Debug.LogWarning("[Module Manager] Initialize InsightServer not found for module");
            }
        }
Пример #4
0
        public override void Initialize(InsightServer _server, ModuleManager _manager)
        {
            Debug.Log("[MasterSpawner] - Initialization");
            server = _server;

            RegisterHandlers();
        }
Пример #5
0
        public override void Initialize(InsightServer insight, ModuleManager manager)
        {
            server = insight;
            RegisterHandlers();

            server.transport.OnServerDisconnected.AddListener(HandleDisconnect);
        }
Пример #6
0
        public override void Initialize(InsightServer server, ModuleManager manager)
        {
            this.server = server;

            RegisterHandlers();

            server.transport.OnServerDisconnected = HandleDisconnect;
        }
Пример #7
0
        public override void Initialize(InsightServer insight, ModuleManager manager)
        {
            server        = insight;
            masterSpawner = manager.GetModule <MasterSpawner>();
            RegisterHandlers();

            server.transport.OnServerDisconnected += HandleDisconnect;
        }
Пример #8
0
        public override void Initialize(InsightServer _server, ModuleManager _manager)
        {
            Debug.Log("[ServerMatchMaker] - Initialization");
            server = _server;

            gameModule = _manager.GetModule <GameMasterManager>();

            RegisterHandlers();
        }
Пример #9
0
        public override void Initialize(InsightServer _server, ModuleManager _manager)
        {
            Debug.Log("[ChatServer] - Initialization");
            server = _server;

            authModule = _manager.GetModule <ServerAuthentication>();
            gameModule = _manager.GetModule <GameMasterManager>();

            RegisterHandlers();
        }
Пример #10
0
        public override void Initialize(InsightServer server, ModuleManager manager)
        {
            this.server = server;

            if (manager.GetModule <ServerAuthentication>() != null)
            {
                authModule = manager.GetModule <ServerAuthentication>();
            }

            RegisterHandlers();
        }
Пример #11
0
        public override void Initialize(InsightServer insight, ModuleManager manager)
        {
            server        = insight;
            this.manager  = manager;
            authModule    = this.manager.GetModule <ServerAuthentication>();
            gameManager   = this.manager.GetModule <ServerGameManager>();
            masterSpawner = this.manager.GetModule <MasterSpawner>();

            RegisterHandlers();

            InvokeRepeating("InvokedUpdate", MatchMakingPollRate, MatchMakingPollRate);
        }
Пример #12
0
        public override void Initialize(InsightServer insight, ModuleManager manager)
        {
            server        = insight;
            authModule    = manager.GetModule <ServerAuthentication>();
            gameManager   = manager.GetModule <ServerGameManager>();
            masterSpawner = manager.GetModule <MasterSpawner>();

            RegisterHandlers();

            server.transport.OnServerDisconnected += HandleDisconnect;

            InvokeRepeating("InvokedUpdate", MatchMakingPollRate, MatchMakingPollRate);
        }
Пример #13
0
        private void Awake()
        {
            server = GetComponent <InsightServer>();
            client = GetComponent <InsightClient>();

            if (server)
            {
                server.enabled = false;
            }
            if (client)
            {
                client.enabled = false;
            }
        }
Пример #14
0
 void Awake()
 {
     if (DontDestroy)
     {
         if (instance != null && instance != this)
         {
             Destroy(gameObject);
             return;
         }
         instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         instance = this;
     }
 }
Пример #15
0
        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
            }
        }
Пример #16
0
 /// <summary>
 ///     Called by master server, when module should be started
 /// </summary>
 public virtual void Initialize(InsightServer _server, ModuleManager _manager)
 {
     Debug.LogWarning("[Module Manager] Initialize InsightServer not found for module");
 }
Пример #17
0
 public override void Initialize(InsightServer insight, ModuleManager manager)
 {
     server = insight;
     RegisterHandlers();
 }
Пример #18
0
        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());
                }
            }
        }
Пример #19
0
 public override void Initialize(InsightServer server, ModuleManager manager)
 {
     this.server = server;
     RegisterHandlers();
 }