Asp.NET Real Time Game

I want to develop a game in real time. updated for all users in the picture every second. But I have no idea how to do this, is there something similar, can I use a sample code? I will use C # and Asp.NET

Note: Sorry for my bad english.

+6
source share
3 answers

If latency really matters, you should look at the WebSocket solution and not introduce overhead that requires HTTP requests. WebSockets support bidirectional communication between the client and server over a single connection, which provides latency to an absolute minimum. 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 must be executed by creating a new HTTP request that introduces a delay.

So this means that ASP.NET is not a good choice for a really real game at the moment.

What are the alternatives?

If you want to stay in the .NET world, I would consider XSockets or SuperWebSocket .

If you look at other technological solutions, I have put together a list of real-time web solutions . Again, making a choice, I would prefer solutions that support WebSocket.

If you want to be near the Microsoft stack, you can look at socket.io on Windows Azure. See Starting Socket.io on Windows Azure Web Pages and Worker Roles

If you look at Node and the hosted service, you might be interested in Pusher Pipe .

+2
source

Try using SignalR, based on what I can say about your question, this will work well for updating the game.

https://github.com/SignalR/SignalR

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

+4
source

From version 1.0 beta, a version recently published by Nuget, there are some changes regarding XSockets Server (named XSocketsMaxiServr in the previous version), now it is called XSockets.DevelopmentServer.Console.exe and can be found in XSockets \ DevelopmentServer folder or project which you install.

Just opening it from the command line, the server starts, registers your WebSocketHandlers. Examples that will be added during installation are in the XSockets \ Examples section.

We will update the documentation in just a few days, and I also know that Ulf, a member of the XSockets team, recently posted a new guide / video, which can be found here:

http://xsockets.net/videos

The movie is called "XSockets.NET 1.0 RC1 - Getting Started," and I'm sure I will be useful to you.

If you need help, do not hesitate to contact us, we will help you as much as possible! You will find the correct contact information on the XSockets website.

Regards, Magnus Thor, Team XSockets.NET

+1
source

Source: https://habr.com/ru/post/906617/


All Articles