Example #1
0
        /// <summary>
        /// Client wants to set a secondary password.
        /// </summary>
        /// <param name="packet"></param>
        void OnCreateSecondaryPassword(PacketReader packet)
        {
            if (!IsAuthenticated)
            {
                return;
            }

            string accountName = packet.ReadUTF16();
            string password    = packet.ReadUTF16Safe();

            int result = 1;

            if (Account.SecondaryPassword == null)
            {
                Account.SecondaryPassword = password;

                Server.Database.SetSecondaryPassword(accountName, password);

                result = 0;
            }

            Send(PacketGenerator.SecondaryPasswordCreated(result));
        }