x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Ownership and net relevancy - Rejected requests

If I read the documentation right, if an actor is owned by Player Controller, then the client that this player controller is assigned to can call server functions on the actor.

It works in most cases. If I have a blueprint that is owned by a Player Controller directly, everything is fine. However, if I have a ownership tree it breaks and gives a warning:

LogRep:Warning: Rejected unwanted function XXX

I've found this topic:

https://answers.unrealengine.com/questions/29001/lognetwarning-rejected-unwanted-function-servermov.html

Unfortunately none of the points seem to be my case. I only set the owner once, at the start. No matter how many times I try the result is the same, regardless of the time from start. Additionally, even on LogRep and LogNet set to VeryVerbose there is no additional information as to any reason of such behavior (I made sure I really well parsed that log file). I am trying to call it on a blueprint of a character. That's how it looks:

  1. Character's owner is Squad

  2. Squad's owner is PlayerState

  3. PlayerState's owner is PlayerController

In my case, if I try to call an RPC from the Character, I get the above warning and nothing works. However, if I only move the event I am calling to the Player Controller itself, everything works fine. I was hoping I could keep all the characters functionality inside character BP. Unfortunately, I have to re-route things through PC. If it helps, character, squad, player state and controller are all blueprints, not native classes.

To make sure the situation is clear: Client clicks something. Client's input is handled on the client and the result of that input sooner or later brings me to the task of moving the character. Since the character's blackboard is present only on the Host, I have to send the request to the host. And this is where it fails. The call gets rejected, no blackboard values are set and nobody moves.

The warning is being printed on the host log, not the client's, which means that the request was sent and received.

It seems that when the package is received, there's an IF statement (I forgot the actual lines, but I believe it goes something like this):

IF (!IsServer || IsNetOwner)

This one fails, because the Host does not own the character (the client who can control it does) and the packet is received on the host. Fail means reject. How am I supposed to do that then?

What is even more puzzling, is that my Building class has an owner of PlayerState, which means it's only one branch shorter (the ownership tree), yet Building RPC's work (by work I mean that I can call an RPC from the client that is fired on the host in the same blueprint I called from without any rerouting through PC). Maybe I've found a bug, or maybe I just don't understand something. I'd gladly accept any help.

Product Version: UE 4.9
Tags:
more ▼

asked Jan 08 '16 at 02:42 PM in Blueprint Scripting

avatar image

vipeout
374 13 10 25

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Are you spawning the Character on the client? The only reason I can think of here is that the character, with the same net guid, needs to exist on the server, so the server needs to have spawned it and had it replicate to the clients. It seems unlikely you'd be using SpawnActor on the client, but you never know...

more ▼

answered Jan 08 '16 at 03:53 PM

avatar image

TTaM
1.7k 79 28 81

avatar image vipeout Jan 08 '16 at 04:01 PM

I always issue the spawn request to the host. I progress some logic on the client to not force the host to do everything (progress bar for example), but then the building that spawns the character calls server RPC and the server spawns it, sets what needs to be set(including proper owner) and informs client that the unit exists (so it can reduce it's resources by the amount it should only after it has confirmed the spawn).

Both the server and the client have the character, they both see it in the same position and all variables are replicated. If I do the same action on server it works. It is broken only when the client issues the order.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question