简体   繁体   English

如何从基于浏览器的游戏Web服务器获取本地应用程序以轮询游戏数据

[英]How to get Local Application to Poll Game Data from Browser-based Game Web Server

thank for looking into my question. 感谢您调查我的问题。

Fist let me state that my experience with any sort of web development is extremely limited. 拳头让我指出,我对任何类型的Web开发的经验都非常有限。 My forte is embedded systems and nothing to do with their web interfaces. 我的专长是嵌入式系统,与它们的Web界面无关。 Also, I'm not looking for anyone to do the work for me. 另外,我并不想找任何人为我做这项工作。 If someone can tell me "yes this can be done, and this is the general direction and approach that you would" use I'd be happy to learn the rest on my own. 如果有人可以告诉我“是的,这是可以做到的,这是您要遵循的一般方向和方法”,那么我很乐意自己学习其余的知识。

What I am interested in doing is taking data from the web server of a browser-based game and doing some local analysis of it. 我感兴趣的是从基于浏览器的游戏的Web服务器中获取数据并对其进行一些本地分析。 For instance games like Lord of Ultima or Ikariam allow you to play from your browser, obviously the controls and interface are updated from the server hosting the game. 例如,诸如《洛神之王》或《伊卡里亚姆》之类的游戏允许您从浏览器进行游戏,显然控件和界面是从托管游戏的服务器上更新的。 I have experimented some with greasemonkey java scripts and have seen scripts that read data from these games and modify the UI; 我已经尝试过一些用滑脂猴子Java脚本编写的脚本,并且看到了从这些游戏读取数据并修改UI的脚本。 however, the nature of these scripts does not allow me to get the data to my local machine for analysis. 但是,这些脚本的性质不允许我将数据获取到本地计算机进行分析。 I would prefer to write my application in C#, but I'm open to other options if no .NET solution is practical. 我更愿意用C#编写应用程序,但是如果没有.NET解决方案实用的话,我可以接受其他选择。 Is there a way to do this? 有没有办法做到这一点? The idea is for me to be able to log into the game and leave my browser open while my application polls for data (like resource counts or attacks etc...) or something. 我的想法是让我能够登录游戏并使我的浏览器保持打开状态,同时我的应用程序轮询数据(例如资源计数或攻击等)或其他东西。 Or maybe I'm missing something, where a script can write to the local machine. 或者,也许我缺少了一些可以将脚本写入本地计算机的内容。 If you need more information please let me know. 如果您需要更多信息,请告诉我。

Thanks again for your time! 感谢你的宝贵时间!

Most game engines strive to keep their data out of the hands of people outside of the server. 大多数游戏引擎都努力将其数据置于服务器外部人员的控制之下。 Yes there are requestors in the client that retrieve information and display on the UI, but that is always isolated information based on the client state. 是的,客户端中有一些请求者可以检索信息并显示在UI上,但这始终是基于客户端状态的隔离信息。

The reason for this restriction is that if someone accesses the data, such as your proposal, then it also opens the door to either hacking accounts or cheating. 出现此限制的原因是,如果有人访问数据(例如您的提案),那么它也为黑客帐户或作弊行为打开了大门。 After all if you can pull in your data, you can manipulate it and make your character unbeatable. 毕竟,如果您可以提取数据,则可以对其进行操作并使其角色无与伦比。 This throws off the delicate game balance. 这样就失去了微妙的游戏平衡。 And even if you say 'but I never intended to do that' it doesn't open the door to you getting at the data. 即使您说“但我从未打算那样做”,它也不会打开您获取数据的门。 It is just too great a risk for the developer. 对于开发人员而言,这实在太大了。

Now while a program can "play" the game if a human can, that is indeed true. 现在,尽管程序可以在人类可以玩的情况下“玩”游戏,但确实如此。 In the gaming world these are called bots. 在游戏世界中,这些被称为机器人。 The bot puts a player at an unfair advantage over other legal players since it just sits and waits until it can make a move while the player may have a large window between moves. 该机器人将玩家置于其他合法玩家之上的不公平优势,因为它只是坐着等待,直到它可以移动为止,而玩家之间的移动窗口可能很大。 Most gaming websites ban bots for this reason. 大多数游戏网站都出于这个原因禁止机器人。 Computer play in the place of a human is still cheating. 代替人类的计算机游戏仍然在作弊。

UPDATE: 更新:

Now that I've said that here is a website that may give you some practice in doing what you want to do as it is written specifically for getting data from a website and manipulating it: hacker.org 现在,我已经说过,这里是一个网站,可以专门为从网站获取数据和操作而编写,它可以为您做一些自己想做的事情: hacker.org

If I understand this right, you want to programatically control a web browser. 如果我了解这项权利,则希望以编程方式控制Web浏览器。 As far as I know, SeleniumRC is the tool-of-choice for this. 据我所知, SeleniumRC是实现这一目标的选择工具。

I understand it is far more powerful than its lightweight companion Selenium IDE , and with just that, you can script interactions with a website without having to understand a great deal about its implementation. 我知道它比其轻量级的配套Selenium IDE强大得多,而且,您可以在与网站进行交互时编写脚本,而无需过多了解其实现。 Eg you can locate and click a button based on its text content and not its element ID or location within the document. 例如,您可以基于按钮的文本内容而不是其元素ID或文档中的位置来找到并单击按钮。

-- -

If you want to just sniff the game's HTTP traffic, then a browser-based HTTP sniffer (like Firefox's live HTTP headers) will do it even if it's SSL (if you use a proxy and the traffic is SSL, I suspect the game server will be able to detect it). 如果您只是想嗅探游戏的HTTP流量,那么基于浏览器的HTTP嗅探器(例如Firefox的实时HTTP标头)即使是SSL也会做到这一点(如果您使用代理并且流量是SSL,我怀疑游戏服务器会能够检测到)。

I predict it would be more difficult to understand the HTTP traffic than to use Selenium to scrape the data you require directly from the UI. 我预计了解HTTP流量要比使用Selenium直接从UI抓取您所需的数据要困难得多。

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

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