Question What should I learn to create a HTTP server for games?

Hao

New member
Joined
Dec 13, 2019
Messages
2
Programming Experience
1-3
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.
 
Do you have an Azure account? If so, Azure functions maybe all you need.

On the other hand, just jump straight to ASP.NET's WebApi is all you need to implement some web services. You don't really need a to implement a web based UI.

If you are a complete beginner with server programming, I would advice you to exercise a lot of caution as you implement stuff. Yes, your game data may not be any real value and it doesn't matter if some manages to hack in, but some one could use your web server as a foothold for something else. Perhaps you store your players email and passwords. Hackers can now try using those emails for spam, and also try those email and password combos to break into other things like Ring cameras. Perhaps you left your database password in the open and you just re-use the same password for your other accounts. Or hackers may start hosting their phishing pages on your web server.

This is not meant to scare you from server development. It's an area with lots of opportunities for fun and profit. Just exercise caution as you explore. I'm quite sure people on this forum will be more than generous to review your design/code and give advise.

Good luck with your game!
 
Do you have an Azure account? If so, Azure functions maybe all you need.

On the other hand, just jump straight to ASP.NET's WebApi is all you need to implement some web services. You don't really need a to implement a web based UI.

If you are a complete beginner with server programming, I would advice you to exercise a lot of caution as you implement stuff. Yes, your game data may not be any real value and it doesn't matter if some manages to hack in, but some one could use your web server as a foothold for something else. Perhaps you store your players email and passwords. Hackers can now try using those emails for spam, and also try those email and password combos to break into other things like Ring cameras. Perhaps you left your database password in the open and you just re-use the same password for your other accounts. Or hackers may start hosting their phishing pages on your web server.

This is not meant to scare you from server development. It's an area with lots of opportunities for fun and profit. Just exercise caution as you explore. I'm quite sure people on this forum will be more than generous to review your design/code and give advise.

Good luck with your game!

Thanks a lot for all the information. I've tried to create a very simple game server using .net HttpServer, it worked to some extent for a small number of concurrency, but I don't think it's the best way to do it and found it difficult for me to make improvements, and the only security issue I was aware of was the SQL injection, which is done mainly just for stopping the DB from functioning, thus not as dangerous as what you described. Later on, I was thinking about enabling the players to login with 3rd party account services, hoping to protect their account info by not asking for the actual user-name and pw. But anyway like you said, for now, the server data are not valuable, so I'll focus more on developing the features needed for the game to run, but surely I'll proceed with caution when it comes to security issues during service.
And after reading articles, replies and taking to experienced guys, it seems, as you suggested, going with ASP.net core (3.0) web api can be the best solution for me to get started at the moment, and I've already gethered some tutorials and source codes to learn ? I'll come back later with more specific questions, and get futher help from people here.
 
Back
Top Bottom