none
What should I learn to create a HTTP server with C# for games? RRS feed

  • Question

  • Hello, I'm new to server programming, I have beeing creating small Unity games using C# (the only language I know), and now I need a simple server just for players to login and save their progress, maybe also generate some random numbers for gameplay.

    The server doesn't need to repond to clients very quickly, and doesn't need to maintain a connection with clients either, only clients call the server when needed. And I don't want to go directly with lower level socket programming. I think a HTTP kind of server may just do the work (I also use HTTP modules on the client side).

    So in this case, I want to know what should I learn, or whether there are some frameworks / architectures I can leverage. Shall I learn ASP.NET? But it's for game, there will be no web page involved. I'm totally new to server programming, so I'm sorry if I ask the question in a wrong way.

    Btw, I don't want to use some game server engines like Photon or Unity network features, just want to build something of my own (but it's also good if there are some frameworks / architectures I can leverage).

    Thank you very much for checking out my question.






    Friday, December 13, 2019 6:13 PM

Answers

  • https://www.tutorialsteacher.com/webapi/web-api-tutorials

    https://www.restapitutorial.com/lessons/httpmethods.html

    https://www.tutorialsteacher.com/webapi/consuming-web-api-in-dotnet-using-httpclient

    I suggest that you use ASP.NET Core 3.0.

    All of this can be discussed at ASP.NET forums.

    http://forums.asp.net/

    Friday, December 13, 2019 10:23 PM

All replies

  • https://www.tutorialsteacher.com/webapi/web-api-tutorials

    https://www.restapitutorial.com/lessons/httpmethods.html

    https://www.tutorialsteacher.com/webapi/consuming-web-api-in-dotnet-using-httpclient

    I suggest that you use ASP.NET Core 3.0.

    All of this can be discussed at ASP.NET forums.

    http://forums.asp.net/

    Friday, December 13, 2019 10:23 PM
  • Did you do any searching at all on this?  There are a vast number of Google hits on this topic.  C# includes an HttpServer class that can do most of the work for you.  You just need to write a handler to accept the requests and generate responses.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Friday, December 13, 2019 10:24 PM
  • Did you do any searching at all on this?  There are a vast number of Google hits on this topic.  C# includes an HttpServer class that can do most of the work for you.  You just need to write a handler to accept the requests and generate responses.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Please trust me I did, otherwise I couldn't even make my question clear. Most of the game server solutions are not C# related, and there are even fewer results can be found when I combined the "game + server + C# + HTTP" key words together. Besides reading some articles, I've also tried some simple HTTP server solutions using .net framework httpserver, which kind of worked, though not enough. I saw many people doing the game server in quite different ways, so I wanted to bring this question and hopefully I can work on the right path that best works for me from the begining.

    With the replied from all of you, I now have a better picture about how to build it. Really appreciate your help.




    Saturday, December 14, 2019 7:46 AM
  • https://www.tutorialsteacher.com/webapi/web-api-tutorials

    https://www.restapitutorial.com/lessons/httpmethods.html

    https://www.tutorialsteacher.com/webapi/consuming-web-api-in-dotnet-using-httpclient

    I suggest that you use ASP.NET Core 3.0.

    All of this can be discussed at ASP.NET forums.

    http://forums.asp.net/

    Thank you so much for the very detailed reference infomation and your reply on this very general question, I'll go through all these tutorials, and will post related questions on the asp.net forum next time when needed.
    Saturday, December 14, 2019 7:49 AM