[Release] $AddAccount command

12/14/2019 21:29 Ritahxyel#1
Tired of making accounts by hand and you don't want to make a site? No problem here is an order that I drop directly from the NosWorld source.

Code:
using OpenNos.Core;
using OpenNos.Domain;

namespace OpenNos.GameObject.CommandPackets
{
    [PacketHeader("$AddAccount", PassNonParseablePacket = true, Authorities = new AuthorityType[] { AuthorityType.Owner })]
    public class AddAccountPacket : PacketDefinition
    {
        #region Properties

        [PacketIndex(0)]
        public string Name { get; set; }

        [PacketIndex(1)]
        public string Password { get; set; }

        [PacketIndex(2)]
        public int Authority { get; set; }

        public static string ReturnHelp() => "$AddAccount <Name> <Password> <Authority>";

        #endregion
    }
}
Code:
     /// <summary>
        /// $AddAccount Command
        /// </summary>
        /// <param name="addAccountPacket"></param>
        public void AddAccount(AddAccountPacket addAccountPacket)
        {
            if (addAccountPacket != null)
            {
                AuthorityType Autoridad = AuthorityType.Banned;
                switch (addAccountPacket.Authority)
                {
                    case 0:
                        Autoridad = AuthorityType.User;
                        break;
                    case 20:
                        Autoridad = AuthorityType.GS;
                        break;
                    case 30:
                        Autoridad = AuthorityType.TMOD;
                        break;
                    case 31:
                        Autoridad = AuthorityType.MOD;
                        break;
                    case 32:
                        Autoridad = AuthorityType.SMOD;
                        break;
                    case 50:
                        Autoridad = AuthorityType.TGM;
                        break;
                    case 51:
                        Autoridad = AuthorityType.GM;
                        break;
                    case 60:
                        Autoridad = AuthorityType.TM;
                        break;
                    case 80:
                        Autoridad = AuthorityType.DEV;
                        break;
                    case 100:
                        Autoridad = AuthorityType.Administrator;
                        break;
                    case 150:
                        Autoridad = AuthorityType.CoOwn;
                        break;
                    case 666:
                        Autoridad = AuthorityType.Owner;
                        break;
                }
                AccountDTO account = new AccountDTO
                {
                    Authority = Autoridad,
                    Name = addAccountPacket.Name,
                    Password = CryptographyBase.Sha512(addAccountPacket.Password)
                };
                DAOFactory.AccountDAO.InsertOrUpdate(ref account);
            }
            else
            {
                Session.SendPacket(Session.Character.GenerateSay(AddAccountPacket.ReturnHelp(), 10));
            }
        }
To avoid any misunderstanding. No I am not the creator of this order.

Good game everyone !
12/14/2019 23:22 InnoTx#2
Quote:
Originally Posted by Ritahxyel View Post
Tired of making accounts by hand and you don't want to make a site? No problem here is an order that I drop directly from the NosWorld source.

Code:
using OpenNos.Core;
using OpenNos.Domain;

namespace OpenNos.GameObject.CommandPackets
{
    [PacketHeader("$AddAccount", PassNonParseablePacket = true, Authorities = new AuthorityType[] { AuthorityType.Owner })]
    public class AddAccountPacket : PacketDefinition
    {
        #region Properties

        [PacketIndex(0)]
        public string Name { get; set; }

        [PacketIndex(1)]
        public string Password { get; set; }

        [PacketIndex(2)]
        public int Authority { get; set; }

        public static string ReturnHelp() => "$AddAccount <Name> <Password> <Authority>";

        #endregion
    }
}
Code:
     /// <summary>
        /// $AddAccount Command
        /// </summary>
        /// <param name="addAccountPacket"></param>
        public void AddAccount(AddAccountPacket addAccountPacket)
        {
            if (addAccountPacket != null)
            {
                AuthorityType Autoridad = AuthorityType.Banned;
                switch (addAccountPacket.Authority)
                {
                    case 0:
                        Autoridad = AuthorityType.User;
                        break;
                    case 20:
                        Autoridad = AuthorityType.GS;
                        break;
                    case 30:
                        Autoridad = AuthorityType.TMOD;
                        break;
                    case 31:
                        Autoridad = AuthorityType.MOD;
                        break;
                    case 32:
                        Autoridad = AuthorityType.SMOD;
                        break;
                    case 50:
                        Autoridad = AuthorityType.TGM;
                        break;
                    case 51:
                        Autoridad = AuthorityType.GM;
                        break;
                    case 60:
                        Autoridad = AuthorityType.TM;
                        break;
                    case 80:
                        Autoridad = AuthorityType.DEV;
                        break;
                    case 100:
                        Autoridad = AuthorityType.Administrator;
                        break;
                    case 150:
                        Autoridad = AuthorityType.CoOwn;
                        break;
                    case 666:
                        Autoridad = AuthorityType.Owner;
                        break;
                }
                AccountDTO account = new AccountDTO
                {
                    Authority = Autoridad,
                    Name = addAccountPacket.Name,
                    Password = CryptographyBase.Sha512(addAccountPacket.Password)
                };
                DAOFactory.AccountDAO.InsertOrUpdate(ref account);
            }
            else
            {
                Session.SendPacket(Session.Character.GenerateSay(AddAccountPacket.ReturnHelp(), 10));
            }
        }
To avoid any misunderstanding. No I am not the creator of this order.

Good game everyone !

no one will need this first of all it is so easy to make an account from DB and 2. you can just Create an account by Website ??? for what will someone need this xDD


Nothing against you but yeah ... xDDD
12/14/2019 23:27 Ritahxyel#3
Simply to create an account on the db you must create the hash 512.
with this command, you just have to do $ AddAccount Username password Authority and the hash automatically creates itself on the database. so no need to go to a hashing site every time to create an account. Which is much more practical and it is not necessarily given to everyone to know how to make a site those who simply do not want create the website because they do not know how to make captcha. He can use this command. In addition, it avoids database hack problems if your website is not protected
12/14/2019 23:54 Roxeez#4
And what about starting being a bit profesionnal and start doing things properly ?

If nobody in your team can create a basic registration form, you shouldn't even think about running a private server.
12/15/2019 00:18 Ritahxyel#5
be professional for a private server on Nostale it tells me nothing and I never talk about myself I released this order for others
12/15/2019 06:39 0Lucifer0#6
Worst idea ever... their is already too much places where nostale send plaintext password... why adding another one...
12/19/2019 11:46 Nagisa Shiota#7
I am the creator for the NosWorld source and Cucalon source, but is a simple InsertOrUpdate ����

And isn't tested
12/19/2019 13:30 MANUEL PERES#8
Quote:
Originally Posted by Nagisa Shiota View Post
I am the creator for the NosWorld source and Cucalon source, but is a simple InsertOrUpdate ����

And isn't tested
[Only registered and activated users can see links. Click Here To Register...] :lul:

You should not say that the source is yours because the source of the opennos has many contributions that is to say it is not yours.
12/20/2019 13:54 Nagisa Shiota#9
Quote:
Originally Posted by MANUEL PERES View Post
[Only registered and activated users can see links. Click Here To Register...] :lul:

You should not say that the source is yours because the source of the opennos has many contributions that is to say it is not yours.
I dont say that this source is mine, only i say that this code is developed but me, and is not tested xd. If you read, this say "for" this sources :)