Example #1
0
        public void GetSizeInvetario(int userid)
        {
            db.DBConnect data  = new db.DBConnect();
            DataSet      Banco = new DataSet();

            data.Exec(Banco, "SELECT   `tamanhodoinventario`  FROM `contas` WHERE `userid` = '" + userid + "'");
            if (Banco.Tables[0].Rows.Count == 0)
            {
                tamanhoinventario = Ultilize.StrToInt(Banco.Tables[0].Rows[0][0].ToString());
            }
            else
            {
                tamanhoinventario = 500;
            }
        }
Example #2
0
        public void GetGP(int userid)
        {
            db.DBConnect data  = new db.DBConnect();
            DataSet      Banco = new DataSet();

            data.Exec(Banco, "SELECT   `GP`  FROM `GamePoints` WHERE `userid` = '" + userid + "'");
            if (Banco.Tables[0].Rows.Count > 0)
            {
                gamePoint = Ultilize.StrToInt(Banco.Tables[0].Rows[0][0].ToString());
            }
            else
            {
                gamePoint = 0;
            }
        }
Example #3
0
        public void GetVidaBonus(int userid)
        {
            db.DBConnect data  = new db.DBConnect();
            DataSet      Banco = new DataSet();

            data.Exec(Banco, "SELECT   `quantidade`  FROM `vidabonus` WHERE `userid` = '" + userid + "'");
            if (Banco.Tables[0].Rows.Count > 0)
            {
                bonusvida = Ultilize.StrToInt(Banco.Tables[0].Rows[0][0].ToString());
            }
            else
            {
                bonusvida = 500;
            }
        }
Example #4
0
        private void GetInventoryFromDB(int userid)
        {
            GameServer.db.DBConnect data = new db.DBConnect();
            DataSet Banco = new DataSet();

            data.Exec(Banco, "SELECT   `itemuid`,  `itemid`,  `itemtipo`,  `quantidade`  FROM `inventario` WHERE `userid` = '" + userid + "'");

            SetLength(Banco.Tables[0].Rows.Count);

            for (Int32 a = 0; a < lenInvetario.Length; a++)
            {
                SetLength(Banco.Tables[0].Rows.Count + 1);
                lenInvetario[a].itemuid    = Ultilize.StrToInt(Banco.Tables[0].Rows[a][0].ToString());
                lenInvetario[a].itemid     = Ultilize.StrToInt(Banco.Tables[0].Rows[a][1].ToString());
                lenInvetario[a].itemtype   = Ultilize.StrToInt(Banco.Tables[0].Rows[a][2].ToString());
                lenInvetario[a].quantidade = Ultilize.StrToInt(Banco.Tables[0].Rows[a][3].ToString());
            }
        }
        public void GetCharactersFromDB(int userid)
        {
            GameServer.db.DBConnect data = new db.DBConnect();
            DataSet Banco  = new DataSet();
            DataSet Banco0 = new DataSet();
            DataSet Banco1 = new DataSet();

            data.Exec(Banco, "SELECT   `personagemid`,  `classe`,  `experiencia`,  `nivel`,  `mascote`,  `vitoria`,  `derrota` FROM  `personagems` WHERE `userid` ='" + userid + "'");

            SetLength(Banco.Tables[0].Rows.Count);

            for (Int32 gg = 0; gg < getLength(); gg++)
            {
                personagems[gg].personagemid = Ultilize.StrToInt(Banco.Tables[0].Rows[gg][0].ToString());
                personagems[gg].classe       = Ultilize.StrToInt(Banco.Tables[0].Rows[gg][1].ToString());
                personagems[gg].experiencia  = Ultilize.StrToInt(Banco.Tables[0].Rows[gg][2].ToString());
                personagems[gg].nivel        = Ultilize.StrToInt(Banco.Tables[0].Rows[gg][3].ToString());
                personagems[gg].mascote      = Ultilize.StrToInt(Banco.Tables[0].Rows[gg][4].ToString());
                personagems[gg].vitoria      = Ultilize.StrToInt(Banco.Tables[0].Rows[gg][5].ToString());
                personagems[gg].derrota      = Ultilize.StrToInt(Banco.Tables[0].Rows[gg][6].ToString());

                data.Exec(Banco1, "SELECT   `SP` FROM  `spleft` WHERE `userid` ='" + userid + "' AND `personagemid`='" + personagems[gg].personagemid + "'");
                if (Banco1.Tables[0].Rows.Count > 0)
                {
                    personagems[gg].splef = Ultilize.StrToInt(Banco1.Tables[0].Rows[0][0].ToString());
                }
                else
                {
                    personagems[gg].splef = 0;
                }

                data.Exec(Banco0, "SELECT   `itemid`,  `itemuid` FROM  `equipamentos` WHERE `personagemid` = '" + personagems[gg].personagemid + "' AND `userid` = '" + userid + "'");
                SetLengthEquip(Banco0.Tables[0].Rows.Count, gg);
                for (Int32 gg2 = 0; gg2 < getLengthEquip(gg); gg2++)
                {
                    personagems[gg].equipamentos[gg2].itemid  = Ultilize.StrToInt(Banco0.Tables[0].Rows[0][0].ToString());
                    personagems[gg].equipamentos[gg2].itemuid = Ultilize.StrToInt(Banco0.Tables[0].Rows[0][1].ToString());
                }
            }
        }