Esempio n. 1
0
        public override void Start()
        {
            base.Start();

            var loginManagerGameObject = Instantiate(loginManagerPrefab);

            loginManager = loginManagerGameObject.GetComponent <LoginManager>();
            loginManager.UpdateApiAddress(loginServerAddress, NetworkServer.localConnection, SpawnPlayerWithLoginServer);
            loginManager.ApiHeartbeat(ConfirmLoginServer);
        }
Esempio n. 2
0
        public override void OnLoginDataMessage(NetworkConnection conn, LoginServerMessage message)
        {
            if (message.serverAddress == noServerConstant)
            {
                SpawnPlayerWithoutLoginServer(conn);
                return;
            }

            loginManager.UpdateApiAddress(message.serverAddress, conn, SpawnPlayerWithLoginServer);
            loginManager.ApiHeartbeat(BeginLoginProcedure);
        }
Esempio n. 3
0
        private bool hasLoginServer; // whether the login server is found and alive

        public override void Start()
        {
            base.Start();

            // TODO: Should this be called everywhere?

            // Set the defaults for the login manager
            var loginManagerGameObject = Instantiate(loginManagerPrefab);
            loginManager = loginManagerGameObject.GetComponent<LoginManager>();
            loginManager.UpdateApiAddress(loginServerAddress, character => SpawnPlayerWithLoginServer(NetworkServer.localConnection, character));
            loginManager.ApiHeartbeat(ConfirmLoginServer);
        }
Esempio n. 4
0
        /**
         * The client recieves the message informing them of the Login Server,
         * Uses this to start the player's character select process
         */
        private void OnLoginDataMessage(NetworkConnection conn, LoginServerMessage message)
        {
            if (message.serverAddress == null) {
                SpawnPlayerWithoutLoginServer(conn);
                return;
            }

            // Update our login server to match theirs. Attempt to connect.
            // If successful, hand over control to the LoginManager, telling it to call SpawnPlayerWithLoginServer when
            // the user has chosen their player.
            loginManager.UpdateApiAddress(message.serverAddress, character => SpawnPlayerWithLoginServer(conn, character));
            loginManager.ApiHeartbeat(BeginLoginProcedure);
        }