public override void Initialize(InsightServer _server, ModuleManager _manager) { Debug.Log("[ServerAuthentication] - Initialization"); server = _server; RegisterHandlers(); }
public virtual void Initialize(InsightServer serverTransport, string networkAddress, int networkHostId, int networkConnectionId) { address = networkAddress; hostId = networkHostId; connectionId = networkConnectionId; server = serverTransport; }
//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"); } }
public override void Initialize(InsightServer _server, ModuleManager _manager) { Debug.Log("[MasterSpawner] - Initialization"); server = _server; RegisterHandlers(); }
public override void Initialize(InsightServer insight, ModuleManager manager) { server = insight; RegisterHandlers(); server.transport.OnServerDisconnected.AddListener(HandleDisconnect); }
public override void Initialize(InsightServer server, ModuleManager manager) { this.server = server; RegisterHandlers(); server.transport.OnServerDisconnected = HandleDisconnect; }
public override void Initialize(InsightServer insight, ModuleManager manager) { server = insight; masterSpawner = manager.GetModule <MasterSpawner>(); RegisterHandlers(); server.transport.OnServerDisconnected += HandleDisconnect; }
public override void Initialize(InsightServer _server, ModuleManager _manager) { Debug.Log("[ServerMatchMaker] - Initialization"); server = _server; gameModule = _manager.GetModule <GameMasterManager>(); RegisterHandlers(); }
public override void Initialize(InsightServer _server, ModuleManager _manager) { Debug.Log("[ChatServer] - Initialization"); server = _server; authModule = _manager.GetModule <ServerAuthentication>(); gameModule = _manager.GetModule <GameMasterManager>(); RegisterHandlers(); }
public override void Initialize(InsightServer server, ModuleManager manager) { this.server = server; if (manager.GetModule <ServerAuthentication>() != null) { authModule = manager.GetModule <ServerAuthentication>(); } RegisterHandlers(); }
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); }
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); }
private void Awake() { server = GetComponent <InsightServer>(); client = GetComponent <InsightClient>(); if (server) { server.enabled = false; } if (client) { client.enabled = false; } }
void Awake() { if (DontDestroy) { if (instance != null && instance != this) { Destroy(gameObject); return; } instance = this; DontDestroyOnLoad(this); } else { instance = this; } }
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 } }
/// <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"); }
public override void Initialize(InsightServer insight, ModuleManager manager) { server = insight; RegisterHandlers(); }
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()); } } }
public override void Initialize(InsightServer server, ModuleManager manager) { this.server = server; RegisterHandlers(); }