示例#1
0
        public void CMD_login(Client client, string usr, string pass)
        {
            using (var db = new LiteDatabase(@"./db.db"))
            {
                var    coll   = db.GetCollection <player>("players");
                player result = coll.FindOne(x => x.usr == usr);
                result.ip = client.Address;
                if (result == null)
                {
                    client.SendChatMessage("~r~ šis vartotojas neegzistuoja !");
                }
                bool pass_result = result.Cpass(pass);
                if (!pass_result)
                {
                    client.SendChatMessage("~r~ neteisingas pass");

                    return;
                }
                player playerinfo = new player(usr, pass, client.Address, 0, result.owner, 0, 0, 1);

                client.SetData("ID", result._id);
                client.SetData("admin", result.admin);
                client.SetData("owner", result.owner);
                client.SetData("ip", result.ip);
                client.SetData("job", result.job);


                client.SendNotification($"{result._id}Prisijungimas pavyko!! sveikas {result.usr}");
            }
        }