Removed dbeditor -> preparation for core deconstruction.

This commit is contained in:
Zack Piispanen 2012-05-30 17:18:10 -04:00
parent bdf56225b7
commit 3e9c88685e
18 changed files with 7 additions and 3174 deletions

55
DBEditor/.gitignore vendored
View file

@ -1,55 +0,0 @@
# 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

View file

@ -1,78 +0,0 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2012 The TShock Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TShockDBEditor
{
public class TShockCommandsList
{
public static void AddRemainingTShockCommands()
{
List<string> CommandList = new List<string>();
CommandList.Add("reservedslot");
CommandList.Add("canwater");
CommandList.Add("canlava");
CommandList.Add("canbuild");
CommandList.Add("adminchat");
CommandList.Add("warp");
CommandList.Add("kick");
CommandList.Add("ban");
CommandList.Add("unban");
CommandList.Add("whitelist");
CommandList.Add("maintenance");
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("item");
CommandList.Add("clearitems");
CommandList.Add("heal");
CommandList.Add("whisper");
CommandList.Add("annoy");
CommandList.Add("immunetokick");
CommandList.Add("immunetoban");
CommandList.Add("usebanneditem");
CommandList.Add("canregister");
CommandList.Add("canlogin");
CommandList.Add("canchangepassword");
CommandList.Add("canpartychat");
CommandList.Add("cantalkinthird");
CommandList.Add("candisplayplaying");
foreach (string command in CommandList)
{
if (!TShockDBEditor.CommandList.Contains(command))
TShockDBEditor.CommandList.Add(command);
}
}
}
}

View file

@ -1,63 +0,0 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2012 The TShock Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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();
}
}
}

View file

@ -1,41 +0,0 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2012 The TShock Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}
}
}

View file

@ -1,359 +0,0 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2012 The TShock Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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");
}
}
}

1152
DBEditor/Main.Designer.cs generated

File diff suppressed because it is too large Load diff

View file

@ -1,777 +0,0 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2012 The TShock Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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 System.Security.Cryptography;
using Mono.Data.Sqlite;
using MySql.Data.MySqlClient;
using System.Windows.Forms;
namespace TShockDBEditor
{
public partial class TShockDBEditor : Form
{
public OpenFileDialog dialog = new OpenFileDialog();
public List<Group> groups = new List<Group>();
public static List<string> CommandList = new List<string>();
public IDbConnection DB;
public string dbtype = "";
public TShockDBEditor()
{
InitializeComponent();
Itemlist.AddItems();
dialog.FileOk += new CancelEventHandler(dialog_FileOk);
dialog.Filter = "SQLite Database (*.sqlite)|*.sqlite";
}
public void LoadDB()
{
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";
lst_groupList.Items.Add("superadmin");
lst_usergrplist.Items.Add("superadmin");
lst_newusergrplist.Items.Add("superadmin");
using (var reader = com.ExecuteReader())
{
while (reader.Read())
{
lst_groupList.Items.Add(reader.Get<string>("GroupName"));
lst_inheritgrps.Items.Add(reader.Get<string>("GroupName"));
lst_usergrplist.Items.Add(reader.Get<string>("GroupName"));
lst_newusergrplist.Items.Add(reader.Get<string>("GroupName"));
}
}
using (var reader = com.ExecuteReader())
{
while (reader.Read())
{
foreach (string command in reader.Get<string>("Commands").Split(','))
{
if (!lst_groupList.Items.Contains(command))
if (!CommandList.Contains(command))
CommandList.Add(command);
}
}
}
TShockCommandsList.AddRemainingTShockCommands();
}
using (var com = DB.CreateCommand())
{
com.CommandText =
"SELECT * FROM Users";
using (var reader = com.ExecuteReader())
{
while (reader.Read())
{
if (reader.Get<string>("UserName") != "")
lst_userlist.Items.Add(reader.Get<string>("UserName"));
else
lst_userlist.Items.Add(reader.Get<string>("IP"));
}
}
}
using (var com = DB.CreateCommand())
{
com.CommandText =
"SELECT * FROM Bans";
using (var reader = com.ExecuteReader())
{
while (reader.Read())
{
lst_bans.Items.Add(reader.Get<string>("Name"));
}
}
}
for (int i = 0; i < Itemlist.ItemList.Count; i++)
{
if (!itemListBanned.Items.Contains(Itemlist.ItemList[i]))
itemListAvailable.Items.Add(Itemlist.ItemList[i]);
}
}
public void LoadSqliteDatabase(string path)
{
string sql = dialog.FileName;
DB = new SqliteConnection(string.Format("uri=file://{0},Version=3", sql));
DB.Open();
dbtype = "sqlite";
LoadDB();
}
public void LoadMySqlDatabase(string hostname = "localhost", string port = "3306", string database = "", string dbusername = "", string dbpassword = "")
{
DB = new MySqlConnection();
DB.ConnectionString =
"Server='" + hostname +
"';Port='" + port +
"';Database='" + database +
"';Uid='" + dbusername +
"';Pwd='" + dbpassword + "';";
DB.Open();
dbtype = "mysql";
LoadDB();
}
#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)
{
if ((string)lst_groupList.SelectedItem != "superadmin")
UpdateGroupIndex(lst_groupList.SelectedIndex);
else
lst_groupList.SelectedIndex = -1;
}
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.Count; i++)
{
if (!lst_AvailableCmds.Items.Contains(CommandList[i]))
lst_bannedCmds.Items.Add(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);
lst_usergrplist.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();
lst_usergrplist.Items.Clear();
com.CommandText =
"SELECT * FROM GroupList";
using (var reader = com.ExecuteReader())
{
while (reader.Read())
{
lst_inheritgrps.Items.Add(reader.Get<string>("GroupName"));
lst_usergrplist.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_dbusername.Text, txt_dbpassword.Text);
tabControl.Visible = true;
}
#endregion
#region BansTab
private void lst_bans_SelectedIndexChanged(object sender, EventArgs e)
{
using (var com = DB.CreateCommand())
{
if (lst_bans.SelectedIndex > -1)
{
com.CommandText =
"SELECT * FROM Bans WHERE Name=@name";
com.AddParameter("@name", lst_bans.Items[lst_bans.SelectedIndex]);
using (var reader = com.ExecuteReader())
{
if (reader.Read())
{
txt_banip.Text = reader.Get<string>("IP");
txt_banname.Text = reader.Get<string>("Name");
txt_banreason.Text = reader.Get<string>("Reason");
}
}
}
}
}
private void btn_bandelete_Click(object sender, EventArgs e)
{
using (var com = DB.CreateCommand())
{
com.CommandText =
"DELETE FROM Bans WHERE IP=@ip";
com.AddParameter("@ip", txt_banip.Text);
using (var reader = com.ExecuteReader())
{
if (reader.RecordsAffected > 0)
{
txt_banip.Text = "";
txt_banname.Text = "";
txt_banreason.Text = "";
lst_bans.Items.Remove(lst_bans.Items[lst_bans.SelectedIndex]);
}
}
}
}
private void btn_bannew_Click(object sender, EventArgs e)
{
using (var com = DB.CreateCommand())
{
if (dbtype == "sqlite")
com.CommandText = "INSERT INTO Bans (IP, Name, Reason) VALUES (@ip, @name, @reason);";
else if (dbtype == "mysql")
com.CommandText = "INSERT INTO Bans SET IP=@ip, Name=@name, Reason=@reason;";
if (txt_newbanip.Text != "" && txt_newbanname.Text != "")
{
com.AddParameter("@ip", txt_newbanip.Text);
com.AddParameter("@name", txt_newbanname.Text);
com.AddParameter("@reason", txt_newbanreason.Text);
com.ExecuteNonQuery();
lst_bans.Items.Add(txt_newbanname.Text);
txt_newbanip.Text = "";
txt_newbanname.Text = "";
txt_newbanreason.Text = "";
lbl_newbanstatus.Text = "Ban added successfully!";
}
else
lbl_newbanstatus.Text = "Required field('s) empty";
lst_bans.Items.Add(txt_newbanname.Text);
txt_newbanip.Text = "";
txt_newbanname.Text = "";
}
}
private void txt_banreason_TextChanged(object sender, EventArgs e)
{
if (txt_banip.Text != "")
{
using (var com = DB.CreateCommand())
{
com.CommandText =
"UPDATE Bans SET Reason=@reason WHERE IP=@ip";
com.AddParameter("@reason", txt_banreason.Text);
com.AddParameter("@ip", txt_banip.Text);
com.ExecuteNonQuery();
}
}
}
#endregion
#region UserTab
private void lst_userlist_SelectedIndexChanged(object sender, EventArgs e)
{
txt_username.Text = "None Selected";
txt_userip.Text = "None Selected";
lst_usergrplist.SelectedIndex = -1;
bool flag = false;
if (lst_userlist.SelectedIndex > -1)
{
using (var com = DB.CreateCommand())
{
com.CommandText =
"SELECT * FROM Users WHERE Username=@name";
com.AddParameter("@name", lst_userlist.Items[lst_userlist.SelectedIndex]);
using (var reader = com.ExecuteReader())
{
if (reader.Read())
{
txt_username.Text = reader.Get<string>("Username");
if (reader.Get<string>("IP") != "")
txt_userip.Text = reader.Get<string>("IP");
else
txt_userip.Text = "User does not have IP";
if (reader.Get<string>("Password") != "")
txt_userpass.Text = reader.Get<string>("Password");
else
txt_userpass.Text = "User does not have Pasword";
foreach (string name in lst_usergrplist.Items)
{
if (name == reader.Get<string>("Usergroup"))
{
lst_usergrplist.SelectedItem = name;
break;
}
}
}
else
flag = true;
}
}
if (flag)
{
using (var com = DB.CreateCommand())
{
com.CommandText =
"SELECT * FROM Users WHERE IP=@ip";
com.AddParameter("@ip", lst_userlist.Items[lst_userlist.SelectedIndex]);
using (var reader = com.ExecuteReader())
{
if (reader.Read())
{
if (reader.Get<string>("Password") != "")
txt_userpass.Text = reader.Get<string>("Password");
else
txt_userpass.Text = "User does not have Pasword";
txt_userip.Text = lst_userlist.Items[lst_userlist.SelectedIndex].ToString();
foreach (string name in lst_usergrplist.Items)
{
if (name == reader.Get<string>("Usergroup"))
{
lst_usergrplist.SelectedItem = name;
break;
}
}
}
}
}
}
}
}
private void lst_usergrplist_SelectedIndexChanged(object sender, EventArgs e)
{
if (lst_userlist.SelectedIndex > -1)
{
using (var com = DB.CreateCommand())
{
com.CommandText =
"UPDATE Users SET Usergroup=@group WHERE Username=@user OR IP=@ip";
com.AddParameter("@group", lst_usergrplist.SelectedItem);
com.AddParameter("@user", txt_username.Text);
com.AddParameter("@ip", txt_userip.Text);
com.ExecuteNonQuery();
}
}
}
private void btn_deluser_Click(object sender, EventArgs e)
{
if (lst_userlist.SelectedIndex > -1)
{
using (var com = DB.CreateCommand())
{
com.CommandText =
"DELETE FROM Users WHERE IP=@ip OR Username=@user";
com.AddParameter("@user", txt_username.Text);
com.AddParameter("@ip", txt_userip.Text);
com.ExecuteNonQuery();
lst_userlist.Items.Remove(lst_userlist.SelectedItem);
txt_userip.Text = "";
txt_username.Text = "";
txt_userpass.Text = "";
lst_usergrplist.SelectedIndex = -1;
lst_userlist.SelectedIndex = -1;
}
}
}
private void btn_adduser_Click(object sender, EventArgs e)
{
lbl_useraddstatus.Visible = true;
for (int i = 0; i == 0; i++)
{
if ((txt_newusername.Text == "" && txt_newuserpass.Text != ""))
{
lbl_useraddstatus.Text = "Username field cannot be empty";
break;
}
if ((txt_newusername.Text != "" && txt_newuserpass.Text == ""))
{
lbl_useraddstatus.Text = "Password field cannot be empty";
break;
}
if (txt_newuserip.Text == "" && (txt_newusername.Text == "" || txt_newuserpass.Text == ""))
{
lbl_useraddstatus.Text = "IP field cannot be empty";
break;
}
if (lst_newusergrplist.SelectedIndex == -1)
{
lbl_useraddstatus.Text = "Group must be selected";
break;
}
using (var com = DB.CreateCommand())
{
com.CommandText = "INSERT INTO Users (Username, Password, UserGroup, IP) VALUES (@name, @password, @group, @ip);";
com.AddParameter("@name", txt_newusername.Text);
com.AddParameter("@password", HashPassword(txt_newuserpass.Text));
com.AddParameter("@group", lst_newusergrplist.SelectedItem);
com.AddParameter("@ip", txt_newuserip.Text);
using (var reader = com.ExecuteReader())
{
if (reader.RecordsAffected > 0)
{
if (txt_newusername.Text != "")
lst_userlist.Items.Add(txt_newusername.Text);
else
lst_userlist.Items.Add(txt_newuserip.Text);
txt_newuserip.Text = "";
txt_newusername.Text = "";
txt_newuserpass.Text = "";
lst_newusergrplist.SelectedIndex = -1;
lbl_useraddstatus.Text = "User added successfully!";
}
else
lbl_useraddstatus.Text = "SQL error while adding user";
}
}
}
}
public static string HashPassword(string password)
{
using (var sha = new SHA512CryptoServiceProvider())
{
if (password == "")
{
return "nonexistent-password";
}
var bytes = sha.ComputeHash(Encoding.ASCII.GetBytes(password));
return bytes.Aggregate("", (s, b) => s + b.ToString("X2"));
}
}
#endregion
private void TShockDBEditor_Load(object sender, EventArgs e)
{
}
}
}

View file

@ -1,120 +0,0 @@
<?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>

View file

@ -1,39 +0,0 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2012 The TShock Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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

@ -1,53 +0,0 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2012 The TShock Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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

@ -1,81 +0,0 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2012 The TShock Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//------------------------------------------------------------------------------
// <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

@ -1,117 +0,0 @@
<?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>

View file

@ -1,44 +0,0 @@
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2012 The TShock Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//------------------------------------------------------------------------------
// <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

@ -1,7 +0,0 @@
<?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

@ -1,148 +0,0 @@
<?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>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</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="Mono.Data.Sqlite">
<HintPath>..\SqlBins\Mono.Data.Sqlite.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\SqlBins\MySql.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MySql.Web, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\SqlBins\MySql.Web.dll</HintPath>
<Private>True</Private>
</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="CommandList.cs" />
<Compile Include="Group.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>
<None Include="TShockDBEditor.licenseheader" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</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>

View file

@ -1,18 +0,0 @@
extensions: .cs
/*
TShock, a server mod for Terraria
Copyright (C) 2011-2012 The TShock Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

View file

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

View file

@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 11
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{755F5B05-0924-47E9-9563-26EB20FE3F67}"
ProjectSection(SolutionItems) = preProject
Local.testsettings = Local.testsettings
@ -9,8 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TShockAPI", "TShockAPI\TShockAPI.csproj", "{49606449-072B-4CF5-8088-AA49DA586694}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TShockDBEditor", "DBEditor\TShockDBEditor.csproj", "{F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{F3742F51-D7BF-4754-A68A-CD944D2A21FF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TShockRestTestPlugin", "TShockRestTestPlugin\TShockRestTestPlugin.csproj", "{F2FEDAFB-58DE-4611-9168-A86112C346C7}"
@ -38,16 +36,12 @@ 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
{F3742F51-D7BF-4754-A68A-CD944D2A21FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3742F51-D7BF-4754-A68A-CD944D2A21FF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{F3742F51-D7BF-4754-A68A-CD944D2A21FF}.Debug|x86.ActiveCfg = Debug|Any CPU
{F3742F51-D7BF-4754-A68A-CD944D2A21FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3742F51-D7BF-4754-A68A-CD944D2A21FF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{F3742F51-D7BF-4754-A68A-CD944D2A21FF}.Release|x86.ActiveCfg = Release|Any CPU
{F2FEDAFB-58DE-4611-9168-A86112C346C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2FEDAFB-58DE-4611-9168-A86112C346C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2FEDAFB-58DE-4611-9168-A86112C346C7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@ -58,12 +52,6 @@ Global
{F2FEDAFB-58DE-4611-9168-A86112C346C7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{F2FEDAFB-58DE-4611-9168-A86112C346C7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{F2FEDAFB-58DE-4611-9168-A86112C346C7}.Release|x86.ActiveCfg = Release|Any CPU
{F3742F51-D7BF-4754-A68A-CD944D2A21FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3742F51-D7BF-4754-A68A-CD944D2A21FF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{F3742F51-D7BF-4754-A68A-CD944D2A21FF}.Debug|x86.ActiveCfg = Debug|Any CPU
{F3742F51-D7BF-4754-A68A-CD944D2A21FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3742F51-D7BF-4754-A68A-CD944D2A21FF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{F3742F51-D7BF-4754-A68A-CD944D2A21FF}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE