Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on lemmy.world
rust·Rust Programmingbyilfi

Need help choosing the type of server for my game

Hi fellow Rustaceans. I am new to rust and web stuff and I want to make battleship game with rust as a server side and android as a client. Will Rocket/Actix web be ok if I want to create something like a lobby/room for players, or will sockets be better suited?

View original on lemmy.world
8

2 replies

Unless you need your game to communicate in real time, I say go the web API route.

  • No need to design intricacies of the API's data transport, just pass your data over HTTP.

  • Stick it behind nginx or Apache and get TLS for free, any client HTTP lib will just handle the https.

  • It works everywhere, so if you want a browser version, you can do that, too.

3

I'm not a web / game dev but from what I can remember off Fireship videos you probably want to use some sort of web sockets because the data you're working with are real time right? A quick search on lib.rs and it seems like you would have better chances with Actix-web. They even have examples for websockets.

2

You reached the end

Need help choosing the type of server for my game | Spyke