Exemplo n.º 1
0
        public void Load()
        {
            string query = "SELECT script_extras_general.SpawnMap, script_extras_general.SpawnX, script_extras_general.SpawnY, " +
                           "script_extras_general.DungeonID, script_extras_general.DungeonX, script_extras_general.DungeonY, " +
                           "script_extras_general.TurnsTaken, script_extras_general.EvolutionActive, script_extras_general.Permamuted, " +
                           "script_extras_general.HousingCenterMap, script_extras_general.HousingCenterX, script_extras_general.HousingCenterY, " +
                           "script_extras_general.DungeonMaxX, script_extras_general.DungeonMaxY, script_extras_general.DungeonSeed, " +
                           "script_extras_general.PlazaEntranceMap, script_extras_general.PlazaEntranceX, script_extras_general.PlazaEntranceY " +
                           "FROM script_extras_general " +
                           "WHERE script_extras_general.CharID = \'" + Client.Player.CharID + "\'";

            DataColumnCollection row = null;

            using (DatabaseConnection dbConnection = new DatabaseConnection(DatabaseID.Players)) {
                row = dbConnection.Database.RetrieveRow(query);
            }
            if (row != null)
            {
                SpawnMap  = row["SpawnMap"].ValueString;
                SpawnX    = row["SpawnX"].ValueString.ToInt();
                SpawnY    = row["SpawnY"].ValueString.ToInt();
                DungeonID = row["DungeonID"].ValueString.ToInt();
                DungeonX  = row["DungeonX"].ValueString.ToInt();
                DungeonY  = row["DungeonY"].ValueString.ToInt();
                //TurnsTaken = row["TurnsTaken"].ValueString.ToInt();
                EvolutionActive  = row["EvolutionActive"].ValueString.ToBool();
                PermaMuted       = row["Permamuted"].ValueString.ToBool();
                HousingCenterMap = row["HousingCenterMap"].ValueString;
                HousingCenterX   = row["HousingCenterX"].ValueString.ToInt();
                HousingCenterY   = row["HousingCenterY"].ValueString.ToInt();
                DungeonMaxX      = row["DungeonMaxX"].ValueString.ToInt();
                DungeonMaxY      = row["DungeonMaxY"].ValueString.ToInt();
                DungeonSeed      = row["DungeonSeed"].ValueString.ToInt();

                PlazaEntranceMap = row["PlazaEntranceMap"].ValueString;
                PlazaEntranceX   = row["PlazaEntranceX"].ValueString.ToInt();
                PlazaEntranceY   = row["PlazaEntranceY"].ValueString.ToInt();
            }
            DungeonGenerated = false;
            DungeonMap       = new PitchBlackAbyss.Room[1, 1];
        }
Exemplo n.º 2
0
        public void Load()
        {
            string query = "SELECT script_extras_general.SpawnMap, script_extras_general.SpawnX, script_extras_general.SpawnY, " +
                "script_extras_general.DungeonID, script_extras_general.DungeonX, script_extras_general.DungeonY, " +
                "script_extras_general.TurnsTaken, script_extras_general.EvolutionActive, script_extras_general.Permamuted, " +
                "script_extras_general.HousingCenterMap, script_extras_general.HousingCenterX, script_extras_general.HousingCenterY, " +
                "script_extras_general.DungeonMaxX, script_extras_general.DungeonMaxY, script_extras_general.DungeonSeed, " +
                "script_extras_general.PlazaEntranceMap, script_extras_general.PlazaEntranceX, script_extras_general.PlazaEntranceY " +
                "FROM script_extras_general " +
                "WHERE script_extras_general.CharID = \'" + Client.Player.CharID + "\'";

            DataColumnCollection row = null;
            using (DatabaseConnection dbConnection = new DatabaseConnection(DatabaseID.Players)) {
                row = dbConnection.Database.RetrieveRow(query);
            }
            if (row != null) {
                SpawnMap = row["SpawnMap"].ValueString;
                SpawnX = row["SpawnX"].ValueString.ToInt();
                SpawnY = row["SpawnY"].ValueString.ToInt();
                DungeonID = row["DungeonID"].ValueString.ToInt();
                DungeonX = row["DungeonX"].ValueString.ToInt();
                DungeonY = row["DungeonY"].ValueString.ToInt();
                //TurnsTaken = row["TurnsTaken"].ValueString.ToInt();
                EvolutionActive = row["EvolutionActive"].ValueString.ToBool();
                PermaMuted = row["Permamuted"].ValueString.ToBool();
                HousingCenterMap = row["HousingCenterMap"].ValueString;
                HousingCenterX = row["HousingCenterX"].ValueString.ToInt();
                HousingCenterY = row["HousingCenterY"].ValueString.ToInt();
                DungeonMaxX = row["DungeonMaxX"].ValueString.ToInt();
                DungeonMaxY = row["DungeonMaxY"].ValueString.ToInt();
                DungeonSeed = row["DungeonSeed"].ValueString.ToInt();

                PlazaEntranceMap = row["PlazaEntranceMap"].ValueString;
                PlazaEntranceX = row["PlazaEntranceX"].ValueString.ToInt();
                PlazaEntranceY = row["PlazaEntranceY"].ValueString.ToInt();
            }
            DungeonGenerated = false;
            DungeonMap = new PitchBlackAbyss.Room[1,1];
        }