Authoritative User
The authoritative user is an automatically designated user, that is the same for all users connected to a session, that can be used to trigger events in multiplayer scenarios where an event may occur for all users, but it is important that only one user sends a synchronizing message. This user can be identified via the INetworkClient
’s AuthoritativeUser
property.
An extension also exists to check if an IUser
is the authoritative user. See the example below:
using ImmerseSDK.Multiplayer;
if (ImmerseMultiplayer.Client.LocalUser.IsAuthoritativeUser())
{
// Do something
}
The authoritative user is assigned automatically. The selected user will always be the user with the lowest Id
value of all users connected to the session.