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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Client function called on Authority actor

I migrated my project from 4.7 to 4.8 and some network code stoped working as it was in previous version.

I have this code in my PlayerState class:

 void AYPlayerState::NotifyStartBattle()
 {
     if (Role == ROLE_Authority)
     {
         ClientNotifyStartBattle();
     }
     // ... some initialization code
 }
 
 UFUNCTION(Client, Reliable)
 void ClientNotifyStartBattle();
 
 void AYPlayerState::ClientNotifyStartBattle_Implementation()
 {
     NotifyStartBattle();
 }

NotifyStartBattle is used to setup properties that needed for my battle logic and is called from server-side battle manager actor. Idea is to run this initialization on server (the actor with authority) and on owning client to keep everything in sync. This setup worked fine in 4.7 but in 4.8 it causes recursion which leads to stack overflow and crash. Looks like when I call ClientNotifyStartBattle it does not call a remote client, but just executes right here on the same object, that it should not according to documentation.
If I put AddOnScreenDebugMessage inside ClientNotifyStartBattle_Implementation it prints a message for both server and client, though it should be called only once.

I have tested it only in PIE multiplayer session using single process, because other modes is broken for me (there's couple of questions in AnswerHub already).

So my question - is it a bug or intended behaviour, which was introduced in 4.8?

Product Version: UE 4.8
Tags:
more ▼

asked Jul 04 '15 at 04:53 PM in C++ Programming

avatar image

Druha
26 2 4 10

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

0 answers: sort voted first
Be the first one to answer this question
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