简体   繁体   English

魔兽世界图像处理

[英]World of Warcraft image processing

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. 当我在寻找一种创建插件的方法来检查WoW-PvP-Queue-Status来创建REST服务时,我被告知,不可能在插件和插件之间建立实时连接。 REST服务。 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. 因此,我在考虑解决问题的另一种方法,并提出了要点,在这里,我分析了“ WoW窗口”并寻找一种视觉模式来完成我要寻找的东西。 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. 对于我正在寻找的事件,我可以使用WoW-Addon创建一些视觉反馈……就像一个信号,告诉我的程序该做什么。

So I´d like to know, how I would accomplish to create such signal-interpreter( so like an Screen Grabber). 所以我想知道,我将如何创建这样的信号解释器(如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. 我当时在考虑OpenCV,但不知道从哪里开始,尤其是我对Warden(反作弊引擎)如何解释这样的程序感到好奇,我真的不希望我的用户被这样的事情所禁止。 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. 如果用户排队进入阿拉希盆地,则将弹出黄色信号,如果弹出黄色信号,该程序将告知我的服务玩家xyz已排队,稍后应在我的主页上实时显示。 If the user queues up for Warsong, another signal pops up, etc. 如果用户排队等待Warsong,则会弹出另一个信号,依此类推。

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? 我目前只是在C#/。NET方面处于早期阶段,并且会使用这种服务来启动一个小项目,所以我需要学习什么才能使这件事变得更复杂?

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. 对于Windows,这是可行的,但是获取WinAPI有点不稳定。

So write new App that: 因此,编写新的应用程序:

  1. you need to find the WoW Client window (its handle) 您需要找到“ WoW客户端”窗口(其句柄)
  2. grab its canvas as bitmap 抓取其画布作为位图

    If gfx driver allows it if not try to take the desktop image instead. 如果gfx驱动程序允许,则尝试获取桌面映像。 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 然后将数据发送到您的WEB

if you need to have this info also inside the ADDON 如果您需要在ADDON中也有此信息

then you need to search for some way to receive it. 那么您需要寻找某种方式来接收它。 I am not familiar with WoW addon programming so have no clue... 我不熟悉WoW插件编程,所以不知道...

but I would try: 但我会尝试:

  1. if you got any IPC capability from Addon use it 如果您从Addon获得任何IPC功能,请使用它

  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 可以尝试将击键发送到您的WoW客户端

    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 如果可以入侵您的服务器/ Clienet TCP / IP流

    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 ... 您可以注入具有特定含义的数据包,例如传入的私人消息等,但是您需要熟悉WoW服务器/客户端通信(如果我没记错的话,WoW使用SRP6 ),并且会增加ping延迟...您仍然需要能够另一方面,要从Addon进行检测,您应该能够检测与战场相关的数据包,而无需对WOW图像进行OCR / CV处理...

see these related Q/A's: 请参阅以下相关的Q / A:

[Notes] [笔记]

Each of the bullets is suitable for separate question so start coding and when hit a problem ask specific question about it 每个项目符号都适用于单独的问题,因此请开始编码,并在遇到问题时提出有关此问题的特定问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM