GithubHelp home page GithubHelp logo

chart-of-exile's Introduction

Chart of Exile

version 0.1.1a

Usage

Quick setup and go

//setup our DI
IServiceCollection services = new ServiceCollection().AddGameClientMonitor();

//setup provider
using(IServiceProvider serviceProvider = services.BuildServiceProvider())
{
    // resolve INotificationMonitor
    INotificationMonitor monitor = serviceProvider.GetService<INotificationMonitor>();
    
    // subscribe to event
    monitor.NotificationReceived += (sender, args) =>
    {
        // handle required case
        if(args.Notification is AfkNotification afkNotification)
        {
            Console.WriteLine(afkNotification.IsActive ? "Hey wake up!" : "AFK disabled");
        }
    }
}

Configuration

You can configure INotificationMonitor by using optional parameter of dependency injection extension method:

services.AddGameClientMonitor(config =>
{
    config.ClientTxtPath = @"D:\Steam\steamapps\common\Path of Exile\logs\Client.txt";
    config.IsOnlyFirstMatchHandled = true;
    config.UseDefaultMatchings = false;
    config.NotificationMatches = new []{ YourNotificationMath, AnotherNotificationMatch }
});
  • ClientTxtPath: custom path to Client.txt
    • default: "C:\Program Files\Steam\steamapps\common\Path of Exile\logs\Client.txt"
  • IsOnlyFirstMatchHandled: whether monitor stops processing log line after meeting first match
    • default: true
  • UseDefaultMatchings: whether default matching rules are registered (see Supported Matching Rules below)
    • default: true
  • NotificationMatches: collection of custom matching rules (see Custom Matching Rules below)
    • default: null

Supported Matching Rules

  • Area enter - location name
  • AFK on/off - is enabled
  • Level up - login, level
  • Chat Message -
    • Local, Global, Trade, Guild, Party, Whisper
  • Player joined/left the area
  • Trade templates based on poe.trade and map exchange services
  • Kitavas Affliction (resistatnce penalty)

Planned in the near future:

  • NPC dialoges (chat messages with additional filter on constant names)
  • error notifications with additional filter for "Disconnected from server"

Custom Matching Rules

It is possible to write and register custom matching rules based on regular expression and capturing group mapping. This feature allows to handle specific cases like trade message, map exchange or bulk purchase templates.

INotificationMatch notificaionMatch = new NotificationMatch
(
    regex: new Regex(@"Connect time to instance server was (\d*)ms"),
    onMap: (groups, metadata) => new ConnectionNotification(int.Parse(groups[1].Value), metadata)
);

...

class ConnectionNotification : BaseNotification
{
    public int ConnectTime { get; }

    public ConnectionNotification(int connectTime, LogMetadata metadata) : base(metadata)
    {
        ConnectTime = connectTime;
    }
}

...

// subscribe to event
monitor.NotificationReceived += (sender, args) =>
{
    // handle required case
    if(args.Notification is ConnectionNotification connectionNotification)
    {
        Console.WriteLine($"Your connect time was {connectionNotification.ConnectTime} ms");
    }
}

chart-of-exile's People

Contributors

ayronk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.