void InitializeDataReader() { var memoryTableFactory = new GameMemoryTableFactory(); dataReader = new D2DataReader(memoryTableFactory); dataReader.CharacterCreated += OnCharacterCreated; dataReader.DataRead += OnDataRead; }
void InitializeDataReader() { var memoryTableFactory = new GameMemoryTableFactory(); dataReader = new D2DataReader(memoryTableFactory, this.settingsService.CurrentSettings.ProcessDescriptions); dataReader.CharacterCreated += OnCharacterCreated; dataReader.DataRead += OnDataRead; }
private void OnWindowDisposed(object sender, EventArgs e) { // Make sure the process handles close correctly. if (dataReader != null) { dataReader.Dispose(); dataReader = null; } }
public static List <ItemInfo> GetItemsByLocations(D2DataReader dataReader, List <BodyLocation> locations) { List <ItemInfo> Items = new List <ItemInfo>(); dataReader.ItemSlotAction(locations, (itemReader, item) => { Items.Add(new ItemInfo(itemReader, item)); }); return(Items); }
public ItemServer(D2DataReader dataReader, string pipeName) { this.dataReader = dataReader; this.pipeName = pipeName; listenThread = new Thread(new ThreadStart(ServerListen)); listenThread.IsBackground = true; listenThread.Start(); }
internal static List <ItemInfo> GetItemsByItems(D2DataReader dataReader, IEnumerable <Item> items) { List <ItemInfo> Items = new List <ItemInfo>(); dataReader.ItemAction(items, (item, player, unitReader, stringReader, inventoryReader) => { Items.Add(new ItemInfo(item, player, unitReader, stringReader, inventoryReader)); }); return(Items); }
public static List <ItemInfo> GetItemsByLocations(D2DataReader dataReader, List <BodyLocation> locations) { List <ItemInfo> Items = new List <ItemInfo>(); dataReader.ItemSlotAction(locations, (item, player, unitReader, stringReader, inventoryReader) => { Items.Add(new ItemInfo(item, player, unitReader, stringReader, inventoryReader)); }); return(Items); }
public HttpClientService(GameService gameService, SettingsService settingsService) { this.gameService = gameService; dataReader = gameService.DataReader; settingsService.SettingsChanged += (object sender, ApplicationSettingsEventArgs args) => { Init(args.Settings); }; Init(settingsService.CurrentSettings); }
public void Initialize() { Logger.Info("Initializing game service."); DataReader = new D2DataReader( new GameMemoryTableFactory(), di.configService.CurrentConfig.ProcessDescriptions ); DataReader.DataRead += OnDataRead; Logger.Info("Initializing data reader thread."); new Thread(DataReader.RunReadOperation) { IsBackground = true }.Start(); }
public GameService(ISettingsService settingsService) { Logger.Info("Initializing game service."); DataReader = new D2DataReader( new GameMemoryTableFactory(), settingsService.CurrentSettings.ProcessDescriptions ); DataReader.CharacterCreated += OnCharacterCreated; DataReader.DataRead += OnDataRead; Logger.Info("Initializing data reader thread."); new Thread(DataReader.RunReadOperation) { IsBackground = true }.Start(); }
private void initialize() { try { Settings = LoadSettings(); } catch (Exception e) { // Log error and show error message. Logger.Instance.WriteLine("Unhandled Settings Error:\n{0}", e.ToString()); MessageBox.Show("An unhandled exception was caught trying to load the settings.\nPlease report the error and include the log found in the log folder.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // Rethrow current exception. throw; } if (dataReader == null) { var memoryTable = GetVersionMemoryTable(Settings.D2Version); dataReader = new D2DataReader(this, memoryTable); itemServer = new ItemServer(dataReader, ItemServerPipeName); } if (dataReaderThread == null) { dataReaderThread = new Thread(dataReader.readDataThreadFunc); dataReaderThread.IsBackground = true; dataReaderThread.Start(); } if (Settings.CheckUpdates) { VersionChecker.CheckForUpdate(false); } ApplySettings(Settings); }
protected virtual void Dispose(bool disposing) { if (isDisposed) { return; } Logger.Info("GameService disposed."); if (disposing) { if (dataReader != null) { dataReader.DataRead -= OnDataRead; dataReader.CharacterCreated -= OnCharacterCreated; dataReader.Dispose(); dataReader = null; } } isDisposed = true; }
public CompletedQuestsRequestHandler(D2DataReader dataReader) { this.dataReader = dataReader; }
public AllItemsRequestHandler(D2DataReader dataReader) { this.dataReader = dataReader ?? throw new ArgumentNullException(nameof(dataReader)); }
public HirelingRequestHandler(D2DataReader dataReader) { this.dataReader = dataReader; }
public GameRequestHandler(D2DataReader dataReader) { this.dataReader = dataReader; }
public ItemRequestHandler(D2DataReader dataReader) { this.dataReader = dataReader; }
public CharacterRequestHandler(D2DataReader dataReader) { this.dataReader = dataReader; }
public CompletedQuestsRequestHandler(D2DataReader dataReader) { this.dataReader = dataReader ?? throw new ArgumentNullException(nameof(dataReader)); }