Skip to content

working with client in .net #126

@pavlexander

Description

@pavlexander

Hello,

Is it possible to read some real-time data from the running Raid instance? For example :

  • a list of players on the arena, together with their total power level, champions and other relevant info
  • a list of rewards available for picking
  • a list of missions/challenges/quests active and finished
  • remaining HP/speed bar/buffs/debuffs in ongoing battle of all enemies and players (arena, campaign, dungeon)

In my attempts - I have tried reading the live data through the provided API in .net:

    internal class Program
    {
        static async Task Main(string[] args)
        {
            RaidToolkitClient client = new();
            try
            {
                client.Connect();

                var accounts = await client.AccountApi.GetAccounts();
                var acc = accounts[0].Id;

                client.RealtimeApi.AccountListUpdated += AccountListUpdated;
                client.RealtimeApi.ViewChanged += ViewChanged;
                client.RealtimeApi.ReceiveBattleResponse += ReceiveBattleResponse;

                client.AccountApi.Updated += Updated;

                Console.ReadKey();
            }
            catch (Exception ex)
            {
                Console.WriteLine($"An error occurred: {ex.Message}");
            }
            finally
            {
                client.Disconnect();
            }
        }

        public static void AccountListUpdated(object? sender, SerializableEventArgs args)
        {
            Console.WriteLine(args.EventName);
        }

        public static void ViewChanged(object? sender, SerializableEventArgs args)
        {
            Console.WriteLine(args.EventName);
        }

        public static void ReceiveBattleResponse(object? sender, SerializableEventArgs args)
        {
            Console.WriteLine(args.EventName);
        }

        public static void Updated(object? sender, SerializableEventArgs args)
        {
            Console.WriteLine(args.EventName);
        }
    }

but events are never triggered. Does not matter if you change the view in-game, or battling etc, no events are shown in console.. what am I doing wrong? Other methods such as "get account info"/etc are working fine..

Basically I am just interested in the live data and want to know if it's possible to read it through the tool or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions