Beispiel #1
0
        private void Awake()
        {
            // Init the MainThreadManager
            MainThreadManager.Create();

            mpMenu   = this.GetComponentInParent <MultiplayerMenu>();
            Settings = mpMenu.Settings;
            serverListEntryTemplateHeight = ((RectTransform)serverListEntryTemplate.transform).rect.height;

            masterServerEnabled   = !string.IsNullOrEmpty(Settings.masterServerHost);
            localDiscoveryEnabled = Settings.getLocalNetworkConnections;

            // No need to do anything else if local discovery or master server is not enabled
            if (!localDiscoveryEnabled && !masterServerEnabled)
            {
                return;
            }

            sqpClient = new SQPClient();

            if (localDiscoveryEnabled)
            {
                NetWorker.localServerLocated += LocalServerLocated;
                NetWorker.RefreshLocalUdpListings();
            }

            if (masterServerEnabled)
            {
                RefreshMasterServerListings();
            }
        }
 private void Awake()
 {
     if (Settings == null)
     {
         Debug.LogError("No settings were provided. Trying to find default settings.");
         Debug.LogWarning("Please check the settings in the inspector. If you are using non default values then you can use the update button on the menu component in the inspector to save them.");
         Settings = FindObjectOfType <ForgeSettings>();
         if (Settings == null)
         {
             throw new BaseNetworkException("Could not find forge settings! Please make sure you update your Multiplayer Menu settings in the editor");
         }
     }
 }
Beispiel #3
0
 public UserControlDBForgeEditor(ForgeSettings settings, DatabaseContainer database)
 {
     this._settings = settings;
     if (database == null)
     {
         this._database = new DatabaseContainer("", DatabaseContainer.DatabaseTypeMSSQL);
     }
     else
     {
         this._database = database;
     }
     InitializeComponent();
     initializeControls();
     loadSchemas(this._database);
 }
Beispiel #4
0
        protected virtual void Awake()
        {
            if (Instance != null)
            {
                Destroy(gameObject);
                return;
            }

            Instance = this;
            MainThreadManager.Create();

            // This object should move through scenes
            DontDestroyOnLoad(gameObject);

            if (Settings == null)
            {
                Debug.LogError("No settings were provided. Trying to find default settings");
                Settings = FindObjectOfType <ForgeSettings>();
                if (Settings == null)
                {
                    throw new BaseNetworkException("Could not find forge settings!");
                }
            }
        }
 public UserControlGenerate(ForgeSettings settings)
 {
     this._settings = settings;
     InitializeComponent();
 }