Adds DBEditor to Master Project

DBEditor can now add new groups
This commit is contained in:
Steven French 2011-07-23 14:41:03 +12:00
parent 64ca3e7148
commit ca9c5a5d4a
17 changed files with 2042 additions and 0 deletions

55
DBEditor/.gitignore vendored Normal file
View file

@ -0,0 +1,55 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*/bin/*
*/obj/*
bin/*
obj/*
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db
# Visual Studio shit Motherfucka #
##################################
*.suo
*.sdf
*.opensdf
*.cache
*.pdb
*.csproj.user
*/_ReSharper*/*
*.user
#Template Bat file#
###################
myass.bat

44
DBEditor/CommandList.cs Normal file
View file

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TShockDBEditor
{
public class Commandlist
{
public static List<string> CommandList = new List<string>();
public static void AddCommands()
{
CommandList.Add("reservedslot");
CommandList.Add("canwater");
CommandList.Add("canlava");
CommandList.Add("warp");
CommandList.Add("kick");
CommandList.Add("ban");
CommandList.Add("unban");
CommandList.Add("whitelist");
CommandList.Add("maintenace");
CommandList.Add("causeevents");
CommandList.Add("spawnboss");
CommandList.Add("spawnmob");
CommandList.Add("tp");
CommandList.Add("tphere");
CommandList.Add("managewarp");
CommandList.Add("editspawn");
CommandList.Add("cfg");
CommandList.Add("time");
CommandList.Add("pvpfun");
CommandList.Add("logs");
CommandList.Add("kill");
CommandList.Add("butcher");
CommandList.Add("cheat");
CommandList.Add("immunetokick");
CommandList.Add("immunetoban");
CommandList.Add("ignorecheatdetection");
CommandList.Add("ignoregriefdetection");
CommandList.Add("usebanneditem");
}
}
}

46
DBEditor/DbExt.cs Normal file
View file

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
namespace TShockDBEditor
{
public static class DbExt
{
public static IDbDataParameter AddParameter(this IDbCommand command, string name, object data)
{
var parm = command.CreateParameter();
parm.ParameterName = name;
parm.Value = data;
command.Parameters.Add(parm);
return parm;
}
static Dictionary<Type, Func<IDataReader, int, object>> ReadFuncs = new Dictionary<Type, Func<IDataReader, int, object>>()
{
{typeof(bool), (s, i) => s.GetBoolean(i)},
{typeof(byte), (s, i) => s.GetByte(i)},
{typeof(Int16), (s, i) => s.GetInt16(i)},
{typeof(Int32), (s, i) => s.GetInt32(i)},
{typeof(Int64), (s, i) => s.GetInt64(i)},
{typeof(string), (s, i) => s.GetString(i)},
{typeof(decimal), (s, i) => s.GetDecimal(i)},
{typeof(float), (s, i) => s.GetFloat(i)},
{typeof(double), (s, i) => s.GetDouble(i)},
};
public static T Get<T>(this IDataReader reader, string column)
{
return reader.Get<T>(reader.GetOrdinal(column));
}
public static T Get<T>(this IDataReader reader, int column)
{
if (ReadFuncs.ContainsKey(typeof(T)))
return (T)ReadFuncs[typeof(T)](reader, column);
throw new NotImplementedException();
}
}
}

24
DBEditor/Group.cs Normal file
View file

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
namespace TShockDBEditor
{
public class Group
{
public readonly List<string> permissions = new List<string>();
private readonly List<string> negatedpermissions = new List<string>();
public int ID { get; protected set; }
public string Name { get; set; }
public Group Parent { get; set; }
public int Order { get; set; }
public Group(int id, string groupname, int order, Group parentgroup = null)
{
Order = order;
ID = id;
Name = groupname;
Parent = parentgroup;
}
}
}

342
DBEditor/Itemlist.cs Normal file
View file

@ -0,0 +1,342 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TShockDBEditor
{
public class Itemlist
{
public static List<string> ItemList = new List<string>();
public static void AddItems()
{
ItemList.Add("Iron Pickaxe");
ItemList.Add("Dirt Block");
ItemList.Add("Stone Block");
ItemList.Add("Iron Broadsword");
ItemList.Add("Mushroom");
ItemList.Add("Iron Shortsword");
ItemList.Add("Iron Hammer");
ItemList.Add("Torch");
ItemList.Add("Wood");
ItemList.Add("Iron Axe");
ItemList.Add("Iron Ore");
ItemList.Add("Copper Ore");
ItemList.Add("Gold Ore");
ItemList.Add("Silver Ore");
ItemList.Add("Copper Watch");
ItemList.Add("Silver Watch");
ItemList.Add("Gold Watch");
ItemList.Add("Depth Meter");
ItemList.Add("Gold Bar");
ItemList.Add("Copper Bar");
ItemList.Add("Silver Bar");
ItemList.Add("Iron Bar");
ItemList.Add("Gel");
ItemList.Add("Wooden Sword");
ItemList.Add("Wooden Door");
ItemList.Add("Stone Wall");
ItemList.Add("Acorn");
ItemList.Add("Lesser Healing Potion");
ItemList.Add("Life Crystal");
ItemList.Add("Dirt Wall");
ItemList.Add("Bottle");
ItemList.Add("Wooden Table");
ItemList.Add("Furnace");
ItemList.Add("Wooden Chair");
ItemList.Add("Iron Anvil");
ItemList.Add("Work Bench");
ItemList.Add("Goggles");
ItemList.Add("Lens");
ItemList.Add("Wooden Bow");
ItemList.Add("Wooden Arrow");
ItemList.Add("Flaming Arrow");
ItemList.Add("Shuriken");
ItemList.Add("Suspicious Looking Eye");
ItemList.Add("Demon Bow");
ItemList.Add("War Axe of the Night");
ItemList.Add("Light's Bane");
ItemList.Add("Unholy Arrow");
ItemList.Add("Chest");
ItemList.Add("Band of Regeneration");
ItemList.Add("Magic Mirror");
ItemList.Add("Jester's Arrow");
ItemList.Add("Angel Statue");
ItemList.Add("Cloud in a Bottle");
ItemList.Add("Hermes Boots");
ItemList.Add("Enchanted Boomerang");
ItemList.Add("Demonite Ore");
ItemList.Add("Demonite Bar");
ItemList.Add("Heart");
ItemList.Add("Corrupt Seeds");
ItemList.Add("Vile Mushroom");
ItemList.Add("Ebonstone Block");
ItemList.Add("Grass Seeds");
ItemList.Add("Sunflower");
ItemList.Add("Vilethorn");
ItemList.Add("Starfury");
ItemList.Add("Purification Powder");
ItemList.Add("Vile Powder");
ItemList.Add("Rotten Chunk");
ItemList.Add("Worm Tooth");
ItemList.Add("Worm Food");
ItemList.Add("Copper Coin");
ItemList.Add("Silver Coin");
ItemList.Add("Gold Coin");
ItemList.Add("Platinum Coin");
ItemList.Add("Fallen Star");
ItemList.Add("Copper Greaves");
ItemList.Add("Iron Greaves");
ItemList.Add("Silver Greaves");
ItemList.Add("Gold Greaves");
ItemList.Add("Copper Chainmail");
ItemList.Add("Iron Chainmail");
ItemList.Add("Silver Chainmail");
ItemList.Add("Gold Chainmail");
ItemList.Add("Grappling Hook");
ItemList.Add("Iron Chain");
ItemList.Add("Shadow Scale");
ItemList.Add("Piggy Bank");
ItemList.Add("Mining Helmet");
ItemList.Add("Copper Helmet");
ItemList.Add("Iron Helmet");
ItemList.Add("Silver Helmet");
ItemList.Add("Gold Helmet");
ItemList.Add("Wood Wall");
ItemList.Add("Wood Platform");
ItemList.Add("Flintlock Pistol");
ItemList.Add("Musket");
ItemList.Add("Musket Ball");
ItemList.Add("Minishark");
ItemList.Add("Iron Bow");
ItemList.Add("Shadow Greaves");
ItemList.Add("Shadow Scalemail");
ItemList.Add("Shadow Helmet");
ItemList.Add("Nightmare Pickaxe");
ItemList.Add("The Breaker");
ItemList.Add("Candle");
ItemList.Add("Copper Chandelier");
ItemList.Add("Silver Chandelier");
ItemList.Add("Gold Chandelier");
ItemList.Add("Mana Crystal");
ItemList.Add("Lesser Mana Potion");
ItemList.Add("Band of Starpower");
ItemList.Add("Flower of Fire");
ItemList.Add("Magic Missile");
ItemList.Add("Dirt Rod");
ItemList.Add("Orb of Light");
ItemList.Add("Meteorite");
ItemList.Add("Meteorite Bar");
ItemList.Add("Hook");
ItemList.Add("Flamarang");
ItemList.Add("Molten Fury");
ItemList.Add("Fiery Greatsword");
ItemList.Add("Molten Pickaxe");
ItemList.Add("Meteor Helmet");
ItemList.Add("Meteor Suit");
ItemList.Add("Meteor Leggings");
ItemList.Add("Bottled Water");
ItemList.Add("Space Gun");
ItemList.Add("Rocket Boots");
ItemList.Add("Gray Brick");
ItemList.Add("Gray Brick Wall");
ItemList.Add("Red Brick");
ItemList.Add("Red Brick Wall");
ItemList.Add("Clay Block");
ItemList.Add("Blue Brick");
ItemList.Add("Blue Brick Wall");
ItemList.Add("Chain Lantern");
ItemList.Add("Green Brick");
ItemList.Add("Green Brick Wall");
ItemList.Add("Pink Brick");
ItemList.Add("Pink Brick Wall");
ItemList.Add("Gold Brick");
ItemList.Add("Gold Brick Wall");
ItemList.Add("Silver Brick");
ItemList.Add("Silver Brick Wall");
ItemList.Add("Copper Brick");
ItemList.Add("Copper Brick Wall");
ItemList.Add("Spike");
ItemList.Add("Water Candle");
ItemList.Add("Book");
ItemList.Add("Cobweb");
ItemList.Add("Necro Helmet");
ItemList.Add("Necro Breastplate");
ItemList.Add("Necro Greaves");
ItemList.Add("Bone");
ItemList.Add("Muramasa");
ItemList.Add("Cobalt Shield");
ItemList.Add("Aqua Scepter");
ItemList.Add("Lucky Horseshoe");
ItemList.Add("Shiny Red Balloon");
ItemList.Add("Harpoon");
ItemList.Add("Spiky Ball");
ItemList.Add("Ball 'O Hurt");
ItemList.Add("Blue Moon");
ItemList.Add("Handgun");
ItemList.Add("Water Bolt");
ItemList.Add("Bomb");
ItemList.Add("Dynamite");
ItemList.Add("Grenade");
ItemList.Add("Sand Block");
ItemList.Add("Glass");
ItemList.Add("Sign");
ItemList.Add("Ash Block");
ItemList.Add("Obsidian");
ItemList.Add("Hellstone");
ItemList.Add("Hellstone Bar");
ItemList.Add("Mud Block");
ItemList.Add("Sapphire");
ItemList.Add("Ruby");
ItemList.Add("Emerald");
ItemList.Add("Topaz");
ItemList.Add("Amethyst");
ItemList.Add("Diamond");
ItemList.Add("Glowing Mushroom");
ItemList.Add("Star");
ItemList.Add("Ivy Whip");
ItemList.Add("Breathing Reed");
ItemList.Add("Flipper");
ItemList.Add("Healing Potion");
ItemList.Add("Mana Potion");
ItemList.Add("Blade of Grass");
ItemList.Add("Thorn Chakrum");
ItemList.Add("Obsidian Brick");
ItemList.Add("Obsidian Skull");
ItemList.Add("Mushroom Grass Seeds");
ItemList.Add("Jungle Grass Seeds");
ItemList.Add("Wooden Hammer");
ItemList.Add("Star Cannon");
ItemList.Add("Blue Phaseblade");
ItemList.Add("Red Phaseblade");
ItemList.Add("Green Phaseblade");
ItemList.Add("Purple Phaseblade");
ItemList.Add("White Phaseblade");
ItemList.Add("Yellow Phaseblade");
ItemList.Add("Meteor Hamaxe");
ItemList.Add("Empty Bucket");
ItemList.Add("Water Bucket");
ItemList.Add("Lava Bucket");
ItemList.Add("Jungle Rose");
ItemList.Add("Stinger");
ItemList.Add("Vine");
ItemList.Add("Feral Claws");
ItemList.Add("Anklet of the Wind");
ItemList.Add("Staff of Regrowth");
ItemList.Add("Hellstone Brick");
ItemList.Add("Whoopie Cushion");
ItemList.Add("Shackle");
ItemList.Add("Molten Hamaxe");
ItemList.Add("Flamelash");
ItemList.Add("Phoenix Blaster");
ItemList.Add("Sunfury");
ItemList.Add("Hellforge");
ItemList.Add("Clay Pot");
ItemList.Add("Nature's Gift");
ItemList.Add("Bed");
ItemList.Add("Silk");
ItemList.Add("Lesser Restoration Potion");
ItemList.Add("Restoration Potion");
ItemList.Add("Jungle Hat");
ItemList.Add("Jungle Shirt");
ItemList.Add("Jungle Pants");
ItemList.Add("Molten Helmet");
ItemList.Add("Molten Breastplate");
ItemList.Add("Molten Greaves");
ItemList.Add("Meteor Shot");
ItemList.Add("Sticky Bomb");
ItemList.Add("Black Lens");
ItemList.Add("Sunglasses");
ItemList.Add("Wizard Hat");
ItemList.Add("Top Hat");
ItemList.Add("Tuxedo Shirt");
ItemList.Add("Tuxedo Pants");
ItemList.Add("Summer Hat");
ItemList.Add("Bunny Hood");
ItemList.Add("Plumber's Hat");
ItemList.Add("Plumber's Shirt");
ItemList.Add("Plumber's Pants");
ItemList.Add("Hero's Hat");
ItemList.Add("Hero's Shirt");
ItemList.Add("Hero's Pants");
ItemList.Add("Fish Bowl");
ItemList.Add("Archaeologist's Hat");
ItemList.Add("Archaeologist's Jacket");
ItemList.Add("Archaeologist's Pants");
ItemList.Add("Black Dye");
ItemList.Add("Green Dye");
ItemList.Add("Ninja Hood");
ItemList.Add("Ninja Shirt");
ItemList.Add("Ninja Pants");
ItemList.Add("Leather");
ItemList.Add("Red Hat");
ItemList.Add("Goldfish");
ItemList.Add("Robe");
ItemList.Add("Robot Hat");
ItemList.Add("Gold Crown");
ItemList.Add("Hellfire Arrow");
ItemList.Add("Sandgun");
ItemList.Add("Guide Voodoo Doll");
ItemList.Add("Diving Helmet");
ItemList.Add("Familiar Shirt");
ItemList.Add("Familiar Pants");
ItemList.Add("Familiar Wig");
ItemList.Add("Demon Scythe");
ItemList.Add("Night's Edge");
ItemList.Add("Dark Lance");
ItemList.Add("Coral");
ItemList.Add("Cactus");
ItemList.Add("Trident");
ItemList.Add("Silver Bullet");
ItemList.Add("Throwing Knife");
ItemList.Add("Spear");
ItemList.Add("Blowpipe");
ItemList.Add("Glowstick");
ItemList.Add("Seed");
ItemList.Add("Wooden Boomerang");
ItemList.Add("Aglet");
ItemList.Add("Sticky Glowstick");
ItemList.Add("Poisoned Knife");
ItemList.Add("Obsidian Skin Potion");
ItemList.Add("Regeneration Potion");
ItemList.Add("Swiftness Potion");
ItemList.Add("Gills potion");
ItemList.Add("Ironskin Potion");
ItemList.Add("Mana Regeneration Potion");
ItemList.Add("Magic Power Potion");
ItemList.Add("Featherfall Potion");
ItemList.Add("Spelunker Potion");
ItemList.Add("Invisibility Potion");
ItemList.Add("Shine Potion");
ItemList.Add("Night Owl Potion");
ItemList.Add("Battle Potion");
ItemList.Add("Thorns Potion");
ItemList.Add("Water Walking Potion");
ItemList.Add("Archery Potion");
ItemList.Add("Hunter Potion");
ItemList.Add("Gravitation Potion");
ItemList.Add("Gold Chest");
ItemList.Add("Daybloom Seeds");
ItemList.Add("Moonglow Seeds");
ItemList.Add("Blinkroot Seeds");
ItemList.Add("Deathweed Seeds");
ItemList.Add("Waterleaf Seeds");
ItemList.Add("Fireblossom Seeds");
ItemList.Add("Daybloom");
ItemList.Add("Moonglow");
ItemList.Add("Blinkroot");
ItemList.Add("Deathweed");
ItemList.Add("Waterleaf");
ItemList.Add("Fireblossom");
ItemList.Add("Shark Fin");
ItemList.Add("Feather");
ItemList.Add("Tombstone");
ItemList.Add("Mime Mask");
ItemList.Add("Antlion Mandible");
ItemList.Add("Illegal Gun Parts");
ItemList.Add("The Doctor's Shirt");
ItemList.Add("The Doctor's Pants");
}
}
}

579
DBEditor/Main.Designer.cs generated Normal file
View file

@ -0,0 +1,579 @@
namespace TShockDBEditor
{
partial class TShockDBEditor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.itemListBanned = new System.Windows.Forms.ListBox();
this.itemListAvailable = new System.Windows.Forms.ListBox();
this.tabControl = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.btn_moveAllLeft = new System.Windows.Forms.Button();
this.btn_moveAllRight = new System.Windows.Forms.Button();
this.btn_moveLeft = new System.Windows.Forms.Button();
this.btn_moveRight = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.lst_inheritgrps = new System.Windows.Forms.ComboBox();
this.label11 = new System.Windows.Forms.Label();
this.txt_grpname = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.btn_deletegroup = new System.Windows.Forms.Button();
this.btn_newgroup = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.btn_moveAllLeftCmd = new System.Windows.Forms.Button();
this.btn_moveLeftCmd = new System.Windows.Forms.Button();
this.btn_moveRightCmd = new System.Windows.Forms.Button();
this.lst_AvailableCmds = new System.Windows.Forms.ListBox();
this.btn_moveAllRightCmd = new System.Windows.Forms.Button();
this.lst_bannedCmds = new System.Windows.Forms.ListBox();
this.lst_groupList = new System.Windows.Forms.ListBox();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.btn_OpenLocalDB = new System.Windows.Forms.Button();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.btn_connect = new System.Windows.Forms.Button();
this.label9 = new System.Windows.Forms.Label();
this.txt_password = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.txt_username = new System.Windows.Forms.TextBox();
this.txt_port = new System.Windows.Forms.TextBox();
this.txt_dbname = new System.Windows.Forms.TextBox();
this.txt_hostname = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.lbl_grpchild = new System.Windows.Forms.Label();
this.tabControl.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
this.SuspendLayout();
//
// itemListBanned
//
this.itemListBanned.FormattingEnabled = true;
this.itemListBanned.Location = new System.Drawing.Point(321, 19);
this.itemListBanned.Name = "itemListBanned";
this.itemListBanned.Size = new System.Drawing.Size(275, 290);
this.itemListBanned.TabIndex = 1;
//
// itemListAvailable
//
this.itemListAvailable.FormattingEnabled = true;
this.itemListAvailable.Location = new System.Drawing.Point(7, 19);
this.itemListAvailable.Name = "itemListAvailable";
this.itemListAvailable.Size = new System.Drawing.Size(275, 290);
this.itemListAvailable.TabIndex = 2;
//
// tabControl
//
this.tabControl.Controls.Add(this.tabPage1);
this.tabControl.Controls.Add(this.tabPage2);
this.tabControl.Location = new System.Drawing.Point(12, 143);
this.tabControl.Name = "tabControl";
this.tabControl.SelectedIndex = 0;
this.tabControl.Size = new System.Drawing.Size(610, 407);
this.tabControl.TabIndex = 3;
this.tabControl.Visible = false;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.btn_moveAllLeft);
this.tabPage1.Controls.Add(this.btn_moveAllRight);
this.tabPage1.Controls.Add(this.btn_moveLeft);
this.tabPage1.Controls.Add(this.btn_moveRight);
this.tabPage1.Controls.Add(this.label2);
this.tabPage1.Controls.Add(this.label1);
this.tabPage1.Controls.Add(this.itemListAvailable);
this.tabPage1.Controls.Add(this.itemListBanned);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(602, 381);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Item Bans";
this.tabPage1.UseVisualStyleBackColor = true;
//
// btn_moveAllLeft
//
this.btn_moveAllLeft.Location = new System.Drawing.Point(288, 193);
this.btn_moveAllLeft.Name = "btn_moveAllLeft";
this.btn_moveAllLeft.Size = new System.Drawing.Size(27, 23);
this.btn_moveAllLeft.TabIndex = 8;
this.btn_moveAllLeft.Text = "<<";
this.btn_moveAllLeft.UseVisualStyleBackColor = true;
this.btn_moveAllLeft.Click += new System.EventHandler(this.btn_moveAllLeftItems_Click);
//
// btn_moveAllRight
//
this.btn_moveAllRight.Location = new System.Drawing.Point(288, 106);
this.btn_moveAllRight.Name = "btn_moveAllRight";
this.btn_moveAllRight.Size = new System.Drawing.Size(27, 23);
this.btn_moveAllRight.TabIndex = 7;
this.btn_moveAllRight.Text = ">>";
this.btn_moveAllRight.UseVisualStyleBackColor = true;
this.btn_moveAllRight.Click += new System.EventHandler(this.btn_moveAllRightItems_Click);
//
// btn_moveLeft
//
this.btn_moveLeft.Location = new System.Drawing.Point(288, 164);
this.btn_moveLeft.Name = "btn_moveLeft";
this.btn_moveLeft.Size = new System.Drawing.Size(27, 23);
this.btn_moveLeft.TabIndex = 6;
this.btn_moveLeft.Text = "<";
this.btn_moveLeft.UseVisualStyleBackColor = true;
this.btn_moveLeft.Click += new System.EventHandler(this.btn_moveLeftItems_Click);
//
// btn_moveRight
//
this.btn_moveRight.Location = new System.Drawing.Point(288, 135);
this.btn_moveRight.Name = "btn_moveRight";
this.btn_moveRight.Size = new System.Drawing.Size(27, 23);
this.btn_moveRight.TabIndex = 5;
this.btn_moveRight.Text = ">";
this.btn_moveRight.UseVisualStyleBackColor = true;
this.btn_moveRight.Click += new System.EventHandler(this.btn_moveRightItems_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(318, 3);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(86, 13);
this.label2.TabIndex = 4;
this.label2.Text = "Blacklisted Items";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 3);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(87, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Whitelisted Items";
//
// tabPage2
//
this.tabPage2.Controls.Add(this.lbl_grpchild);
this.tabPage2.Controls.Add(this.label12);
this.tabPage2.Controls.Add(this.lst_inheritgrps);
this.tabPage2.Controls.Add(this.label11);
this.tabPage2.Controls.Add(this.txt_grpname);
this.tabPage2.Controls.Add(this.label10);
this.tabPage2.Controls.Add(this.btn_deletegroup);
this.tabPage2.Controls.Add(this.btn_newgroup);
this.tabPage2.Controls.Add(this.label4);
this.tabPage2.Controls.Add(this.label3);
this.tabPage2.Controls.Add(this.btn_moveAllLeftCmd);
this.tabPage2.Controls.Add(this.btn_moveLeftCmd);
this.tabPage2.Controls.Add(this.btn_moveRightCmd);
this.tabPage2.Controls.Add(this.lst_AvailableCmds);
this.tabPage2.Controls.Add(this.btn_moveAllRightCmd);
this.tabPage2.Controls.Add(this.lst_bannedCmds);
this.tabPage2.Controls.Add(this.lst_groupList);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(602, 381);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Group Manager";
this.tabPage2.UseVisualStyleBackColor = true;
//
// lst_inheritgrps
//
this.lst_inheritgrps.FormattingEnabled = true;
this.lst_inheritgrps.Location = new System.Drawing.Point(375, 84);
this.lst_inheritgrps.Name = "lst_inheritgrps";
this.lst_inheritgrps.Size = new System.Drawing.Size(100, 21);
this.lst_inheritgrps.TabIndex = 23;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(299, 87);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(65, 13);
this.label11.TabIndex = 22;
this.label11.Text = "Inherit From:";
//
// txt_grpname
//
this.txt_grpname.Location = new System.Drawing.Point(375, 55);
this.txt_grpname.Name = "txt_grpname";
this.txt_grpname.Size = new System.Drawing.Size(100, 20);
this.txt_grpname.TabIndex = 21;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(299, 58);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(70, 13);
this.label10.TabIndex = 20;
this.label10.Text = "Group Name:";
//
// btn_deletegroup
//
this.btn_deletegroup.Location = new System.Drawing.Point(215, 82);
this.btn_deletegroup.Name = "btn_deletegroup";
this.btn_deletegroup.Size = new System.Drawing.Size(78, 23);
this.btn_deletegroup.TabIndex = 19;
this.btn_deletegroup.Text = "Delete Group";
this.btn_deletegroup.UseVisualStyleBackColor = true;
this.btn_deletegroup.Click += new System.EventHandler(this.btn_deletegroup_Click);
//
// btn_newgroup
//
this.btn_newgroup.Location = new System.Drawing.Point(215, 53);
this.btn_newgroup.Name = "btn_newgroup";
this.btn_newgroup.Size = new System.Drawing.Size(78, 23);
this.btn_newgroup.TabIndex = 18;
this.btn_newgroup.Text = "New Group";
this.btn_newgroup.UseVisualStyleBackColor = true;
this.btn_newgroup.Click += new System.EventHandler(this.btn_newgroup_Click);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(324, 144);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(114, 13);
this.label4.TabIndex = 17;
this.label4.Text = "Whitelisted Commands";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(6, 145);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(99, 13);
this.label3.TabIndex = 16;
this.label3.Text = "Banned Commands";
//
// btn_moveAllLeftCmd
//
this.btn_moveAllLeftCmd.Location = new System.Drawing.Point(291, 300);
this.btn_moveAllLeftCmd.Name = "btn_moveAllLeftCmd";
this.btn_moveAllLeftCmd.Size = new System.Drawing.Size(27, 23);
this.btn_moveAllLeftCmd.TabIndex = 15;
this.btn_moveAllLeftCmd.Text = "<<";
this.btn_moveAllLeftCmd.UseVisualStyleBackColor = true;
this.btn_moveAllLeftCmd.Click += new System.EventHandler(this.btn_moveAllLeftCmd_Click);
//
// btn_moveLeftCmd
//
this.btn_moveLeftCmd.Location = new System.Drawing.Point(291, 270);
this.btn_moveLeftCmd.Name = "btn_moveLeftCmd";
this.btn_moveLeftCmd.Size = new System.Drawing.Size(27, 23);
this.btn_moveLeftCmd.TabIndex = 14;
this.btn_moveLeftCmd.Text = "<";
this.btn_moveLeftCmd.UseVisualStyleBackColor = true;
this.btn_moveLeftCmd.Click += new System.EventHandler(this.btn_moveLeftCmd_Click);
//
// btn_moveRightCmd
//
this.btn_moveRightCmd.Location = new System.Drawing.Point(291, 240);
this.btn_moveRightCmd.Name = "btn_moveRightCmd";
this.btn_moveRightCmd.Size = new System.Drawing.Size(27, 23);
this.btn_moveRightCmd.TabIndex = 13;
this.btn_moveRightCmd.Text = ">";
this.btn_moveRightCmd.UseVisualStyleBackColor = true;
this.btn_moveRightCmd.Click += new System.EventHandler(this.btn_moveRightCmd_Click);
//
// lst_AvailableCmds
//
this.lst_AvailableCmds.FormattingEnabled = true;
this.lst_AvailableCmds.Location = new System.Drawing.Point(324, 161);
this.lst_AvailableCmds.Name = "lst_AvailableCmds";
this.lst_AvailableCmds.Size = new System.Drawing.Size(272, 212);
this.lst_AvailableCmds.TabIndex = 12;
//
// btn_moveAllRightCmd
//
this.btn_moveAllRightCmd.Location = new System.Drawing.Point(291, 210);
this.btn_moveAllRightCmd.Name = "btn_moveAllRightCmd";
this.btn_moveAllRightCmd.Size = new System.Drawing.Size(27, 23);
this.btn_moveAllRightCmd.TabIndex = 11;
this.btn_moveAllRightCmd.Text = ">>";
this.btn_moveAllRightCmd.UseVisualStyleBackColor = true;
this.btn_moveAllRightCmd.Click += new System.EventHandler(this.btn_moveAllRightCmd_Click);
//
// lst_bannedCmds
//
this.lst_bannedCmds.FormattingEnabled = true;
this.lst_bannedCmds.Location = new System.Drawing.Point(9, 161);
this.lst_bannedCmds.Name = "lst_bannedCmds";
this.lst_bannedCmds.Size = new System.Drawing.Size(275, 212);
this.lst_bannedCmds.TabIndex = 10;
//
// lst_groupList
//
this.lst_groupList.FormattingEnabled = true;
this.lst_groupList.Location = new System.Drawing.Point(9, 8);
this.lst_groupList.Name = "lst_groupList";
this.lst_groupList.Size = new System.Drawing.Size(200, 134);
this.lst_groupList.TabIndex = 0;
this.lst_groupList.SelectedIndexChanged += new System.EventHandler(this.lst_groupList_SelectedIndexChanged);
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage4);
this.tabControl1.Location = new System.Drawing.Point(12, 12);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(610, 125);
this.tabControl1.TabIndex = 6;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.btn_OpenLocalDB);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(602, 99);
this.tabPage3.TabIndex = 0;
this.tabPage3.Text = "Local Database (SQLite)";
this.tabPage3.UseVisualStyleBackColor = true;
//
// btn_OpenLocalDB
//
this.btn_OpenLocalDB.Location = new System.Drawing.Point(9, 6);
this.btn_OpenLocalDB.Name = "btn_OpenLocalDB";
this.btn_OpenLocalDB.Size = new System.Drawing.Size(96, 23);
this.btn_OpenLocalDB.TabIndex = 0;
this.btn_OpenLocalDB.Text = "Open Database";
this.btn_OpenLocalDB.UseVisualStyleBackColor = true;
this.btn_OpenLocalDB.Click += new System.EventHandler(this.btn_OpenLocalDB_Click);
//
// tabPage4
//
this.tabPage4.Controls.Add(this.btn_connect);
this.tabPage4.Controls.Add(this.label9);
this.tabPage4.Controls.Add(this.txt_password);
this.tabPage4.Controls.Add(this.label8);
this.tabPage4.Controls.Add(this.txt_username);
this.tabPage4.Controls.Add(this.txt_port);
this.tabPage4.Controls.Add(this.txt_dbname);
this.tabPage4.Controls.Add(this.txt_hostname);
this.tabPage4.Controls.Add(this.label7);
this.tabPage4.Controls.Add(this.label6);
this.tabPage4.Controls.Add(this.label5);
this.tabPage4.Location = new System.Drawing.Point(4, 22);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
this.tabPage4.Size = new System.Drawing.Size(602, 99);
this.tabPage4.TabIndex = 1;
this.tabPage4.Text = "Remote Database (MySql)";
this.tabPage4.UseVisualStyleBackColor = true;
//
// btn_connect
//
this.btn_connect.Location = new System.Drawing.Point(213, 63);
this.btn_connect.Name = "btn_connect";
this.btn_connect.Size = new System.Drawing.Size(75, 23);
this.btn_connect.TabIndex = 10;
this.btn_connect.Text = "Connect";
this.btn_connect.UseVisualStyleBackColor = true;
this.btn_connect.Click += new System.EventHandler(this.btn_connect_Click);
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(210, 36);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(56, 13);
this.label9.TabIndex = 9;
this.label9.Text = "Password:";
//
// txt_password
//
this.txt_password.Location = new System.Drawing.Point(272, 33);
this.txt_password.Name = "txt_password";
this.txt_password.Size = new System.Drawing.Size(100, 20);
this.txt_password.TabIndex = 8;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(208, 10);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(58, 13);
this.label8.TabIndex = 7;
this.label8.Text = "Username:";
//
// txt_username
//
this.txt_username.Location = new System.Drawing.Point(272, 7);
this.txt_username.Name = "txt_username";
this.txt_username.Size = new System.Drawing.Size(100, 20);
this.txt_username.TabIndex = 6;
//
// txt_port
//
this.txt_port.Location = new System.Drawing.Point(102, 60);
this.txt_port.Name = "txt_port";
this.txt_port.Size = new System.Drawing.Size(100, 20);
this.txt_port.TabIndex = 5;
this.txt_port.Text = "3306";
//
// txt_dbname
//
this.txt_dbname.Location = new System.Drawing.Point(102, 33);
this.txt_dbname.Name = "txt_dbname";
this.txt_dbname.Size = new System.Drawing.Size(100, 20);
this.txt_dbname.TabIndex = 4;
//
// txt_hostname
//
this.txt_hostname.Location = new System.Drawing.Point(102, 7);
this.txt_hostname.Name = "txt_hostname";
this.txt_hostname.Size = new System.Drawing.Size(100, 20);
this.txt_hostname.TabIndex = 3;
this.txt_hostname.Text = "localhost";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(70, 63);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(26, 13);
this.label7.TabIndex = 2;
this.label7.Text = "Port";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(9, 36);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(87, 13);
this.label6.TabIndex = 1;
this.label6.Text = "Database Name:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(38, 10);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(58, 13);
this.label5.TabIndex = 0;
this.label5.Text = "Hostname:";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(215, 8);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(65, 13);
this.label12.TabIndex = 24;
this.label12.Text = "Group Child:";
//
// lbl_grpchild
//
this.lbl_grpchild.AutoSize = true;
this.lbl_grpchild.Location = new System.Drawing.Point(286, 8);
this.lbl_grpchild.Name = "lbl_grpchild";
this.lbl_grpchild.Size = new System.Drawing.Size(16, 13);
this.lbl_grpchild.TabIndex = 25;
this.lbl_grpchild.Text = " ";
//
// TShockDBEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(634, 562);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.tabControl);
this.Name = "TShockDBEditor";
this.Text = "TShockDBEditor";
this.tabControl.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.tabControl1.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.tabPage4.ResumeLayout(false);
this.tabPage4.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ListBox itemListBanned;
private System.Windows.Forms.ListBox itemListAvailable;
private System.Windows.Forms.TabControl tabControl;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btn_moveAllLeft;
private System.Windows.Forms.Button btn_moveAllRight;
private System.Windows.Forms.Button btn_moveLeft;
private System.Windows.Forms.Button btn_moveRight;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.Button btn_OpenLocalDB;
private System.Windows.Forms.Button btn_moveAllLeftCmd;
private System.Windows.Forms.Button btn_moveLeftCmd;
private System.Windows.Forms.Button btn_moveRightCmd;
private System.Windows.Forms.ListBox lst_AvailableCmds;
private System.Windows.Forms.Button btn_moveAllRightCmd;
private System.Windows.Forms.ListBox lst_bannedCmds;
private System.Windows.Forms.ListBox lst_groupList;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Button btn_connect;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox txt_password;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox txt_username;
private System.Windows.Forms.TextBox txt_port;
private System.Windows.Forms.TextBox txt_dbname;
private System.Windows.Forms.TextBox txt_hostname;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button btn_deletegroup;
private System.Windows.Forms.Button btn_newgroup;
private System.Windows.Forms.ComboBox lst_inheritgrps;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox txt_grpname;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label lbl_grpchild;
private System.Windows.Forms.Label label12;
}
}

435
DBEditor/Main.cs Normal file
View file

@ -0,0 +1,435 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.IO;
using MySql.Data.MySqlClient;
using Community.CsharpSqlite.SQLiteClient;
using System.Windows.Forms;
namespace TShockDBEditor
{
public partial class TShockDBEditor : Form
{
public OpenFileDialog dialog = new OpenFileDialog();
public List<Group> groups = new List<Group>();
public IDbConnection DB;
public string dbtype = "";
public TShockDBEditor()
{
InitializeComponent();
Itemlist.AddItems();
Commandlist.AddCommands();
dialog.FileOk += new CancelEventHandler(dialog_FileOk);
dialog.Filter = "SQLite Database (*.sqlite)|*.sqlite";
}
public void LoadSqliteDatabase(string path)
{
string sql = dialog.FileName;
DB = new SqliteConnection(string.Format("uri=file://{0},Version=3", sql));
DB.Open();
dbtype = "sqlite";
itemListBanned.Items.Clear();
lst_groupList.Items.Clear();
lst_AvailableCmds.Items.Clear();
lst_bannedCmds.Items.Clear();
itemListAvailable.Items.Clear();
using (var com = DB.CreateCommand())
{
com.CommandText =
"SELECT * FROM Itembans";
using (var reader = com.ExecuteReader())
{
while (reader.Read())
itemListBanned.Items.Add(reader.Get<string>("ItemName"));
}
}
using (var com = DB.CreateCommand())
{
com.CommandText =
"SELECT * FROM GroupList";
using (var reader = com.ExecuteReader())
{
while (reader.Read())
{
lst_groupList.Items.Add(reader.Get<string>("GroupName"));
lst_inheritgrps.Items.Add(reader.Get<string>("GroupName"));
}
}
}
for (int i = 0; i < Itemlist.ItemList.Count; i++)
{
if (!itemListBanned.Items.Contains(Itemlist.ItemList[i]))
itemListAvailable.Items.Add(Itemlist.ItemList[i]);
}
}
public void LoadMySqlDatabase(string hostname = "localhost", string port = "3306", string database = "", string username = "", string password = "")
{
DB = new MySqlConnection();
DB.ConnectionString =
"Server='" + hostname +
"';Port='" + port +
"';Database='" + database +
"';Uid='" + username +
"';Pwd='" + password + "';";
DB.Open();
dbtype = "mysql";
itemListBanned.Items.Clear();
lst_groupList.Items.Clear();
lst_AvailableCmds.Items.Clear();
lst_bannedCmds.Items.Clear();
itemListAvailable.Items.Clear();
using (var com = DB.CreateCommand())
{
com.CommandText =
"SELECT * FROM Itembans";
using (var reader = com.ExecuteReader())
{
while (reader.Read())
itemListBanned.Items.Add(reader.Get<string>("ItemName"));
}
}
using (var com = DB.CreateCommand())
{
com.CommandText =
"SELECT * FROM GroupList";
using (var reader = com.ExecuteReader())
{
while (reader.Read())
{
lst_groupList.Items.Add(reader.Get<string>("GroupName"));
}
}
}
for (int i = 0; i < Itemlist.ItemList.Count; i++)
{
if (!itemListBanned.Items.Contains(Itemlist.ItemList[i]))
itemListAvailable.Items.Add(Itemlist.ItemList[i]);
}
}
#region BannedItemsTab
public void btn_moveAllRightItems_Click(object sender, EventArgs e)
{
foreach (object item in itemListAvailable.Items)
{
itemListBanned.Items.Add(item);
using (var com = DB.CreateCommand())
{
com.CommandText = "INSERT INTO ItemBans (ItemName) VALUES (@itemname);";
com.AddParameter("@itemname", item.ToString());
com.ExecuteNonQuery();
com.Parameters.Clear();
}
}
itemListAvailable.Items.Clear();
}
private void btn_moveAllLeftItems_Click(object sender, EventArgs e)
{
foreach (object item in itemListBanned.Items)
{
itemListAvailable.Items.Add(item);
using (var com = DB.CreateCommand())
{
com.CommandText = "DELETE FROM ItemBans WHERE ItemName=@itemname;";
com.AddParameter("@itemname", item.ToString());
com.ExecuteNonQuery();
com.Parameters.Clear();
}
}
itemListBanned.Items.Clear();
}
private void btn_moveRightItems_Click(object sender, EventArgs e)
{
if (itemListAvailable.SelectedItem != null)
{
itemListBanned.Items.Add(itemListAvailable.SelectedItem);
using (var com = DB.CreateCommand())
{
com.CommandText = "INSERT INTO ItemBans (ItemName) VALUES (@itemname);";
com.AddParameter("@itemname", itemListAvailable.SelectedItem.ToString());
com.ExecuteNonQuery();
}
itemListAvailable.Items.Remove(itemListAvailable.SelectedItem);
}
}
private void btn_moveLeftItems_Click(object sender, EventArgs e)
{
if (itemListBanned.SelectedItem != null)
{
itemListAvailable.Items.Add(itemListBanned.SelectedItem);
using (var com = DB.CreateCommand())
{
com.CommandText = "DELETE FROM ItemBans WHERE ItemName=@itemname;";
com.AddParameter("@itemname", itemListBanned.SelectedItem.ToString());
com.ExecuteNonQuery();
}
itemListBanned.Items.Remove(itemListBanned.SelectedItem);
}
}
#endregion
#region GroupTab
private void lst_groupList_SelectedIndexChanged(object sender, EventArgs e)
{
UpdateGroupIndex(lst_groupList.SelectedIndex);
}
private void UpdateGroupIndex(int index)
{
try
{
using (var com = DB.CreateCommand())
{
lst_AvailableCmds.Items.Clear();
lst_bannedCmds.Items.Clear();
com.CommandText =
"SELECT * FROM GroupList WHERE GroupName=@groupname";
com.AddParameter("@groupname", lst_groupList.Items[index].ToString());
lbl_grpchild.Text = "";
using (var reader = com.ExecuteReader())
{
while (reader.Read())
{
foreach (string command in reader.Get<string>("Commands").Split(','))
{
if (lst_groupList.Items.Contains(command) || command == "")
lbl_grpchild.Text = command;
else
lst_AvailableCmds.Items.Add(command);
}
}
}
if (lbl_grpchild.Text == "")
lbl_grpchild.Text = "none";
for (int i = 0; i < Commandlist.CommandList.Count; i++)
{
if (!lst_AvailableCmds.Items.Contains(Commandlist.CommandList[i]))
lst_bannedCmds.Items.Add(Commandlist.CommandList[i]);
}
}
}
catch { }
}
private void btn_moveAllRightCmd_Click(object sender, EventArgs e)
{
try
{
var sb = new StringBuilder();
foreach (object cmd in lst_bannedCmds.Items)
{
lst_AvailableCmds.Items.Add(cmd);
if (string.IsNullOrEmpty(sb.ToString()))
sb.Append(cmd.ToString());
else
sb.Append(",").Append(cmd.ToString());
}
using (var com = DB.CreateCommand())
{
com.CommandText = "UPDATE GroupList SET Commands=@cmds WHERE GroupName=@name;";
com.AddParameter("@name", lst_groupList.Items[lst_groupList.SelectedIndex].ToString());
com.AddParameter("@cmds", sb.ToString());
com.ExecuteNonQuery();
}
lst_bannedCmds.Items.Clear();
}
catch { }
}
private void btn_moveRightCmd_Click(object sender, EventArgs e)
{
try
{
lst_AvailableCmds.Items.Add(lst_bannedCmds.Items[lst_bannedCmds.SelectedIndex]);
var sb = new StringBuilder();
foreach (object cmd in lst_AvailableCmds.Items)
{
if (string.IsNullOrEmpty(sb.ToString()))
sb.Append(cmd.ToString());
else
sb.Append(",").Append(cmd.ToString());
}
using (var com = DB.CreateCommand())
{
com.CommandText = "UPDATE GroupList SET Commands=@cmds WHERE GroupName=@name;";
com.AddParameter("@name", lst_groupList.Items[lst_groupList.SelectedIndex].ToString());
com.AddParameter("@cmds", sb.ToString());
com.ExecuteNonQuery();
}
lst_bannedCmds.Items.Remove(lst_bannedCmds.Items[lst_bannedCmds.SelectedIndex]);
}
catch { }
}
private void btn_moveLeftCmd_Click(object sender, EventArgs e)
{
try
{
lst_bannedCmds.Items.Add(lst_AvailableCmds.Items[lst_AvailableCmds.SelectedIndex]);
lst_AvailableCmds.Items.Remove(lst_AvailableCmds.Items[lst_AvailableCmds.SelectedIndex]);
var sb = new StringBuilder();
foreach (object cmd in lst_AvailableCmds.Items)
{
if (string.IsNullOrEmpty(sb.ToString()))
sb.Append(cmd.ToString());
else
sb.Append(",").Append(cmd.ToString());
}
using (var com = DB.CreateCommand())
{
com.CommandText = "UPDATE GroupList SET Commands=@cmds WHERE GroupName=@name;";
com.AddParameter("@name", lst_groupList.Items[lst_groupList.SelectedIndex].ToString());
com.AddParameter("@cmds", sb.ToString());
com.ExecuteNonQuery();
}
}
catch { }
}
private void btn_moveAllLeftCmd_Click(object sender, EventArgs e)
{
try
{
foreach (object cmd in lst_AvailableCmds.Items)
{
lst_bannedCmds.Items.Add(cmd);
}
using (var com = DB.CreateCommand())
{
com.CommandText = "UPDATE GroupList SET Commands=@cmds WHERE GroupName=@name;";
com.AddParameter("@name", lst_groupList.Items[lst_groupList.SelectedIndex].ToString());
com.AddParameter("@cmds", "");
com.ExecuteNonQuery();
}
lst_AvailableCmds.Items.Clear();
}
catch { }
}
private void btn_newgroup_Click(object sender, EventArgs e)
{
try
{
if (txt_grpname.Text != "")
{
using (var com = DB.CreateCommand())
{
if (dbtype == "sqlite")
com.CommandText = "INSERT OR IGNORE INTO GroupList (GroupName, Commands) VALUES (@groupname, @commands);";
else if (dbtype == "mysql")
com.CommandText = "INSERT IGNORE INTO GroupList SET GroupName=@groupname, Commands=@commands;";
com.AddParameter("@groupname", txt_grpname.Text);
if(lst_inheritgrps.SelectedIndex > -1)
com.AddParameter("@commands", lst_inheritgrps.Items[lst_inheritgrps.SelectedIndex]);
else
com.AddParameter("@commands", "");
using (var reader = com.ExecuteReader())
{
if (reader.RecordsAffected > 0)
{
lst_groupList.Items.Add(txt_grpname.Text);
lst_inheritgrps.Items.Add(txt_grpname.Text);
txt_grpname.Text = "";
}
}
com.Parameters.Clear();
}
}
}
catch { }
}
private void btn_deletegroup_Click(object sender, EventArgs e)
{
try
{
using (var com = DB.CreateCommand())
{
com.CommandText = "DELETE FROM Grouplist WHERE GroupName = @groupname";
com.AddParameter("@groupname", lst_groupList.Items[lst_groupList.SelectedIndex]);
com.ExecuteNonQuery();
lst_groupList.Items.Remove(lst_groupList.Items[lst_groupList.SelectedIndex]);
lst_inheritgrps.Items.Clear();
com.CommandText =
"SELECT * FROM GroupList";
using (var reader = com.ExecuteReader())
{
while (reader.Read())
{
lst_inheritgrps.Items.Add(reader.Get<string>("GroupName"));
}
}
}
}
catch { }
}
#endregion
#region FileOpenTabs
private void btn_OpenLocalDB_Click(object sender, EventArgs e)
{
dialog.ShowDialog();
}
void dialog_FileOk(object sender, CancelEventArgs e)
{
LoadSqliteDatabase(dialog.FileName);
tabControl.Visible = true;
}
private void btn_connect_Click(object sender, EventArgs e)
{
LoadMySqlDatabase(txt_hostname.Text, txt_port.Text, txt_dbname.Text, txt_username.Text, txt_password.Text);
tabControl.Visible = true;
}
#endregion
}
}

120
DBEditor/Main.resx Normal file
View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

22
DBEditor/Program.cs Normal file
View file

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using TShockDBEditor;
namespace TShockDBEditor
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new TShockDBEditor());
}
}
}

View file

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WindowsFormsApplication2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("WindowsFormsApplication2")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ffdb92d1-7f89-4f59-a671-22ea6cda680c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace TShockDBEditor.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TShockDBEditor.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View file

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

26
DBEditor/Properties/Settings.Designer.cs generated Normal file
View file

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace TShockDBEditor.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View file

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View file

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TShockDBEditor</RootNamespace>
<AssemblyName>TShockDBEditor</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Community.CsharpSqlite">
<HintPath>..\..\..\..\..\..\Public\Documents\C3Mod\TShock Testing Environment\Community.CsharpSqlite.dll</HintPath>
</Reference>
<Reference Include="Community.CsharpSqlite.SQLiteClient">
<HintPath>..\..\..\..\..\..\Public\Documents\C3Mod\TShock Testing Environment\Community.CsharpSqlite.SQLiteClient.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Public\Documents\C3Mod\TShock Testing Environment\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="MySql.Web, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Public\Documents\C3Mod\TShock Testing Environment\MySql.Web.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Group.cs" />
<Compile Include="CommandList.cs" />
<Compile Include="DbExt.cs" />
<Compile Include="Main.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Main.Designer.cs">
<DependentUpon>Main.cs</DependentUpon>
</Compile>
<Compile Include="Itemlist.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Main.resx">
<DependentUpon>Main.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

3
DBEditor/app.config Normal file
View file

@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

View file

@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TShockAPI", "TShockAPI\TShockAPI.csproj", "{49606449-072B-4CF5-8088-AA49DA586694}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TShockDBEditor", "..\dbeditor\DBEditor\TShockDBEditor.csproj", "{F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -23,6 +25,16 @@ Global
{49606449-072B-4CF5-8088-AA49DA586694}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Release|x86.ActiveCfg = Release|Any CPU
{F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}.Debug|Any CPU.ActiveCfg = Debug|x86
{F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}.Debug|Mixed Platforms.Build.0 = Debug|x86
{F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}.Debug|x86.ActiveCfg = Debug|x86
{F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}.Debug|x86.Build.0 = Debug|x86
{F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}.Release|Any CPU.ActiveCfg = Release|x86
{F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}.Release|Mixed Platforms.ActiveCfg = Release|x86
{F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}.Release|Mixed Platforms.Build.0 = Release|x86
{F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}.Release|x86.ActiveCfg = Release|x86
{F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE