Authoritative Server Problem

atmuc

Member
I port PUN add on to Mirror Multiplayer framework. Both PUN and UCC multiplayer part based on client authoritative system. I want to make server authoritative system. How can I make it server authoritative? For example Inventory base has the following code. It calls LoadDefaultLoadout from the client. I will just send gamepad inputs to the server and sync all from server to client.

Code:
#if ULTIMATE_CHARACTER_CONTROLLER_MULTIPLAYER
            if (m_NetworkInfo == null || m_NetworkInfo.IsLocalPlayer()) {
                if (m_NetworkInfo != null) {
                    // Load the default loadout on the network first to ensure it is received before any equip events.
                    m_NetworkCharacter.LoadDefaultLoadout();
                }
#endif
 
Last edited:
IsServerAuthoritative should be used in UCC code

Code:
public interface INetworkInfo
    {
        /// <summary>
        /// Is the networking implementation server authoritative?
        /// </summary>
        /// <returns>True if the network transform is server authoritative.</returns>
        bool IsServerAuthoritative();
 
Right now the networking implementation is built for a client authoritative solution so there will likely need to be some modifications in order to fully support a server authoritative implementation. I don't have the steps in order to make that change but would eventually like to support it. If you get a working Mirror integration and want to send me the changes required I can definitely incorporate that into the base.
 
Hi Justin, As I see Opsive did a very good job of both integrating Pun and make UCC compatible with the client authoritative network multiplayer game. I hesitated to update the UCC code Because missing UCC updates. It is great to hear that you can incorporate that into the base. so every user can use it for server authoritative infrastructure. I will PM you to get your email address to share my changes when it is ready.

I ported PUN code as much as possible. Now I can use UCC with Mirror. I just tested movement. On the client-side look source is based on the camera script. on the server side local look source cause a rotation problem when using Third Person Adventure Movement. When I solve this, I will test each component one by one (health, pickable, moving platform etc..)
 
Top