Example #1
0
        private void Import(EventArgs args)
        {
            String query = "SELECT * FROM Regions";

            using (var reader = db.QueryReader(query))
            {
                while (reader.Read())
                {
                    string        name            = reader.Get <string>("Name");
                    int           flags           = reader.Get <int>("Flags");
                    int           damage          = reader.Get <int>("Damage");
                    int           heal            = reader.Get <int>("Heal");
                    string        bannedItems     = reader.Get <string>("BannedItems") ?? "";
                    string        tempGroup       = reader.Get <string>("TempGroup") ?? "";
                    Group         g               = TShock.Groups.GetGroupByName(tempGroup);
                    List <string> bannedItemsList = new List <string>(bannedItems.Split(',').ToList().Select(s => s.Trim()));
                    regions.ImportRegion(name, flags, damage, heal, bannedItemsList, g);
                }
            }
        }
Example #2
0
        private void Import(EventArgs args)
        {
            String query = "SELECT * FROM Regions";

            using (var reader = db.QueryReader(query))
            {
                while (reader.Read())
                {
                    string name = reader.Get <string>("Name");
                    //string wid = reader.Get<string>("WorldID");
                    int    flags       = reader.Get <int>("Flags");
                    int    damage      = reader.Get <int>("Damage");
                    int    heal        = reader.Get <int>("Heal");
                    string bannedItems = reader.Get <string>("BannedItems") ?? "";

                    //List<int> FlagsList = new List<int>(flags.Split(',').ToList().Select(s => s.Trim()));
                    List <string> bannedItemsList = new List <string>(bannedItems.Split(',').ToList().Select(s => s.Trim()));
                    regions.ImportRegion(name, flags, damage, heal, bannedItemsList);                     // add wid after name
                }
            }
        }