Store&receive ingame currency value on server

Hey guys,

so let’s say I want to implement an ingame store where you can unlock e.g. weapons (currency is earned for every game played), what’s the best practice to get and store the data from a remote database?
Send a POST request to my webserver and return the values after a token is supplied which authenticates the user?

Are there any resources for something like this (not speaking of REST calls in C++, but more about how UE4 multiplayer games actually implement persistent data, like the mobas which are made with UE4)? Also the game sever would need to verify that said player is allowed to use the weapon, character or whatever ingame.

Yes you are correct. The best way (IMO) is to have usually a RESTful services Website (for example Microsoft WebAPI) but of course, simple PHP would be good enough. I’m currently figuring out that myself now too and I can recommend this: link

The code for creating a simple POST with php webserver is easy to understand, if you have trouble ask me I’ll explain.

If I manage to get things working I’ll notify you :slight_smile:

EDIT 1: Oh I also forgot to mention VaRest plugin. Does the same thing just via Blueprints.

Thanks. I guess I will implement my REST api with nodejs and javascript, since thats more appealing for me than “ugly” (sorry :D) PHP.
Also thank you for the links, appreciate it :slight_smile:

Yeah I dislike PHP too, after I learned about C# WebAPI hehe. Good choice on NodeJS, that was my first though too. If you find a solution before I do, please post it.

Okay I managed to get it working properly.

I made a tutorial click

Short node: For Data handling, better use a “UObject” child and not an “AActor”. Actors are way too much for the stuff you doing. :stuck_out_tongue:

Yeah I don’t say it was the best solution, but it has the code to make it working :smiley:

I’m just unsure how to use those UObject inside the editor. First things that come to my mind are:
Create a pointer to that UObject class that holds all the HTTP handling and initialize it in the constructor

Create a C++ Component and use it wherever I want?

Yeah well a component would be another solution again. You could do that too.

And yes, you would simply create the UObject in your Blueprints (or in C++) and i mean literally “CREATE” it with
the CreateUObject stuff, and save it, so you can use the variables from it.

But the Component is also a good solution (: Maybe an even better one.