Owned by the serverplayer...

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Shiit

Shiit
Dec 19, 2000
168
0
0
I have function A in an info class that's owned by a player, that is replicated from the client to the server, called in simulated PostNetBeginPlay if "Role<ROLE_Authority", and called in PostBeginPlay if it's a Standalone game, but it never gets called if someone is playing on the server machine, because then, the ROLE is never below authority, (It must only be called once for each player, and it ís only called for one player: the only one for which the class it is relevant: the one it's owned by). So, how do I find out whether a class is owned by the one player that is not a client? (And thusly, has ROLE==Authority) So how do I call this function only for that player, without calling the function for all other clients (which should only be done BY the client)?
 

Shiit

Shiit
Dec 19, 2000
168
0
0
Hmm... Thanks for replying, but what you just said seems a bit like the opposite of what Mongo said in his Replication De-obfuscation.
He says "bNetOwner: true if the player we are replicating to owns this actor directly.", (Tim Sweeny's UNA document says the same) and I don't think I can use that to find out whether there isn't a client that owns the actor.

Gotcha! I think I have the answer! The server-side player is the only player that has his remoterole set to ROLE_Simulatedproxy instead of ROLE_Autonomousproxy! Yay!
 
Last edited:

Mychaeel

New Member
Hmm... I just tested it out. You (and Mongo) are right, bNetOwner isn't set on listen servers. The only other option that comes into my mind is checking whether the actor's PlayerPawn owner has a Viewport, something along the lines of the following:
Code:
if (PlayerPawn(Owner) != None && Viewport(PlayerPawn(Owner).Player) != None) ...
 

Shiit

Shiit
Dec 19, 2000
168
0
0
I think I have the answer. (seen in my previous post now) Now I just have to figure out a way to find out whether it works. ;)
Thanks for your help anyway. Even though your first answer didn't directly help me (your second solution probably does work, but I don't really have need to find out now :)), it did give me a large boost in the right direction! :)