Download

Lobby Server and MySQL Connection

I’m attempting to write a lobby-esque server using C++ and UE4’s modules. So far I have a UE4 client connecting and now I want to pull data from a DB. I’ve been pondering how to best implement MySQL into this system while remaining secure. Usually discussing it with my mini-Vader and Batman clears it up but tonight the rubber ducky effect is not working.

I should also mention I’ve already written something similar in NodeJS however I’d much rather keep my servers in the same language for my own sanity.

So the way I see it my options are as follows, but I’m not limiting myself to any of these.

  1. Drop C++/UE4 version and stick with NodeJS
  2. Use the MySQL C++ library and deal with the fact that it’s blocking. This doesn’t really seem like an option
  3. Use a third party MySQL async library. My problem here is not knowing whether Windows/OSX/Linux would be supported.
  4. Utilize a RESTful API to load player data into the Lobby. I’m leaning this way only because it’s the option that doesn’t require me to add any kind of extra library to UE4, while keeping all of my code in one place.

All thoughts and suggestions are encouraged.

Option #4. Keep concerns separated.

Agreed with #4.

I’m not too familiar with REST so I would just spawn a thread and block inside it. Use whatever works for you.

You could also look at raknet, they have a lobby system and now it’s open source