private void LoadConfig(string config_path) { Config = ConfigData.Deserialize(config_path); var date = DateTime.Now; if (Config.Port == 0) { Port = new Random(date.Minute + date.Second + date.Millisecond).Next(Config.PortFrom, Config.PortTo); Debug.Log(string.Format("Random generated port {0}", Port), Logger.Level.Warning); } else { Port = Config.Port; } TAG = Config.Tag; for (int i = 0; i < Config.Contacts.Count; i++) { AgentContact c = Config.Contacts[i]; AgentContactBook.Add(c); } }