How am i supposed to deal with server rpc declaration in 4.7 ?
I have a ton of warnings like that one:
warning C4996: Function YagActor::ServerSetBodyTexturePath needs native implementation by virtual void ServerSetBodyTexturePath_Implementation(const FString& NewBodyTexturePath) due to its properties.
Maybe it is obvious and self explanatory but i am not a big guy in c++ and couldn’t find a way to get rid of those.
Could anyone give me an example of how server rpc should be declared since 4.7 ?
Seeing your code would be nice, otherwise it’s hard to tell what you may did wrong. Did your declaration work in 4.6? If not, have you checked this wiki article?
Hmpf, i’,m not that good in C++, but i can’t find examples with “virtual” replicated functions. Would you mind trying to declare it without the “virtual”? :X
Sorry for not responding to your post sooner. Are you seeing the warnings that you mentioned in Visual Studio when you try to build your project? I just tried adding the code you provided above and was able to build a project without any problems in 4.7 Preview 3. Have you run into the same warnings in Preview 3?
Yes, i’m using visual studio + 4.7 preview 3 (launcher version) and still have the warnings so far.
They didn’t exist before, they appeared suddenly in 4.7 (p1, p2, p3) with no change in the code. First time i compiled in 4.7 they appeared, i thought i was the normal “get rid of the warnings in new version” routine, except i couldn’t get rid of them^^
There has been some discussion about it in the forum:
At least one other person is experiencing this problem:
I have one warning per server rpc. Strangely enough, sometimes the same list or warnings repeats itself many times, resulting in a huge number of warning lines, sometimes i get only one copy of the list, that seems random, i couldn’t identify a trigger.
Long story short: no clue, 2 people has the pb as far as i know, but most don’t apparently.
Chances are strong that i am doing something wrong, but i am short of ideas now.
I am still discovering c++ and VS (in french !), so just to be clear for me: if they are the commands associated with F7 (build) and ctrl-alt-F7 (rebuild) then yes, i used both of them extensively many many time (sometimes with some “cleaning the solution”) and the warnings never disappear.
I think I was able to see the warning messages that you described. However, I only get them when I do a Rebuild in Visual Studio. If I do a standard Build, the messages don’t appear. Do you see them even when doing a regular Build?
I made some more careful tests and read about build/rebuild, it now makes more sense.
When i build, i get the warnings from the headers parsed in modified files only. That’s why the number seemed random, it actually is depending on the files i modified before building.
When i rebuild, i get the full list of warnings for each headers in all the project.
If the same header appears many times in the project, its list of warnings will be repeated as much.
So in short, it gives a warning for each rpc it encounters in the headers parsed during builing/rebuilding.
So if you modify only a file that does not include any “declaring-rpcs-header”, you will get no warnings (i did this on a dummy file).
If you modify a file containing somehow (through included headers) server rpcs declaration, i bet you will get the warning even on a simple build.
1>C:\Users\\Documents\Unreal Projects\SpiderTest\Source\SpiderTest\Spider/Spider.h(14)( : warning C4996: Function Spider::ServerMove needs native implementation by virtual void ServerMove_Implementation(FVector Velocity, bool bSweep) due to its properties. Currently ServerMove_Implementation declaration is autogenerated by UHT. Since next release you'll have to provide declaration on your own. Please update your code before upgrading to the next release, otherwise your project will no longer compile.
uced, thank you for working through this issue. I missed out on the 4.7 previews, but ran into these warnings in the release versions. Your forum post and topic here helped resolve the problem quickly (I too was getting fail to compiles for a while with the _Validate not included.