public virtual void RaiseNewPCEntries(List <ActorEntity> e) { var actorEntitiesEvent = new ActorEntitiesEvent(this, e); var handler = NewPCEntries; if (handler != null) { handler(this, actorEntitiesEvent); } }
private static void OnNewPCEntries(object sender, ActorEntitiesEvent actorEntitiesEvent) { // delegate event from pc entities from ram, not required to subsribe // this is sent once, and by reference so you only need to use it after if (sender == null) { return; } var pcEntities = actorEntitiesEvent.ActorEntities; }
public virtual void RaiseNewPCEntries(ConcurrentDictionary <UInt32, ActorEntity> e) { var actorEntitiesEvent = new ActorEntitiesEvent(this, e); var handler = NewPCEntries; if (handler != null) { handler(this, actorEntitiesEvent); } }
private static void OnNewPCEntries(object sender, ActorEntitiesEvent actorEntitiesEvent) { // delegate event from player entities from ram, not required to subsribe // this updates 10x a second and only sends data if the items are found in ram // currently there no change/new/removed event handling (looking into it) if (sender == null) { return; } var pcEntities = actorEntitiesEvent.ActorEntities; }
private void PluginHostOnNewNPCEntries(object sender, ActorEntitiesEvent actorEntitiesEvent) { // delegate event from npc entities from ram, not required to subsribe // this list includes anything that is not a player or monster // this updates 10x a second and only sends data if the items are found in ram // currently there no change/new/removed event handling (looking into it) if (sender == null) { return; } var npcEntities = actorEntitiesEvent.ActorEntities; }
//private static void OnNewChatLogEntry(object sender, ChatLogEntryEvent chatLogEntryEvent) //{ // // delegate event from chat log, not required to subsribe // // this updates 100 times a second and only sends a line when it gets a new one // if (sender == null) // { // return; // } // var chatLogEntry = chatLogEntryEvent.ChatLogEntry; // try // { // LogPublisher.Process(chatLogEntry); // } // catch (Exception ex) // { // } //} private static void OnNewMonsterEntries(object sender, ActorEntitiesEvent actorEntitiesEvent) { // delegate event from monster entities from ram, not required to subsribe // this updates 10x a second and only sends data if the items are found in ram // currently there no change/new/removed event handling (looking into it) if (sender == null) { return; } var monsterEntities = actorEntitiesEvent.ActorEntities; if (monsterEntities.Any()) { XIVInfoViewModel.Instance.CurrentMonsters = new ObservableCollection <ActorEntity>(monsterEntities); } }
private static void OnNewMonsterEntries(object sender, ActorEntitiesEvent actorEntitiesEvent) { // delegate event from monster entities from ram, not required to subsribe // this updates 10x a second and only sends data if the items are found in ram // currently there no change/new/removed event handling (looking into it) if (sender == null) { return; } var monsterEntities = actorEntitiesEvent.ActorEntities; if (!monsterEntities.Any()) { return; } EncounterController.mobList = monsterEntities; }
private static void OnNewPCEntries(object sender, ActorEntitiesEvent actorEntitiesEvent) { // delegate event from player entities from ram, not required to subsribe // this updates 10x a second and only sends data if the items are found in ram // currently there no change/new/removed event handling (looking into it) if (sender == null) { return; } var pcEntities = actorEntitiesEvent.ActorEntities; if (!pcEntities.Any()) { return; } PCWorkerDelegate.CurrentUser = pcEntities.First(); PCWorkerDelegate.ReplaceNPCEntities(new List <ActorEntity>(pcEntities)); Func <bool> saveToDictionary = delegate { try { var enumerable = PCWorkerDelegate.GetUniqueNPCEntities(); foreach (var actor in pcEntities) { var exists = enumerable.FirstOrDefault(n => String.Equals(n.Name, actor.Name, Constants.InvariantComparer)); if (exists != null) { continue; } PCWorkerDelegate.AddUniqueNPCEntity(actor); } } catch (Exception ex) { } return(true); }; saveToDictionary.BeginInvoke(null, saveToDictionary); }
private static void OnNewNPCEntries(object sender, ActorEntitiesEvent actorEntitiesEvent) { // delegate event from npc entities from ram, not required to subsribe // this list includes anything that is not a player or monster // this updates 10x a second and only sends data if the items are found in ram // currently there no change/new/removed event handling (looking into it) if (sender == null) { return; } var npcEntities = actorEntitiesEvent.ActorEntities; if (!npcEntities.Any()) { return; } NPCWorkerDelegate.ReplaceNPCEntities(new List <ActorEntity>(npcEntities)); Func <bool> saveToDictionary = delegate { try { var enumerable = NPCWorkerDelegate.GetUniqueNPCEntities(); foreach (var actor in npcEntities) { var exists = enumerable.FirstOrDefault(n => n.NPCID2 == actor.NPCID2); if (exists != null) { continue; } NPCWorkerDelegate.AddUniqueNPCEntity(actor); } } catch (Exception ex) { } return(true); }; saveToDictionary.BeginInvoke(null, saveToDictionary); }
private static void OnNewMonsterEntries(object sender, ActorEntitiesEvent actorEntitiesEvent) { // delegate event from monster entities from ram, not required to subsribe // this updates 10x a second and only sends data if the items are found in ram // currently there no change/new/removed event handling (looking into it) if (sender == null || TwintaniaWidgetViewModel.Instance.TestMode) { return; } var monsterEntities = actorEntitiesEvent.ActorEntities; var twintania = monsterEntities.SingleOrDefault(monster => (monster.NPCID1 == 4295027 && monster.NPCID2 == 2021)); if (twintania != null && twintania.IsValid && twintania.HPCurrent > 0) { TwintaniaWidgetViewModel.Instance.TwintaniaEntity = twintania; TwintaniaWidgetViewModel.Instance.TwintaniaIsValid = true; TwintaniaWidgetViewModel.Instance.TwintaniaHPPercent = (double)twintania.HPPercent; if (twintania.IsClaimed && !TwintaniaWidgetViewModel.Instance.TwintaniaEngaged) { LogHelper.Log(Logger, "Twintania engaged in combat.", LogLevel.Debug); TwintaniaWidgetViewModel.Instance.EnrageTimerStart(); TwintaniaWidgetViewModel.Instance.TwintaniaEngaged = true; } else if (TwintaniaWidgetViewModel.Instance.TwintaniaEngaged && !twintania.IsClaimed) { LogHelper.Log(Logger, "Twintania found, but not engaged in combat.", LogLevel.Debug); TwintaniaWidgetViewModel.Instance.EnrageTimerStop(); TwintaniaWidgetViewModel.Instance.TwintaniaEngaged = false; } } else if (TwintaniaWidgetViewModel.Instance.TwintaniaIsValid) { if (twintania != null) { LogHelper.Log(Logger, "Twintania no longer tracked. ( IsValid:" + twintania.IsValid + " HPCurrent:" + twintania.HPCurrent + " )", LogLevel.Debug); } else { LogHelper.Log(Logger, "Twintania no longer tracked. ( Not found in memory )", LogLevel.Debug); } TwintaniaWidgetViewModel.Instance.DivebombTimerStop(); TwintaniaWidgetViewModel.Instance.EnrageTimerStop(); TwintaniaWidgetViewModel.Instance.TwintaniaEntity = null; TwintaniaWidgetViewModel.Instance.TwintaniaIsValid = false; TwintaniaWidgetViewModel.Instance.TwintaniaEngaged = false; TwintaniaWidgetViewModel.Instance.TwintaniaHPPercent = 0; TwintaniaWidgetViewModel.Instance.TwintaniaDivebombCount = 1; TwintaniaWidgetViewModel.Instance.TwintaniaDivebombTimeToNextCur = 0; TwintaniaWidgetViewModel.Instance.TwintaniaDivebombTimeToNextMax = 0; } var dreadknight = monsterEntities.SingleOrDefault(monster => (monster.NPCID1 == 4295031 && monster.NPCID2 == 2026)); if (dreadknight != null && dreadknight.IsValid && dreadknight.HPCurrent > 0) { TwintaniaWidgetViewModel.Instance.DreadknightEntity = dreadknight; TwintaniaWidgetViewModel.Instance.DreadknightIsValid = true; TwintaniaWidgetViewModel.Instance.DreadknightHPPercent = (double)dreadknight.HPPercent; } else if (TwintaniaWidgetViewModel.Instance.DreadknightIsValid) { if (dreadknight != null) { LogHelper.Log(Logger, "Dread Knight no longer tracked. ( IsValid:" + dreadknight.IsValid + " HPCurrent:" + dreadknight.HPCurrent + " )", LogLevel.Debug); } else { LogHelper.Log(Logger, "Dread Knight no longer tracked. ( Not found in memory )", LogLevel.Debug); } TwintaniaWidgetViewModel.Instance.DreadknightEntity = null; TwintaniaWidgetViewModel.Instance.DreadknightIsValid = false; TwintaniaWidgetViewModel.Instance.DreadknightHPPercent = 0; } }