简体   繁体   English

Asp.NET实时游戏

[英]Asp.NET Real Time Game

I want to develop a game in real time. 我想实时开发游戏。 updated for all users on a picture every second. 每秒为图片上的所有用户更新。 But I have no idea how to do, Is there something similar, i can use the sample code? 但我不知道怎么做,有类似的东西,我可以使用示例代码吗? I'll use C# and Asp.NET 我将使用C#和Asp.NET

Note: Sorry for my bad english. 注意:抱歉我的英语不好。

Try using SignalR, from what I can tell from your question, this would work well for doing game updates. 尝试使用SignalR,从我的问题可以看出,这对于进行游戏更新非常有用。

https://github.com/SignalR/SignalR https://github.com/SignalR/SignalR

https://github.com/SignalR/SignalR/wiki/Getting-Started https://github.com/SignalR/SignalR/wiki/Getting-Started

If latency really matters then you should be looking at a WebSocket solution and not one introduces the overhead of requiring HTTP Requests. 如果延迟真的很重要,那么你应该看一个WebSocket解决方案而不是一个人引入了需要HTTP请求的开销。 WebSockets support bi-directional communication between a client and server over a single connection which keeps latency to an absolute minimum. WebSockets通过单个连接支持客户端和服务器之间的双向通信,从而将延迟保持在绝对最小值。 Other HTTP-based solutions, including EventSource, mean that data coming from the server to the client can be sent with low latency but messages from the server to the client have to be made by establishing a new HTTP request which introduces latency. 其他基于HTTP的解决方案,包括EventSource,意味着从服务器到客户端的数据可以低延迟发送,但是必须通过建立引入延迟的新HTTP请求来发送从服务器到客户端的消息。

So, this means that ASP.NET is not a good choice for a truly realtime game at the moment. 所以,这意味着ASP.NET目前不是真正实时游戏的好选择。

What are the alternatives? 有哪些替代方案?

If you want to stay in the .NET world then I'd consider looking at XSockets or SuperWebSocket . 如果你想留在.NET世界,我会考虑看XSocketsSuperWebSocket

If you would consider other technology solutions then I've compiled a list of realtime web technology solutions . 如果您考虑其他技术解决方案,那么我已经编制了一份实时Web技术解决方案列表 Again, when making a choice I'd favour solutions that have WebSocket support. 再次,在做出选择时,我倾向于支持具有WebSocket支持的解决方案。

If you want to keep close to the Microsoft stack you could look at socket.io on Windows Azure. 如果您想要靠近Microsoft堆栈,可以在Windows Azure上查看socket.io See Running Socket.io on Windows Azure Web and Worker Roles 请参阅在Windows Azure Web和工作者角色上运行Socket.io

If you would consider Node and a hosted service then the Pusher Pipe might be of interest for you. 如果您考虑Node和托管服务,那么Pusher Pipe可能会对您感兴趣。

From version 1.0 beta, the version just recently published on Nuget there is some changes regarding the XSockets Server (named XSocketsMaxiServr in prior version) , now its called XSockets.DevelopmentServer.Console.exe , and can be found in the XSockets\\DevelopmentServer folder or the project where you install. 从版本1.0 beta开始,最近在Nuget上发布的版本有一些关于XSockets服务器(在先前版本中名为XSocketsMaxiServr)的更改,现在称为XSockets.DevelopmentServer.Console.exe,可以在XSockets \\ DevelopmentServer文件夹中找到或者您安装的项目。

By just opening it from the "command prompt" the server starts, registers the WebSocketHandlers of yours. 只需从服务器启动的“命令提示符”打开它,就可以注册您的WebSocketHandlers。 The examples that will be added during install, is located under XSockets\\Examples. 将在安装期间添加的示例位于XSockets \\ Examples下。

We will update the documentation in just a few days, and i also know that Ulf , a team-member of XSockets just recently publised a new guide/video that can be found here: 我们将在几天内更新文档,而且我也知道Xlf的团队成员Ulf最近公布了一个新的指南/视频,可以在这里找到:

http://xsockets.net/videos http://xsockets.net/videos

The movie is called "XSockets.NET 1.0 RC1 - getting started" and im sure that i will be helpfull for you. 这部电影被称为“XSockets.NET 1.0 RC1 - 入门”,我相信我会对你有所帮助。

If you need any assistance don't hesitate to contact us, we will assist you as much as possible! 如果您需要任何帮助,请随时与我们联系,我们将尽可能为您提供帮助! You will find the correct contact information at the XSockets WebSite. 您可以在XSockets WebSite上找到正确的联系信息。

Kind regards, Magnus Thor, Team XSockets.NET 亲切的问候,Magnus Thor,Team XSockets.NET

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

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