World of Warcraft image processing

狂风中的少年 提交于 2020-01-03 05:14:15

问题


As I´ve looked for a way to create an addon, which checks the WoW-PvP-Queue-Status, for creating a REST service, I was told that it`s not possible to have a real-time connection between an addon and a REST service. So I was thinking about another way to solve my problem and came to the point, where I thought about analyzing the WoW-Window and searching for a visual pattern to accomplish for what I´m looking for. My program should check and tell me, whenever a user of the program is queuing for an battleground and should also tell me on which battleground he/she is queuing, so I can gather the data and post it to my service/website. I could create some visual feedback with an WoW-Addon, for the events I´m looking for ... like a signal, which tells my program what to do.

So I´d like to know, how I would accomplish to create such signal-interpreter( so like an Screen Grabber). I was thinking about OpenCV, but dont know where to start, especially I´m kinda curious in how Warden(Anti Cheat Engine) would interpret such program, I really don`t want my users to get banned for such a thing. It should really just interpret visual feedback of the addon I´d create.

So for example:

If user queues for Arathi Basin, a yellow signal should pop and if the yellow signal pops up, the program tells my service that player xyz has queued up, which should be displayed later on ... on my homepage in real-time. If the user queues up for Warsong, another signal pops up, etc.

I´m currently just experienced with C#/.NET in an early stage and would start a little project with such an service, so what I need to learn to get this thing build up?

I really just would love to have a little guide on which knowledge I need, to solve this problem.


回答1:


for Windows it is doable but grabbing WinAPI is a bit unstable.

So write new App that:

  1. you need to find the WoW Client window (its handle)
  2. grab its canvas as bitmap

    If gfx driver allows it if not try to take the desktop image instead. So create canvas with:

    Canvas->handle = GetDC(WOW_window_handle);
    

    its size you get like this:

    RECT r; GetWindowRect(WOW_window_handle,&r);
    

    so now just copy rectangle from canvas to your bitmap for processing ...

  3. then you can do what ever you need to

    as the image is computer generated it will not be too much noisy only scaled +/- some filters so it should be relatively easy to detect if the image contains battleground info or not. Also detect/read text in it should be easy enough

  4. if searched event/info was detected

    then just send the data to your WEB

if you need to have this info also inside the ADDON

then you need to search for some way to receive it. I am not familiar with WoW addon programming so have no clue...

but I would try:

  1. if you got any IPC capability from Addon use it

  2. if you have access to files

    then continuosly scan a file from addon and send the info there (be careful with multiple file access conflicts)

  3. can try to send keystrokes to your WoW client

    if you can detect them from Addon or specific actions like wrote specific text message (not conflicting your movement keys)

  4. if you can hack in your Server/Clienet TCP/IP stream

    you could inject packets with specific meaning like incoming private message etc but you would need to be familiar with WoW Server/Client communication (WoW uses SRP6 if I remember correctly) and it would increase the ping lag ... You still need to be able to detect it from Addon on the other hand you should be able to detect packets related to battleground and do not need to OCR/CV the WoW image ...

see these related Q/A's:

  • list windows handle from outside app
  • simple OCR
  • How to recognize UI elements in image
  • Putting an application in between client and server ... contains example of WoW SRP6 protocol packets in mine post there
  • MaNGOS source repository ... can learn much about WoW from this

[Notes]

Each of the bullets is suitable for separate question so start coding and when hit a problem ask specific question about it



来源:https://stackoverflow.com/questions/32666990/world-of-warcraft-image-processing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!