private void AreaChanged(AreaInstance area) { try { ValidEntitiesByType = NewValidEntitiesByType(); EntityCache.Clear(); var dataLocalPlayer = _gameController.Game.IngameState.Data.LocalPlayer; if (Player != null && Player.Address == dataLocalPlayer.Address) { return; } if (!dataLocalPlayer.Path.StartsWith("Meta")) { return; } Player = dataLocalPlayer; Player.IsValid = true; PlayerUpdate?.Invoke(this, Player); } catch (Exception e) { DebugWindow.LogError($"EntityListWrapper.AreaChanged -> {e}"); } }
public void ForceRefreshArea() { var ingameData = TheGameState.IngameState.Data; var clientsArea = ingameData.CurrentArea; var curAreaHash = TheGameState.CurrentAreaHash; CurrentArea = new AreaInstance(clientsArea, curAreaHash, ingameData.CurrentAreaLevel); if (CurrentArea.Name.Length == 0) { return; } ActionAreaChange(); }
private void AreaChanged(AreaInstance area) { try { entityCollectSettingsContainer.Break = true; var dataLocalPlayer = gameController.Game.IngameState.Data.LocalPlayer; if (Player == null) { if (dataLocalPlayer.Path.StartsWith("Meta")) { Player = dataLocalPlayer; Player.IsValid = true; PlayerUpdate?.Invoke(this, Player); } } else { if (Player.Address != dataLocalPlayer.Address) { if (dataLocalPlayer.Path.StartsWith("Meta")) { Player = dataLocalPlayer; Player.IsValid = true; PlayerUpdate?.Invoke(this, Player); } } } entityCache.Clear(); OnlyValidEntities.Clear(); NotOnlyValidEntities.Clear(); foreach (var e in ValidEntitiesByType) { e.Value.Clear(); } // foreach (var e in NotValidEntitiesByType) e.Value.Clear(); } catch (Exception e) { DebugWindow.LogError($"{nameof(EntityListWrapper)} -> {e}"); } }
public bool RefreshState() { var ingameData = TheGameState.IngameState.Data; var clientsArea = ingameData.CurrentArea; var curAreaHash = TheGameState.CurrentAreaHash; if (CurrentArea != null && curAreaHash == CurrentArea.Hash) { return(false); } CurrentArea = new AreaInstance(clientsArea, curAreaHash, ingameData.CurrentAreaLevel); if (CurrentArea.Name.Length == 0) { return(false); } ActionAreaChange(); return(true); }
public virtual void AreaChange(AreaInstance area) { }