Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,23 @@ public bool IsController(PlayerID player, bool ownerHasAuthority, bool asServer)
return asServer;
}

/// <summary>
/// Returns the controller of this object.
/// If the object has a *connected* owner, it will return the owner.
/// If the object doesn't have an owner, it will return the Server.
/// </summary>
/// <param name="ownerHasAuthority">Should owner be controller or is it server only</param>
/// <returns>The controller of this object</returns>

public PlayerID? GetController(bool ownerHasAuthority)
{
if (!ownerHasAuthority) return PlayerID.Server;

if (!hasConnectedOwner) return PlayerID.Server;

return owner;
}

public bool hasConnectedOwner
{
get
Expand Down