Unrecognized type 'FSocket'
Hello everyone, looks like I need your help once again =)
I'm not really sure if I'm doing thing in the right way, so here is what I'm trying to achieve;
I'm making an online game, where users must login first, so I'll be abe to show em their statistics, bought items and so on. For this I have made so called "QueryServer" which is working with database, and managing UE4 dedicated serrvers, by launching instances for each game session.
So, simplified "login screen" -> "game session" process looks like so:
I have wrote some nice code to communicate with the QueryServer, and it's works like a charm. But when broke the code in methods, and added these to my BlueprintLibrary class, the compiler sad this: "Unrecognized type 'FSocket' - type must be a UCLASS, USTRUCT or UENUM". Is there any way to use methods with FSocket* type in blueprints?
If no, what is the best place to define a "Global" variable, in C++ project, so i can store the connection there? I mean a place, so i can define the variable once, and it will be defined until user close the game client...
Thank you for reading :)
asked Oct 25 '15 at 01:05 PM in C++ Programming
FSocket is non-UObject class and reflection system does not support those, so you can't use it with UPROPERTY() or UFUNCTION() (only in function arguments and return value, in function you can use anything you want). So either you need to create UObject wrapper for FSocket (USocket?) or or deal with FSocket diffrently just in the way that UHT won't see it.
It's not recommended to use global variables, but in C++ it's very simple, you just dealere one outside the class. UE4 it self got some global variables for main components (like GEngine for main UEngine pointer or GbIsEditor) and as you notice they have "G" prefix in name. you can also use static variables in classes (same as static function), they also work like global variable, if you really need global varable use it this way
answered Oct 25 '15 at 04:52 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here