Niv
Niv
NNormal
Created by Niv on 7/7/2024 in #🤝ask-a-question
is the ReltimeView property 'preventOwnershipTakeover' synched between the clients?
From all my validations, the client setting 'prevent' to false IS the owner. and locally I can observe that flag is indeed cleared from that point on (the server doesn't dispute that). The other client, seems to get the flag being raised - but never resets that flag unless the owner calls 'ClearOwnership').. BTW: my reason for event attempting such workaround were these lines in your (decompiled) code:
/// <summary>
/// If true, the model owner must clear ownership before another client can request it.
/// </summary>
public bool preventOwnershipTakeover
{
get => this.GetLifetimeFlag(MetaModel.LifetimeFlags.PreventOwnershipTakeover);
set => this.SetLifetimeFlag(MetaModel.LifetimeFlags.PreventOwnershipTakeover, value);
}
/// <summary>
/// If true, the model owner must clear ownership before another client can request it.
/// </summary>
public bool preventOwnershipTakeover
{
get => this.GetLifetimeFlag(MetaModel.LifetimeFlags.PreventOwnershipTakeover);
set => this.SetLifetimeFlag(MetaModel.LifetimeFlags.PreventOwnershipTakeover, value);
}
Again, to show my argument I would need to demonstrate this in a lean repro - which would sidetrack me too much. The workaround miraculously works for me, so I'll stick to it (I'm only prototyping right now) and circle back to this when I have more time.
18 replies
NNormal
Created by Niv on 7/7/2024 in #🤝ask-a-question
is the ReltimeView property 'preventOwnershipTakeover' synched between the clients?
the owner himself is setting this back to false. The use case is say there is some physical game prop. When it is held by a player - that player takes ownership and prevents other from taking ownership (say by touching it). When he throws/lets go of the prop, I want him to stay the owner (someone needs to be, to drive its physics) but should enable others to take ownership should they interact with it. I have worked around it by doing this sequence of calls (all in 1 frame, I'm pretty surprised this worked): _rootView.preventOwnershipTakeover = false; _rootView.ClearOwnership(); _rootView.RequestOwnership(); Seems a bit weird to have to 'Clear Ownership' in order to reset the prevent flag, only to take ownership back. In any case, the side affect that two clients looking at the same root view observe other values of 'prevent...' seem flat out wrong
18 replies
NNormal
Created by Niv on 7/7/2024 in #🤝ask-a-question
is the ReltimeView property 'preventOwnershipTakeover' synched between the clients?
Hey Max, after some investigation I'm seeing something different. I have a rootView where I toggle 'preventOwnershipTakeover' to true and then to false. I print on that client (the owner) and another client that value of this boolean to the console. While on the owner side it seems the bool retains its FALSE value, the other client keeps seeing TRUE. Moreover - if I try to request ownership from the other client it seems to only toggle for one frame and then resets to the orignal owner - indicating that the server also 'thinks' ownership takeover is still prevented. Any clue what I'm doing wrong? I don't have a clean repro (our project is very big), I can probably make one but before I do that I thought to ask maybe you have a suggestion for things to look into ... Thanks
18 replies
NNormal
Created by Niv on 7/17/2024 in #🤝ask-a-question
Is there a callback when *any* property of a model changes?
Thanks guys - so currently I am using: [RealtimeCallback(RealtimeModelEvent.OnDidReadProperties)] As I understand this is called after the properties have been updated from a remote owner. Which means properties have their new values, and this will NOT trigger when doing local model updates - right?
14 replies
NNormal
Created by Niv on 7/17/2024 in #🤝ask-a-question
Is there a callback when *any* property of a model changes?
not the best answer but did generally point me to the right direction 🤷‍♂️
14 replies
NNormal
Created by Niv on 7/7/2024 in #🤝ask-a-question
is the ReltimeView property 'preventOwnershipTakeover' synched between the clients?
where specifically does the documentation mention that 'preventOwnershipTakeover' is synchronized?
18 replies