魔兽世界图像处理 [英] World of Warcraft image processing

查看:463
本文介绍了魔兽世界图像处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找一种方法来创建一个插件,它检查WoW-PvP-Queue-Status,用于创建REST服务,我被告知,它不可能有一个实时连接一个插件和一个REST服务。所以我正在考虑另一种方式来解决我的问题,来到了点,我想到分析WoW窗口,并寻找一个视觉模式来完成我的寻找。
我的程序应该检查并告诉我,每当程序的用户排队一个战场,也应该告诉我在他/她正在排队的战场,所以我可以收集数据,并发布到我的服务/网站。我可以用一个WoW-Addon创建一些视觉反馈,用于我正在寻找的事件...就像一个信号,告诉我的程序该做什么。



所以我想知道,我将如何完成创建这样的信号解释器(所以像一个Screen Grabber)。我在想OpenCV,但不知道从哪里开始,特别是我很好奇Warden(反欺诈引擎)会如何解释这样的程序,我真的不希望我的用户被禁止这样的事情。



例如:



如果用户队列Arathi Basin,黄色信号应该弹出,如果黄色信号弹出,程序告诉我的服务,玩家xyz已排队,这应该显示在我的主页上的实时的...。如果用户排队等待Warsong,另一个信号弹出等等。



我目前只是经历过C#/。NET在早期阶段,项目与这样的服务,所以我需要学习,以使这个东西建立起来?



我真的只是想要一个指南,我需要哪些知识,解决这个问题。

解决方案

Windows 它是可行的,但抓住WinAPI有点不稳定。



因此撰写新应用程式:


  1. 您需要找到WoW Client窗口(其句柄)

  2. 将其画布作为位图获取




    • 如果gfx驱动程序允许

    • 如果不尝试改用桌面图片

    • ,请使用 Canvas - > handle = GetDC(WOW_window_handle);

    • 它的大小如下: GetWindowRect(WOW_window_handle,& r);

    • 所以现在只需将矩形从画布复制到位图处理...


  3. 那么你可以做任何你需要的





    • +/-一些过滤器

    • li>因此,如果图片包含战场信息
    • ,并且还检测/读取其中的文本,应该相对容易检测

    • 足够容易


  4. 如果检测到搜索事件/信息




    • 然后只需将数据发送到您的WEB




< 如果您需要在ADDON




  • 中包含此信息,那么您需要搜索某种方式接收


  • 我不熟悉WoW addon编程,因此没有线索
  • 但我会尝试:


    1. 如果您有任何来自Addon的IPC功能使用

      li>
    2. 如果您有权访问文件




      • 然后从addon中连续扫描文件

      • 并在那里发送信息(小心多个文件访问冲突)


    3. 向您的WoW客户端发送击键




      • 如果您可以从插件中检测到

      • 喜欢在您的服务器/ Clienet TCP / IP中写入特定的文字讯息(不冲突您的移动键)





      • 您可以注入具有特定含义的数据包,例如传入私人消息等

      • 熟悉WoW服务器/客户端通信(WoW使用 SRP6 ,如果我没记错的话)

      • 会增加ping延迟...

      • ,您仍然需要能够从Addon中检测到

      • 另一方面,您应该能够检测与战场相关的数据包,而不需要OCR / CV the WoW image ...


    / A:





    [注意]




    • 每个项目符号适用于单独的问题

    • 因此开始编码并在遇到问题时提出具体问题


    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.

    解决方案

    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
      • and 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 ...
      • and 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:

    [Notes]

    • each of the bullet is suitable for separate question
    • so start coding and when hit a problem ask specific question about it

    这篇关于魔兽世界图像处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆