public override void OnDelete (string key, Raven.Abstractions.Data.TransactionInformation transactionInformation) { //notify Dynamic hub to ignore rule. Console.WriteLine("Key: " + key); base.OnDelete (key, transactionInformation); }
public Lucene.Net.Search.SortField ToLuceneSortField(Raven.Database.Indexing.IndexDefinition definition) { var sortOptions = definition.GetSortOption(Field); if(sortOptions == null) return new Lucene.Net.Search.SortField(Field, System.Globalization.CultureInfo.InvariantCulture, Descending); return new Lucene.Net.Search.SortField(Field, (int)sortOptions.Value, Descending); }
public ActionResult Create(TemplateModel model) { try { using (var session = Raven.GetStore().OpenSession("Configuration")){ var existingTemplate = session.Load <CommunicationTemplate>(model.TemplateName); if (existingTemplate != null) { throw new Exception("shouldn't exist"); } var communicationTemplate = new CommunicationTemplate { EmailContent = model.EmailContent, SmsContent = model.SmsContent, TemplateName = model.TemplateName }; communicationTemplate.ExtractVariables(); session.Store(communicationTemplate, communicationTemplate.TemplateName); session.SaveChanges(); } return(RedirectToAction("Index")); } catch { return(View()); } }
public override void AfterCommit (string key, Raven.Json.Linq.RavenJObject document, Raven.Json.Linq.RavenJObject metadata, Guid etag) { using (var sw = new StreamWriter (File.Open ("c:\\test", FileMode.OpenOrCreate))) { sw.Write (metadata["Raven-Clr-Type"] + Environment.NewLine); base.AfterCommit (key, document, metadata, etag); if (metadata["Raven-Clr-Type"].ToString() == "DynamicHub.DynamicRule, DynamicHub") { var doc = document.ToString(Formatting.None); var dr = new ServiceStack.Text.JsonSerializer<DynamicRule>().DeserializeFromString(doc); var ass = CodeDomProvider.CreateProvider("CSharp") .CompileAssemblyFromSource( new CompilerParameters { GenerateInMemory = false, GenerateExecutable = false, IncludeDebugInformation = false, OutputAssembly = "TestAssembly", }, new[] { @"", @"" }).CompiledAssembly; sw.Write(document.ToString()); } } }
public static void LoadCustomAssets(Game p_game) { JKContentManager.LevelTexture = p_game.Content.Load <Texture2D>("mods/level"); //default //JKContentManager.TitleLogo = p_game.Content.Load<Texture2D>("mods/title_logo"); JKContentManager.TitleLogo = SmartLoad(p_game, "title_logo"); JKContentManager.NexileLogo = Sprite.CreateSprite(p_game.Content.Load <Texture2D>("JK_Nexile_Logo")); JKContentManager.NexileLogo.center = Vector2.One / 2f; JKContentManager.SlopeTexture = p_game.Content.Load <Texture2D>("slopes"); JKContentManager.SlopeSprites.LoadSprites(); JKContentManager.GUI.Load(p_game.Content); JKContentManager.Shaders.Mask = new MaskShader(p_game.Content.Load <Effect>("shaders/Mask")); JKContentManager.Shaders.test_mask = p_game.Content.Load <Texture2D>("shaders/test_mask"); //custom screens JKContentManager.m_foregrounds = JKExtensions.UltraContent.LoadCunt <Texture2D>(p_game.Content, "mods/screens/foreground", ".*"); JKContentManager.m_backgrounds = JKExtensions.UltraContent.LoadCunt <Texture2D>(p_game.Content, "mods/screens/midground", ".*"); JKContentManager.m_backbackgrounds = JKExtensions.UltraContent.LoadCunt <Texture2D>(p_game.Content, "mods/screens/background", ".*"); JKContentManager.ScrollingBackgrounds = JKExtensions.UltraContent.LoadCunt <Texture2D>(p_game.Content, "mods/screens/scrolling/textures", ".*"); JKContentManager.m_weather_masks = JKExtensions.UltraContent.LoadCunt <Texture2D>(p_game.Content, "mods/screens/masks", ".*"); JKContentManager.m_scrolling_bg_data = UltraContent.LoadXmlFiles <JumpKing.Level.Data.ScrollingBGdata>(p_game, "mods/screens/scrolling", ".xml"); //modded NPCs.Load(p_game.Content); Raven.Load(p_game.Content); Particles.Load(p_game.Content); Music.Load(p_game.Content); Props.Load(p_game.Content); Fonts.Load(p_game.Content); Endings.Load(p_game.Content); King.Load(p_game.Content); JKContentManager.MiscSettings.CustomLoad(p_game.Content); }
/// <summary> /// Handle resetting the timer and saving the last split /// </summary> private static void LoadTimer() { // Set the last split timer Raven.Set(15, Raven.Frame, (int)Map.Level); // Reset timer to 1 frame, setting to 0 deletes the save (sometimes?) Raven.SetStuff(0, 1); }
public override VetoResult AllowPut(string key, Raven.Json.Linq.RavenJObject document, Raven.Json.Linq.RavenJObject metadata, TransactionInformation transactionInformation) { if (key == "Raven/Authorization/WindowsSettings" && Authentication.IsEnabled == false) return VetoResult.Deny("Cannot setup Windows Authentication without a valid commercial license."); return VetoResult.Allowed; }
public override VetoResult AllowPut(string key, Raven.Json.Linq.RavenJObject document, Raven.Json.Linq.RavenJObject metadata, Raven.Abstractions.Data.TransactionInformation transactionInformation) { if (key != null && key.StartsWith("Raven/ApiKeys/") && Authentication.IsEnabled == false) return VetoResult.Deny("Cannot setup OAuth Authentication without a valid commercial license."); return VetoResult.Allowed; }
public override bool TryResolve(string id, Raven.Json.Linq.RavenJObject metadata, Raven.Json.Linq.RavenJObject document, Raven.Abstractions.Data.JsonDocument existingDoc, Func<string, Raven.Abstractions.Data.JsonDocument> getDocument) { if (Enabled) { metadata.Add("Raven-Remove-Document-Marker", true); } return Enabled; }
public void EntityToDocument(string key, object entity, Raven.Json.Linq.RavenJObject document, Raven.Json.Linq.RavenJObject metadata) { //ITrackChange e = entity as ITrackChange; //if (e != null) //{ // //e.ModifiedTime = metadata.Value<DateTime>("Last-Modified"); //} }
// Token: 0x06000667 RID: 1639 RVA: 0x00035F43 File Offset: 0x00034143 private void SpawnRaven(string key, string topic, string text, string label) { if (!Raven.IsInstantiated()) { UnityEngine.Object.Instantiate <GameObject>(this.m_ravenPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity); } Raven.AddTempText(key, topic, text, label, false); }
public void DocumentToEntity(string key, object entity, Raven.Json.Linq.RavenJObject document, Raven.Json.Linq.RavenJObject metadata) { ITrackChange e = entity as ITrackChange; if( e != null) { e.ModifiedTime = metadata.Value<DateTime>("Last-Modified"); } }
public bool BeforeStore(string key, object entityInstance, Raven.Json.Linq.RavenJObject metadata, Raven.Json.Linq.RavenJObject original) { if (!metadata.ContainsKey("Version")) metadata["Version"] = 0; metadata["Version"] = metadata["Version"].Value<Int32>() + 1; return true; }
public static void HuginSays(string key, string topic, string text, string label) { //Traverse.Create(Tutorial.instance).Method("SpawnRaven", new object[]{ key,topic,text,label}).GetValue(); if (!Raven.IsInstantiated()) { UnityEngine.Object.Instantiate <GameObject>(Tutorial.instance.m_ravenPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity); } Raven.AddTempText(key, topic, text, label, false); }
public ActionResult Index() { using (var session = Raven.GetStore().OpenSession("Configuration")) { // TODO: Paging ?? var templates = session.Query <CommunicationTemplate>().ToList(); return(View(templates)); } }
// Token: 0x06000D69 RID: 3433 RVA: 0x0005F914 File Offset: 0x0005DB14 private void Start() { if (!Raven.IsInstantiated()) { UnityEngine.Object.Instantiate <GameObject>(this.m_ravenPrefab, new Vector3(0f, 0f, 0f), Quaternion.identity); } this.m_text.m_static = true; this.m_text.m_guidePoint = this; Raven.RegisterStaticText(this.m_text); }
public void Setup() { bastonDeMetal = new Arma(15, 30); bombasDeHumo = new Arma(14, 89); robin = new Robin(new List <Arma> { bastonDeMetal, bombasDeHumo }, 10); raven = new Raven(2); chicoBestia = new ChicoBestia(2); }
public static Path GetPath(NancyModule module, dynamic parameters, Raven.Client.IDocumentSession session) { var pathId = String.Format("{0}/{1}", module.ModulePath, parameters.id.Value as string); pathId = pathId.Replace("api/", ""); var path = session.Load<Path>(pathId); return path; }
public override ReadVetoResult AllowRead(string key, Raven.Json.Linq.RavenJObject metadata, ReadOperation operation, Raven.Abstractions.Data.TransactionInformation transactionInformation) { if (operation != ReadOperation.Index) return ReadVetoResult.Allowed; if (metadata.Value<string>(PublishedVersioningConstants.AtisDocumentRevisionStatus) == "Historical") return ReadVetoResult.Ignore; return ReadVetoResult.Allowed; }
public ActionResult Create(CoordinatorSmsAndEmailModel model) { var trickleId = Guid.NewGuid(); Session.Add("CoordinatorSmsAndEmailModel", model); Session.Add("trickleId", trickleId.ToString()); var hpf = Request.Files[0]; if (hpf.ContentLength == 0) { throw new ArgumentException("no content"); } var csvFileContents = new CsvFileContents(); using (var csvReader = new CsvHelper.CsvReader(new StreamReader(hpf.InputStream), new CsvConfiguration { HasHeaderRecord = false })) { // TODO : Not reading first row properly while (csvReader.Read()) { csvFileContents.Rows.Add(csvReader.CurrentRecord); } } var fileContentsId = trickleId.ToString() + "_fileContents"; using (var session = Raven.GetStore().OpenSession()) { session.Store(csvFileContents, fileContentsId); session.SaveChanges(); } var dataColumnPicker = new DataColumnPicker { TrickleId = trickleId, FirstRowIsHeader = true }; if (!string.IsNullOrWhiteSpace(model.TemplateName)) { using (var session = Raven.GetStore().OpenSession("Configuration")) { var communicationTemplate = session.Load <CommunicationTemplate>(model.TemplateName); if (communicationTemplate.TemplateVariables != null) { communicationTemplate.TemplateVariables.ForEach(t => dataColumnPicker.TemplateVariableColumns.Add(t.VariableName, null)); } } } var dropDownList = csvFileContents.CreateSelectList(); ViewData.Add("selectListData", dropDownList); return(View("CreateSmsAndEmailPickRows", dataColumnPicker)); }
public override VetoResult AllowPut(string key, Raven.Json.Linq.RavenJObject document, Raven.Json.Linq.RavenJObject metadata, Abstractions.Data.TransactionInformation transactionInformation) { if(key.Contains(@"\")) return VetoResult.Deny(@"Document name cannot contain '\' but attempted to save with: " + key); if(string.Equals(key, "Raven/Databases/System", StringComparison.OrdinalIgnoreCase)) return VetoResult.Deny( @"Cannot create a tenant database with the name 'System', that name is reserved for the actual system database"); return VetoResult.Allowed; }
public void Setup() { bastonDeMetal = new Arma(15, 10); bombasDeHumo = new Arma(14, 89); arsenalDeRobin = new List <Arma>(); arsenalDeRobin.Add(bastonDeMetal); arsenalDeRobin.Add(bombasDeHumo); Robin = new RicardoTapia(arsenalDeRobin, 10); ChicoBestia = new HulkJunior(2); raven = new Raven(2); }
public void removeRaven(Raven val) { ravens.Remove(val); if (!ravenKilled.isPlaying) { int idx = Random.Range(0, killedSound.Length); ravenKilled.clip = killedSound[idx]; ravenKilled.Play(); } }
public override void AfterCommit(string key, Raven.Json.Linq.RavenJObject document, Raven.Json.Linq.RavenJObject metadata, Guid etag) { if (key.StartsWith(RavenDatabasesPrefix, StringComparison.InvariantCultureIgnoreCase) == false) return; TenantDatabaseModified.Invoke(this, new TenantDatabaseModified.Event { Database = Database, Name = key.Substring(RavenDatabasesPrefix.Length) }); }
public ActionResult CreateSmsAndEmailColumnPicker(DataColumnPicker model) { var trickleIdString = Session["trickleId"] as string; // TODO: Validate column to data mapping var originalRequest = Session["CoordinatorSmsAndEmailModel"] as CoordinatorSmsAndEmailModel; var fileContentsId = trickleIdString + "_fileContents"; CsvFileContents fileContents; using (var session = Raven.GetStore().OpenSession()) { fileContents = session.Load <CsvFileContents>(fileContentsId); } var customerContacts = new List <CustomerContact>(); for (int i = 0; i < fileContents.Rows.Count; i++) { if (i > 0 || !model.FirstRowIsHeader) { var customerContact = new CustomerContact(); if (model.PhoneNumberColumn.HasValue) { customerContact.MobileNumber = fileContents.Rows[i][model.PhoneNumberColumn.Value]; } if (model.EmailColumn.HasValue) { customerContact.EmailAddress = fileContents.Rows[i][model.EmailColumn.Value]; } if (model.CustomerNameColumn.HasValue) { customerContact.CustomerName = fileContents.Rows[i][model.CustomerNameColumn.Value]; } customerContacts.Add(customerContact); } } using (var transaction = new TransactionScope()) { var customerContactsId = trickleIdString + "_customerContacts"; using (var session = Raven.GetStore().OpenSession()) { session.Store(new CustomerContactList(customerContacts), customerContactsId); session.SaveChanges(); } var message = Mapper.MapToTrickleSmsAndEmailOverPeriod(Guid.Parse(trickleIdString), customerContactsId, originalRequest, CurrentUser.Name()); Bus.Send("smscoordinator", message); transaction.Complete(); } //return View("CreateSmsAndEmail"); return(RedirectToAction("Details", new { coordinatorId = trickleIdString })); }
public ActionResult Edit(string templateName) { using (var session = Raven.GetStore().OpenSession("Configuration")) { var existingTemplate = session.Load <CommunicationTemplate>(templateName); if (existingTemplate == null) { throw new Exception("should have a document here..."); } return(View(existingTemplate)); } }
public override void OnPut(string key, Raven.Json.Linq.RavenJObject document, Raven.Json.Linq.RavenJObject metadata, Abstractions.Data.TransactionInformation transactionInformation) { using (Database.DisableAllTriggersForCurrentThread()) { Database.TransactionalStorage.Batch(accessor => { var tombstone = accessor.Lists.Read(Constants.RavenPeriodicBackupsDocsTombstones, key); if (tombstone == null) return; accessor.Lists.Remove(Constants.RavenPeriodicBackupsDocsTombstones, key); }); } }
public void Setup() { BastonDeMetal = new Arma(10, 15); BombaDeHumo = new Arma(89, 14); robin = new Robin(new List <Arma> { BombaDeHumo, BastonDeMetal }, 10); chicobestia = new Chico_Bestia("Verde", 2); raven = new Raven(new List <string> { "Extraño a mi Papi", "Me quedé sin MANTECA", "Perdà a Pipo", "Voy a comprar pilas para Robocop", "¿Donde esta Pipo?" }, 2); }
protected override JsonProperty CreateProperty(System.Reflection.MemberInfo member, Raven.Imports.Newtonsoft.Json.MemberSerialization memberSerialization) { var property = base.CreateProperty(member, memberSerialization); if (member is System.Reflection.PropertyInfo && typeof(IEventSource).IsAssignableFrom(member.ReflectedType) && member.Name == "Events" && member.DeclaringType == typeof(EventStream)) { property.ShouldSerialize = _ => false; } return property; }
public void Setup() { BastonDeMetal = new Arma(10, 15); BombaDeHumo = new Arma(89, 14); robin = new Robin(new List <Arma> { BombaDeHumo, BastonDeMetal }, 10); chicobestia = new Chico_Bestia("Verde", 2); raven = new Raven(new List <string> { "odio a Papi", "Tengo mucha MANTECA", "F por Pipo", "el Robocop tiene la peor temporada", "donde te sentaste Pipo" }, 2); }
public void TestRavenApi_Events_Search() { var raven = new Raven(AccessKeyId, AccessKeySecret); var eventsRequest = new Request("Events", new NameValueCollection { {"ReportFormat","RavenEventFile_v1.0" }, {"StartTime", TimestampProvider.FormatTimestamp((DateTime.UtcNow).AddHours(-1)) }, {"EndTime", TimestampProvider.FormatTimestamp(DateTime.UtcNow)}, {"ResultFields","RoutingNumber PaymentType Currency CardNumber ApprovalCode Amount" }, }); var eventsResponse = raven.Send(eventsRequest); Assert.IsNotNull(eventsResponse.Get("Report")); }
public void spawnRaven() { Vector3 pos = spawningPoint.transform.position; pos += spawningPoint.transform.right * Random.Range(-vectorVar, vectorVar); pos += spawningPoint.transform.up * Random.Range(0.0f, vectorVar / 5.0f); Raven newRaven = prefabBank.poolRaven(); newRaven.gameObject.transform.position = pos; ravens.Add(newRaven); newRaven.init(); }
public bool BeforeStore(string key, object entityInstance, Raven.Json.Linq.RavenJObject metadata) { var achievement = entityInstance as Achievement; if (achievement == null) return false; if (achievement.Id == null) achievement.Id = Guid.NewGuid().ToString(); if (achievement.DateCreated == DateTime.MinValue) achievement.DateCreated = DateTime.Now; return true; }
public AttachmentsStorageActions(Table attachmentsTable, Reference<WriteBatch> writeBatch, Reference<SnapshotReader> snapshot, IUuidGenerator uuidGenerator, TableStorage tableStorage, Raven.Storage.Voron.TransactionalStorage transactionalStorage, IBufferPool bufferPool) :base(snapshot, bufferPool) { this.attachmentsTable = attachmentsTable; this.writeBatch = writeBatch; this.uuidGenerator = uuidGenerator; this.tableStorage = tableStorage; this.transactionalStorage = transactionalStorage; metadataIndex = tableStorage.Attachments.GetIndex(Tables.Attachments.Indices.Metadata); }
public void TestRavenApi_Payments_Search() { var raven = new Raven(AccessKeyId,AccessKeySecret); var paymentsRequest = new Request("Payments", new NameValueCollection { {"ReportFormat","RavenPaymentFile_v1.0" }, {"StartTime", TimestampProvider.FormatTimestamp((DateTime.Now).AddDays(-1)) }, {"EndTime", TimestampProvider.FormatTimestamp(DateTime.Now)}, {"ResultFields","Currency CardNumber Amount" }, {"RoutingNumbers","840033"}, {"PaymentTypes","cc_debit" } }); var paymentsResponse = raven.Send(paymentsRequest); Assert.IsNotNull(paymentsResponse.Get("Report")); }
public ActionResult Delete(CommunicationTemplate template) { try { using (var session = Raven.GetStore().OpenSession("Configuration")) { var existingTemplate = session.Load <CommunicationTemplate>(template.TemplateName); if (existingTemplate == null) { throw new Exception("should have a document here..."); } session.Delete(existingTemplate); session.SaveChanges(); } return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create() { var templateItems = new List <SelectListItem>(); using (var session = Raven.GetStore().OpenSession("Configuration")) { templateItems.Add(new SelectListItem { Selected = true, Text = string.Empty, Value = string.Empty }); var templates = session.Query <CommunicationTemplate>().Take(30).ToList(); templateItems = templates.Select(c => new SelectListItem { Selected = false, Text = c.TemplateName, Value = c.TemplateName }).ToList(); } ViewData.Add("CommunicationTemplates", templateItems); return(View("CreateSmsAndEmail")); }
public void Execute(Raven.Database.DocumentDatabase database) { // First step setup diagnostics: DiagnosticsProvider.Initialize(); // And then storage: StorageProvider.Initialize(); var storageDirectory = StorageProvider.GetDirectoryForDatabase(database.Name); log.Info("Setting storage directory for database {0} to {1}",string.IsNullOrWhiteSpace(database.Name) ? "Default" : database.Name,storageDirectory.FullName); database.Configuration.DataDirectory = storageDirectory.FullName; if (ConfigurationProvider.GetSetting(ConfigurationSettingsKeys.ReplicationDatabaseCreation, true)) { ReplicationProvider.ReplicateDatabaseCreation(database); } }
public bool BeforeStore(string key, object entityInstance, Raven.Json.Linq.RavenJObject metadata) { var goal = entityInstance as Goal; if (goal == null) return false; goal.OnCourse.Where(x => x.Id == null).ToList().ForEach(x => { x.Id = Guid.NewGuid().ToString(); }); goal.Astray.Where(x => x.Id == null).ToList().ForEach(x => { x.Id = Guid.NewGuid().ToString(); }); return true; }
public ActionResult Details(string coordinatorId) { using (var session = Raven.GetStore().OpenSession()) { var coordinatorSummary = session.Query <ScheduledMessagesStatusCountInCoordinatorIndex.ReduceResult, ScheduledMessagesStatusCountInCoordinatorIndex>() .Where(s => s.CoordinatorId == coordinatorId) .ToList(); var coordinatorTrackingData = session.Load <CoordinatorTrackingData>(coordinatorId); if (coordinatorSummary.Count == 0 || coordinatorTrackingData == null) { throw new NotImplementedException("need to have some data..."); return(View("DetailsNotCreated", model: coordinatorId)); } DateTime?nextSmsDateUtc = session.Query <ScheduleTrackingData, ScheduleMessagesInCoordinatorIndex>() .Where(s => s.CoordinatorId == Guid.Parse(coordinatorId) && s.MessageStatus == MessageStatus.Scheduled) .OrderBy(s => s.ScheduleTimeUtc) .Select(s => s.ScheduleTimeUtc) .FirstOrDefault(); if (nextSmsDateUtc == DateTime.MinValue) { nextSmsDateUtc = null; } DateTime?finalSmsDateUtc = session.Query <ScheduleTrackingData, ScheduleMessagesInCoordinatorIndex>() .Where(s => s.CoordinatorId == Guid.Parse(coordinatorId) && s.MessageStatus == MessageStatus.Scheduled) .OrderByDescending(s => s.ScheduleTimeUtc) .Select(s => s.ScheduleTimeUtc) .FirstOrDefault(); if (finalSmsDateUtc == DateTime.MinValue) { finalSmsDateUtc = null; } var overview = new CoordinatorOverview(coordinatorTrackingData, coordinatorSummary); overview.NextScheduledMessageDate = nextSmsDateUtc; overview.FinalScheduledMessageDate = finalSmsDateUtc; if (HttpContext.Session != null && HttpContext.Session["CoordinatorState_" + coordinatorId] != null && HttpContext.Session["CoordinatorState_" + coordinatorId] is CoordinatorStatusTracking) { overview.CurrentStatus = (CoordinatorStatusTracking)HttpContext.Session["CoordinatorState_" + coordinatorId]; } return(View("Details", overview)); } }
public ActionResult Edit(string templateName, CommunicationTemplate model) { try { using (var session = Raven.GetStore().OpenSession("Configuration")) { var existingTemplate = session.Load <CommunicationTemplate>(templateName); if (existingTemplate == null) { throw new Exception("should have a document here..."); } existingTemplate = model; existingTemplate.ExtractVariables(); session.SaveChanges(); } return(RedirectToAction("Index")); } catch { return(View()); } }
public void Setup() { //ROBIN bastonDeMetal = new Arma(10, 15); bombasDeHumo = new Arma(89, 14); arsenal = new List <Arma> { bastonDeMetal, bombasDeHumo }; robin = new Robin(arsenal, 10); //RAVEN pensamientos = new List <string> { "Extraño a mi Papi", "Me quedé sin MANTECA", "Perdà a Pipo", "Voy a comprar pilas para Robocop", "¿Donde esta Pipo?" }; raven = new Raven(2, pensamientos, 0); //CHICOBESTIA chicobestia = new ChicoBestia("Verde", 2); }
public static void ValidateMenu(Menu menu, string enterpriseId, Raven.Client.IDocumentSession session, Abstract.ILogger _logger) { var allProductIds = menu.Categories.SelectMany(c => c.Products); var productIds = allProductIds as string[] ?? allProductIds.ToArray(); var allProducts = session.Load<Product>(productIds); //Check if all products belongs to this enterprise foreach (var product in allProducts.Where(product => product != null && product.Enterprise != enterpriseId).ToList()) { foreach (var category in from category in menu.Categories from c in category.Products.Where(c => c == product.Id).ToList() select category) { category.Products.Remove(product.Id); } _logger.Warn("Product '{0}' belongs to enterprise: '{1}' was about to be added to '{2}' Code:[hTrsvv563]", product.Id, product.Enterprise, enterpriseId); } //Remove category if it does not have any products foreach (var category in menu.Categories.Where(category => category.Products.Count == 0).ToList()) { menu.Categories.Remove(category); } try { var productDuplicates = productIds.GroupBy(p => p.ToUpper()).SelectMany(grp => grp.Skip(1)); foreach (var productDuplicate in productDuplicates) { _logger.Warn("Duplicate in products found: {0}, Enterprise: {1}", productDuplicate, enterpriseId); } var categoryDuplicates = menu.Categories.GroupBy(c => c.Id.ToUpper()).SelectMany(grp => grp.Skip(1)); foreach (var categoryDuplicate in categoryDuplicates) { _logger.Info("Duplicate in categories found: Name: {0}, Id: {1}, Enterprise: {2}", categoryDuplicate.Name, categoryDuplicate.Id, enterpriseId); categoryDuplicate.Id = GeneralHelper.GetGuid(); } } catch (Exception ex) { _logger.Fatal("ValidateMenu, duplicate check!", ex); } }
public static bool ValidEditableEnterprise(Enterprise enterprise, Raven.Client.IDocumentSession session) { if(enterprise != null) { if (enterprise.OwnedByAccount) { //If enterprise is owned by an account, check if current account is the correct one var account = session.Load<Account>(HttpContext.Current.User.Identity.Name); return (account.Enterprises.Contains(enterprise.Id) || account.IsAdmin) && account.Enabled; } //Add product to a new enterprise if (enterprise.IsNew) return true; //Add product to an enterprise in edit-mode if (!enterprise.LockedFromEdit) return true; } return false; }
public Raven poolRaven() { if (ravenPool.Count == 0) { GameObject newObject = Instantiate(raven_prefab); Raven newRaven = newObject.GetComponent <Raven>(); newRaven.setPrefabBank(this); newRaven.setEnemyManager(enemyManager); newRaven.setFruitManager(fruitManager); newRaven.setTree(tree); newRaven.gameObject.SetActive(true); return(newRaven); } else { Raven newRaven = ravenPool.Pop(); newRaven.gameObject.SetActive(true); return(newRaven); } }
public static void Message(string user, string text, bool munin) { try { logger.LogInfo($"Message -> user:{user} text:{text}"); Raven.RavenText ravenText = new Raven.RavenText(); var key = "vwsp_" + keyID++; var label = user; var topic = user; logger.LogInfo($"AddTempText -> {key}"); Raven.AddTempText(key, topic, text, label, munin); } catch (Exception ex) { logger.LogError(ex); } }
public static void Message(string user, string text, bool munin) { try { Log.Info($"Message -> user:{user} text:{text}"); Raven.RavenText ravenText = new Raven.RavenText(); var key = $"{Plugin.GUID}_" + messageCount++; var label = user; var topic = user; Log.Info($"AddTempText -> {key}"); Raven.AddTempText(key, topic, text, label, munin); } catch (Exception ex) { Log.Error(ex.ToString()); } }
public static void StartUp() { if (plugMgr.Plugins.Count == 0) { throw new Exception("No Plugins loaded."); } var appConfig = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location); string startupPlugin = appConfig.AppSettings.Settings["StartupPlugin"].Value;//ConfigurationManager.AppSettings["StartupPlugin"]; PluginInfo pi = plugMgr[startupPlugin]; if (pi == null) { throw new Exception(string.Format("Not find startup Plugin:{0}", startupPlugin)); } pi.Instance.Start(); Raven.ExcepectingMessage(GolbalMessages.MainAppExit, OnMainAppExit); //WindowHide(Console.Title); Application.Run(); }
public override void OnPut(string key, Newtonsoft.Json.Linq.JObject document, Newtonsoft.Json.Linq.JObject metadata, Raven.Http.TransactionInformation transactionInformation) { if (AuditContext.IsInAuditContext) return; using (AuditContext.Enter()) { if (metadata.Value<string>("Raven-Entity-Name") == "People") { if (metadata["CreatedByPersonId"] == null) { metadata["CreatedByPersonId"] = CurrentOperationContext.Headers.Value["CurrentUserPersonId"]; metadata["CreatedDate"] = new DateTime(2011,02,19,15,00,00); } else { metadata["LastUpdatedPersonId"] = CurrentOperationContext.Headers.Value["CurrentUserPersonId"]; metadata["LastUpdatedDate"] = new DateTime(2011, 02, 19, 15, 00, 00); } } } }
public static void Load(Upgrades upgrades) { Raven.Glove = upgrades.Glove; Raven.Feather = upgrades.Feather; Raven.ElectricFeather = upgrades.ZepharasFeather; Raven.IceFeather = upgrades.IcorasFeather; Raven.FireFeather = upgrades.MagirasFeather; Raven.ChargeUp = upgrades.ChargeAttack; Raven.ElectricCharge = upgrades.ZepharasRage; Raven.IceCharge = upgrades.IcorasWrath; Raven.FireCharge = upgrades.MagirasFury; Raven.DoubleJump = upgrades.DoubleJump; Raven.ElectricDoubleJump = upgrades.FlashDash; Raven.IceDoubleJump = upgrades.Stratosphere; Raven.FireDoubleJump = upgrades.BlastOff; Raven.Swim = upgrades.Swim; int extraPerkSlots = upgrades.PerkSlots - 4; if (extraPerkSlots > 0) { Raven.SetStuff(36, 1); extraPerkSlots--; } if (extraPerkSlots > 0) { Raven.SetStuff(37, 1); extraPerkSlots--; } if (extraPerkSlots > 0) { Raven.SetStuff(38, 1); } }
private void Tb_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) { Raven.BroadcastMessage(GolbalMessages.MainAppExit); }
public override ReadVetoResult AllowRead(string key, Raven.Json.Linq.RavenJObject metadata, ReadOperation operation, Raven.Abstractions.Data.TransactionInformation transactionInformation) { if(operation == ReadOperation.Query) return ReadVetoResult.Ignore; return ReadVetoResult.Allowed; }
protected override void ConfigureServer(Raven.Database.Config.RavenConfiguration ravenConfiguration) { ravenConfiguration.Settings["Raven/ActiveBundles"] = "none"; }
protected virtual void ConfigureServer(Raven.Database.Config.RavenConfiguration ravenConfiguration) { }
public ScopeStore(Raven.Client.IDocumentStore store) { _store = store; }
public List <Build> ProtossBuilds(Bot bot) { List <Build> options = new List <Build>(); if (Bot.Debug) { foreach (Strategy strategy in bot.EnemyStrategyAnalyzer.Strategies) { if (strategy.DetectedPreviously) { System.Console.WriteLine("Detected previous strategy: " + strategy.Name()); } } } if (bot.EnemyRace == Race.Terran) { if (Marine.Get().DetectedPreviously && !Reaper.Get().DetectedPreviously && !Marauder.Get().DetectedPreviously && !Cyclone.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously && !SiegeTank.Get().DetectedPreviously && !Medivac.Get().DetectedPreviously && !Viking.Get().DetectedPreviously && !Raven.Get().DetectedPreviously && !Battlecruiser.Get().DetectedPreviously && !WidowMine.Get().DetectedPreviously && !Hellion.Get().DetectedPreviously && !Thor.Get().DetectedPreviously && !Liberator.Get().DetectedPreviously) { // ValinMarineBot options.Add(new NinjaTurtles()); return(options); } if (BattlecruiserRush.Get().DetectedPreviously && Thor.Get().DetectedPreviously && WidowMine.Get().DetectedPreviously) { // BenBotBC options.Add(new OneBaseStalkerImmortal()); return(options); } if (Battlecruiser.Get().DetectedPreviously && !BattlecruiserRush.Get().DetectedPreviously && !Marauder.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously && !Reaper.Get().DetectedPreviously && !Cyclone.Get().DetectedPreviously && !Medivac.Get().DetectedPreviously && !Raven.Get().DetectedPreviously) { options.Add(new MassVoidray() { SkipDefenses = true }); return(options); } /* * if (ProxyDetected.Get().DetectedPreviously * && !Marauder.Get().DetectedPreviously * && Banshee.Get().DetectedPreviously) * { * options.Add(new AntiMicro()); * return options; * } */ if (ProxyDetected.Get().DetectedPreviously && Marauder.Get().DetectedPreviously && Banshee.Get().DetectedPreviously) { // MicroMachine options.Add(new AntiMicro() { HuntProxies = true, CounterProxyMarauder = false }); //options.Add(new NinjaTurtles() { Expand = true }); //options.Add(new OneBaseTempest() { DefendingStalker = true }); return(options); } if (ProxyDetected.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously) { // Strelok //options.Add(new PvTStalkerImmortal() { BuildReaperWall = true, ProxyPylon = false, DelayObserver = true, SendScout = true, MassTanksDetected = MassTank.Get().DetectedPreviously }); options.Add(new OneBaseStalkerImmortal() { UseSentry = true }); options.Add(new OneBaseTempest()); return(options); } if (Marine.Get().DetectedPreviously && Medivac.Get().DetectedPreviously && Viking.Get().DetectedPreviously && Reaper.Get().DetectedPreviously && Raven.Get().DetectedPreviously && !Cyclone.Get().DetectedPreviously && !Marauder.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously) { options.Add(new OneBaseStalkerImmortal()); //options.Add(new PvTStalkerImmortal() { BuildReaperWall = false, ProxyPylon = false, DelayObserver = true, SendScout = false, MassTanksDetected = true }); return(options); } if (Marine.Get().DetectedPreviously && Medivac.Get().DetectedPreviously && Viking.Get().DetectedPreviously && Reaper.Get().DetectedPreviously && !Raven.Get().DetectedPreviously && Marauder.Get().DetectedPreviously && Liberator.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously) { // Jensiiibot //options.Add(new PvTStalkerTempest()); //options.Add(new Builds.Protoss.WorkerRush() { CounterJensiii = true, BuildStalkers = true }); //options.Add(new PvTStalkerImmortal() { BuildReaperWall = true, ProxyPylon = false, DelayObserver = true, MassTanksDetected = MassTank.Get().DetectedPreviously, UseColosus = false }); options.Add(new PvTZealotImmortal()); return(options); } if (Marine.Get().DetectedPreviously && Medivac.Get().DetectedPreviously && Viking.Get().DetectedPreviously && Reaper.Get().DetectedPreviously && Cyclone.Get().DetectedPreviously && !Marauder.Get().DetectedPreviously && !Liberator.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously) { // Rusty options.Add(new OneBaseStalkerImmortal()); return(options); } if (Marine.Get().DetectedPreviously && Medivac.Get().DetectedPreviously && Viking.Get().DetectedPreviously && Reaper.Get().DetectedPreviously && !Raven.Get().DetectedPreviously && Cyclone.Get().DetectedPreviously && Marauder.Get().DetectedPreviously && !Liberator.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously && Thor.Get().DetectedPreviously && SiegeTank.Get().DetectedPreviously && MassTank.Get().DetectedPreviously && Hellbat.Get().DetectedPreviously) { // MechSweep options.Add(new OneBaseTempest() { RequiredSize = 3 }); return(options); } options.Add(new PvTStalkerImmortal() { BuildReaperWall = true, ProxyPylon = false, DelayObserver = true, MassTanksDetected = MassTank.Get().DetectedPreviously, UseColosus = false }); } else if (bot.EnemyRace == Race.Zerg) { if (Bot.Main.OpponentID == "eed44128-f488-4e31-b457-8e55f8a95628") { options.Add(new PvZHjax() { CounterRoaches = false, DefendNydus = false }); return(options); } options.Add(new PvZHjax()); return(options); /* * if (Lurker.Get().DetectedPreviously) * { * //Kagamine * //options.Add(new PvZAdeptIntoVoidray()); * //options.Add(new WorkerRush()); * options.Add(new PvZHjax()); * return options; * } * if (Mutalisk.Get().DetectedPreviously * && !Lurker.Get().DetectedPreviously) * { * options.Add(new OneBaseStalkerImmortal() { StartZealots = true }); * return options; * } * if (Hydralisk.Get().DetectedPreviously && StrategyAnalysis.ZerglingRush.Get().DetectedPreviously) * { * options.Add(new ZealotRush()); * return options; * } * if (RoachRush.Get().DetectedPreviously || StrategyAnalysis.ZerglingRush.Get().DetectedPreviously) * { * options.Add(new PvZRushDefense()); * options.Add(new NinjaTurtles()); * return options; * } * if (Roach.Get().DetectedPreviously * && Zergling.Get().DetectedPreviously * && !Hydralisk.Get().DetectedPreviously) * { * options.Add(new PvZRushDefense()); * options.Add(new NinjaTurtles()); * return options; * } * if (Queen.Get().DetectedPreviously * && Zergling.Get().DetectedPreviously * && !Hydralisk.Get().DetectedPreviously * && !Roach.Get().DetectedPreviously) * { * options.Add(new NinjaTurtles()); * return options; * } * if (bot.PreviousEnemyStrategies.MassHydra * && MassRoach.Get().DetectedPreviously * && !Lurker.Get().DetectedPreviously) * { * options.Add(new OneBaseTempest()); * return options; * } * if (!Zergling.Get().DetectedPreviously * && !Roach.Get().DetectedPreviously * && !Hydralisk.Get().DetectedPreviously * && !Queen.Get().DetectedPreviously * && !Mutalisk.Get().DetectedPreviously) * { * options.Add(new OneBaseTempest()); * return options; * } * if (!Zergling.Get().DetectedPreviously * && Roach.Get().DetectedPreviously * && !Hydralisk.Get().DetectedPreviously * && Queen.Get().DetectedPreviously * && !Mutalisk.Get().DetectedPreviously) * { * options.Add(new OneBaseTempest()); * return options; * } * options.Add(new OneBaseStalkerImmortal() { StartZealots = true }); */ } else if (bot.EnemyRace == Race.Protoss) { if (Zealot.Get().DetectedPreviously && VoidRay.Get().DetectedPreviously && !Carrier.Get().DetectedPreviously && !Tempest.Get().DetectedPreviously && !Stalker.Get().DetectedPreviously && !Adept.Get().DetectedPreviously && !Immortal.Get().DetectedPreviously && !StrategyAnalysis.CannonRush.Get().DetectedPreviously) { // MavBot3 options.Add(new ZealotRush()); return(options); } if (SkippedNatural.Get().DetectedPreviously && !AdeptHarass.Get().DetectedPreviously && VoidRay.Get().DetectedPreviously && Immortal.Get().DetectedPreviously) { // AdditionalPylons options.Add(new DoubleRoboProxy()); return(options); } if (Oracle.Get().DetectedPreviously && ThreeGate.Get().DetectedPreviously && Zealot.Get().DetectedPreviously && !Stalker.Get().DetectedPreviously && !VoidRay.Get().DetectedPreviously && !Immortal.Get().DetectedPreviously) { // LuckyBot options.Add(new OneBaseTempest()); return(options); } if (Carrier.Get().DetectedPreviously && Collosus.Get().DetectedPreviously && SkyToss.Get().DetectedPreviously && Tempest.Get().DetectedPreviously && !Archon.Get().DetectedPreviously && !HighTemplar.Get().DetectedPreviously) { // TheGoldenArmada options.Add(new OneBaseTempest()); return(options); } options.Add(new OneBaseStalkerImmortal() { DoubleRobo = true, EarlySentry = true, AggressiveMicro = true }); return(options); /* * if (AdeptHarass.Get().DetectedPreviously * && SkyToss.Get().DetectedPreviously * && Carrier.Get().DetectedPreviously * && HighTemplar.Get().DetectedPreviously * && VoidRay.Get().DetectedPreviously * && !StrategyAnalysis.CannonRush.Get().DetectedPreviously) * { * options.Add(new ZealotRush()); * options.Add(new OneBaseStalkerImmortal()); * return options; * } * if (AdeptHarass.Get().DetectedPreviously) * { * // SharpenedEdge * options.Add(new OneBaseTempest()); * options.Add(new Dishwasher()); * return options; * } * if (StrategyAnalysis.CannonRush.Get().DetectedPreviously * && Tempest.Get().DetectedPreviously) * { * // ThreeWayLover * //options.Add(new MassVoidray() { SkipDefenses = true }); * options.Add(new OneBaseTempest()); * return options; * } * if (Sentry.Get().DetectedPreviously * && Archon.Get().DetectedPreviously * && !Stalker.Get().DetectedPreviously * && !Zealot.Get().DetectedPreviously) * { * options.Add(new TempestProxy()); * return options; * } * if (Zealot.Get().DetectedPreviously * && StrategyAnalysis.CannonRush.Get().DetectedPreviously * && Oracle.Get().DetectedPreviously * && Phoenix.Get().DetectedPreviously * && Stalker.Get().DetectedPreviously * && !Immortal.Get().DetectedPreviously) * { * //Gumby * options.Add(new NinjaTurtles()); * return options; * } * if (Oracle.Get().DetectedPreviously) * { * options.Add(new OneBaseTempest()); * return options; * } * if (!Stalker.Get().DetectedPreviously * && !Zealot.Get().DetectedPreviously * && !Sentry.Get().DetectedPreviously) * { * options.Add(new ZealotRush()); * return options; * } * if (Zealot.Get().DetectedPreviously * && !Stalker.Get().DetectedPreviously) * { * options.Add(new NinjaTurtles()); * return options; * } * * options.Add(new NinjaTurtles()); * options.Add(new PvPMothershipSiege()); */ } return(options); }
protected override void ModifyStore(Raven.Client.Embedded.EmbeddableDocumentStore documentStore) { documentStore.Conventions.FindTypeTagName = type => RavenTagHelpers.GetTag(type) ?? DocumentConvention.DefaultTypeTagName(type); }
public void takeOutRaven(Raven val) { ravenPool.Push(val); val.gameObject.SetActive(false); }
public override void AfterDelete(string key, Raven.Abstractions.Data.TransactionInformation transactionInformation) { if (key == "Raven/Authorization/WindowsSettings") WindowsRequestAuthorizer.InvokeWindowsSettingsChanged(); base.AfterDelete(key, transactionInformation); }
public void InstallWeaponInAnyCorrectShip_InstallWeaponInCorrectSlot_SuccessfullyInstalled() { using (var mock = AutoMock.GetLoose()) { //Arrange //Act Dominix.InstallWeapon(_LargeCannonMock, 1); Dominix.InstallWeapon(_LargeLaserMock, 2); Dominix.InstallWeapon(_LargeMissileMock, 3); Dominix.InstallWeapon(_LargeProjectileMock, 4); Dominix.InstallWeapon(_LargeShockwaveMock, 5); Raven.InstallWeapon(_LargeCannonMock, 1); Raven.InstallWeapon(_LargeLaserMock, 2); Raven.InstallWeapon(_LargeMissileMock, 3); Raven.InstallWeapon(_LargeProjectileMock, 4); Raven.InstallWeapon(_LargeShockwaveMock, 5); Rokh.InstallWeapon(_LargeCannonMock, 1); Rokh.InstallWeapon(_LargeLaserMock, 2); Rokh.InstallWeapon(_LargeMissileMock, 3); Rokh.InstallWeapon(_LargeProjectileMock, 4); Rokh.InstallWeapon(_LargeShockwaveMock, 5); Scorpion.InstallWeapon(_LargeCannonMock, 1); Scorpion.InstallWeapon(_LargeLaserMock, 2); Scorpion.InstallWeapon(_LargeMissileMock, 3); Scorpion.InstallWeapon(_LargeProjectileMock, 4); Scorpion.InstallWeapon(_LargeShockwaveMock, 5); Widow.InstallWeapon(_LargeCannonMock, 1); Widow.InstallWeapon(_LargeLaserMock, 2); Widow.InstallWeapon(_LargeMissileMock, 3); Widow.InstallWeapon(_LargeProjectileMock, 4); Widow.InstallWeapon(_LargeShockwaveMock, 5); //weapon.VerifyAll(); //Assert Assert.Contains(_LargeCannonMock, Dominix.Weapons); Assert.IsTrue(_LargeCannonMock.Equals(Dominix.Weapons[0])); Assert.Contains(_LargeLaserMock, Dominix.Weapons); Assert.IsTrue(_LargeLaserMock.Equals(Dominix.Weapons[1])); Assert.Contains(_LargeMissileMock, Dominix.Weapons); Assert.IsTrue(_LargeMissileMock.Equals(Dominix.Weapons[2])); Assert.Contains(_LargeProjectileMock, Dominix.Weapons); Assert.IsTrue(_LargeProjectileMock.Equals(Dominix.Weapons[3])); Assert.Contains(_LargeShockwaveMock, Dominix.Weapons); Assert.IsTrue(_LargeShockwaveMock.Equals(Dominix.Weapons[4])); Assert.Contains(_LargeCannonMock, Raven.Weapons); Assert.IsTrue(_LargeCannonMock.Equals(Raven.Weapons[0])); Assert.Contains(_LargeLaserMock, Raven.Weapons); Assert.IsTrue(_LargeLaserMock.Equals(Raven.Weapons[1])); Assert.Contains(_LargeMissileMock, Raven.Weapons); Assert.IsTrue(_LargeMissileMock.Equals(Raven.Weapons[2])); Assert.Contains(_LargeProjectileMock, Raven.Weapons); Assert.IsTrue(_LargeProjectileMock.Equals(Raven.Weapons[3])); Assert.Contains(_LargeShockwaveMock, Raven.Weapons); Assert.IsTrue(_LargeShockwaveMock.Equals(Raven.Weapons[4])); Assert.Contains(_LargeCannonMock, Rokh.Weapons); Assert.IsTrue(_LargeCannonMock.Equals(Rokh.Weapons[0])); Assert.Contains(_LargeLaserMock, Rokh.Weapons); Assert.IsTrue(_LargeLaserMock.Equals(Rokh.Weapons[1])); Assert.Contains(_LargeMissileMock, Rokh.Weapons); Assert.IsTrue(_LargeMissileMock.Equals(Rokh.Weapons[2])); Assert.Contains(_LargeProjectileMock, Rokh.Weapons); Assert.IsTrue(_LargeProjectileMock.Equals(Rokh.Weapons[3])); Assert.Contains(_LargeShockwaveMock, Rokh.Weapons); Assert.IsTrue(_LargeShockwaveMock.Equals(Rokh.Weapons[4])); Assert.Contains(_LargeCannonMock, Scorpion.Weapons); Assert.IsTrue(_LargeCannonMock.Equals(Scorpion.Weapons[0])); Assert.Contains(_LargeLaserMock, Scorpion.Weapons); Assert.IsTrue(_LargeLaserMock.Equals(Scorpion.Weapons[1])); Assert.Contains(_LargeMissileMock, Scorpion.Weapons); Assert.IsTrue(_LargeMissileMock.Equals(Scorpion.Weapons[2])); Assert.Contains(_LargeProjectileMock, Scorpion.Weapons); Assert.IsTrue(_LargeProjectileMock.Equals(Scorpion.Weapons[3])); Assert.Contains(_LargeShockwaveMock, Scorpion.Weapons); Assert.IsTrue(_LargeShockwaveMock.Equals(Scorpion.Weapons[4])); Assert.Contains(_LargeCannonMock, Widow.Weapons); Assert.IsTrue(_LargeCannonMock.Equals(Widow.Weapons[0])); Assert.Contains(_LargeLaserMock, Widow.Weapons); Assert.IsTrue(_LargeLaserMock.Equals(Widow.Weapons[1])); Assert.Contains(_LargeMissileMock, Widow.Weapons); Assert.IsTrue(_LargeMissileMock.Equals(Widow.Weapons[2])); Assert.Contains(_LargeProjectileMock, Widow.Weapons); Assert.IsTrue(_LargeProjectileMock.Equals(Widow.Weapons[3])); Assert.Contains(_LargeShockwaveMock, Widow.Weapons); Assert.IsTrue(_LargeShockwaveMock.Equals(Widow.Weapons[4])); } }