diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..598dd721
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,9 @@
+root = true
+
+[*]
+end_of_line = crlf
+insert_final_newline = true
+
+[*.cs]
+indent_style = tab
+trim_trailing_whitespace = true
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..026167bb
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,5 @@
+* text=auto
+*.cs text eol=crlf
+*.sln text eol=crlf
+*.csproj text eol=crlf
+*.vsmdi text eol=crlf
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..22e6ce9b
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,9 @@
+language: c
+install:
+- sudo apt-get install mono-devel mono-gmcs nunit-console
+script:
+- xbuild ./TShockAPI/TShockAPI.csproj
+notifications:
+ irc: irc.rizon.net#tshock
+ hipchat:
+ secure: hpRLWiHF2j6O2qJOVs++aqAmryN6G5kY0SF26/rKCpQ7klhMlDZIgI1V1dbkKqlculFtW1neS0EBJyV9lmcV5b26H+KhlZYGN0j7q1VcOTM3rvtU6wW0Ap22uRLl2RrnA4kEsgDAsNouPOkyLZ19hlHAISlsId6G4+Rfqg6k+zQ=
\ No newline at end of file
diff --git a/CONTRIBUTING b/CONTRIBUTING
new file mode 100644
index 00000000..8f36fd52
--- /dev/null
+++ b/CONTRIBUTING
@@ -0,0 +1,36 @@
+### Issue Guidelines
+Please follow these simple requirements before posting an issue:
+
+1. TShock version number
+2. Any stack traces that may have happened when the issue occurred
+3. How to reproduce the issue
+
+### Pull Request Dev Guidelines
+
+These guidelines are for contributors. If you do not follow these guidelines your commits will be reverted.
+
+Required:
+- Follow the code style. We generally use microsofts except for m_ infront of private variables.
+- Do not push unfinished features to the master branch, instead create a remote branch and push to that.
+- Do not push untested code to the master branch, instead push to the test branch.
+- Document all compatibility issues in the COMPATIBILITY file. (IE file formats changing)
+- DO NOT MASS COMMIT. Commit changes as you go (without pushing). That way when you push we don't get a thousand changes with a 1-3 line commit message.
+
+Optional:
+- Build Version Increment (http://autobuildversion.codeplex.com/).
+
+----
+
+### Dev Team Guidelines
+
+These guidelines are to be followed by all developers with commit level access to this repository:
+
+- Do not, for any reason, submit code to the master branch before it hits the development branch first. If the development branch is far ahead, and a new bug fix is going out, branch master, then merge with master and remove your branch.
+ - If you are found to do this, you will be the person merging and rebasing your code to fit general-devel.
+- Prior to posting any version on the website, you must tick the version in AssemblyInfo.cs. This is the versioning formula:
+ - Major.Minor.Revision.BuildDate (tick Revision if you're fixing prior to an actual planned release)
+- Do not release any development builds on the forums without consulting another developer first.
+- __Document code prior to marking it done in JIRA__
+- Move any un-tested code to the "Needs Validation" section on JIRA prior to marking it as done.
+- Do not push changes to any branch without a proper issue being assigned in JIRA. If a feature isn't planned for this release, __it shouldn't be in the repo about to be released__.
+- Submit all pull requests to the general-devel branch prior to the master branch, or you will be ignored.
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..095ad8ea
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,36 @@
+### Issue Guidelines
+Please follow these simple requirements before posting an issue:
+
+1. TShock version number
+2. Any stack traces that may have happened when the issue occurred
+3. How to reproduce the issue
+
+### Pull Request Dev Guidelines
+
+These guidelines are for contributors. If you do not follow these guidelines your commits will be reverted.
+
+Required:
+- Follow the code style. We generally use microsofts except for m_ infront of private variables.
+- Do not push unfinished features to the master branch, instead create a remote branch and push to that.
+- Do not push untested code to the master branch, instead push to the test branch.
+- Document all compatibility issues in the COMPATIBILITY file. (IE file formats changing)
+- DO NOT MASS COMMIT. Commit changes as you go (without pushing). That way when you push we don't get a thousand changes with a 1-3 line commit message.
+
+Optional:
+- Build Version Increment (http://autobuildversion.codeplex.com/).
+
+----
+
+### Dev Team Guidelines
+
+These guidelines are to be followed by all developers with commit level access to this repository:
+
+- Do not, for any reason, submit code to the master branch before it hits the development branch first. If the development branch is far ahead, and a new bug fix is going out, branch master, then merge with master and remove your branch.
+ - If you are found to do this, you will be the person merging and rebasing your code to fit general-devel.
+- Prior to posting any version on the website, you must tick the version in AssemblyInfo.cs. This is the versioning formula:
+ - Major.Minor.Revision.BuildDate (tick Revision if you're fixing prior to an actual planned release)
+- Do not release any development builds on the forums without consulting another developer first.
+- __Document code prior to marking it done in JIRA__
+- Move any un-tested code to the "Needs Validation" section on JIRA prior to marking it as done.
+- Do not push changes to any branch without a proper issue being assigned in JIRA. If a feature isn't planned for this release, __it shouldn't be in the repo about to be released__.
+- Submit all pull requests to the general-devel branch prior to the master branch, or you will be ignored.
\ No newline at end of file
diff --git a/DBEditor/.gitignore b/DBEditor/.gitignore
deleted file mode 100644
index 4eddcb59..00000000
--- a/DBEditor/.gitignore
+++ /dev/null
@@ -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
\ No newline at end of file
diff --git a/DBEditor/CommandList.cs b/DBEditor/CommandList.cs
deleted file mode 100644
index c49c067c..00000000
--- a/DBEditor/CommandList.cs
+++ /dev/null
@@ -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 .
-*/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace TShockDBEditor
-{
- public class TShockCommandsList
- {
- public static void AddRemainingTShockCommands()
- {
- List CommandList = new List();
-
- 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);
- }
- }
- }
-}
diff --git a/DBEditor/DbExt.cs b/DBEditor/DbExt.cs
deleted file mode 100644
index 226a8971..00000000
--- a/DBEditor/DbExt.cs
+++ /dev/null
@@ -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 .
-*/
-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> ReadFuncs = new Dictionary>()
- {
- {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(this IDataReader reader, string column)
- {
- return reader.Get(reader.GetOrdinal(column));
- }
-
- public static T Get(this IDataReader reader, int column)
- {
- if (ReadFuncs.ContainsKey(typeof(T)))
- return (T)ReadFuncs[typeof(T)](reader, column);
-
- throw new NotImplementedException();
- }
- }
-}
diff --git a/DBEditor/Group.cs b/DBEditor/Group.cs
deleted file mode 100644
index 581b90ca..00000000
--- a/DBEditor/Group.cs
+++ /dev/null
@@ -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 .
-*/
-using System;
-using System.Collections.Generic;
-
-namespace TShockDBEditor
-{
- public class Group
- {
- public readonly List permissions = new List();
- private readonly List negatedpermissions = new List();
-
- 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;
- }
- }
-}
\ No newline at end of file
diff --git a/DBEditor/Itemlist.cs b/DBEditor/Itemlist.cs
deleted file mode 100644
index e3372fd8..00000000
--- a/DBEditor/Itemlist.cs
+++ /dev/null
@@ -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 .
-*/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace TShockDBEditor
-{
- public class Itemlist
- {
- public static List ItemList = new List();
-
- 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");
- }
- }
-}
diff --git a/DBEditor/Main.Designer.cs b/DBEditor/Main.Designer.cs
deleted file mode 100644
index a5824913..00000000
--- a/DBEditor/Main.Designer.cs
+++ /dev/null
@@ -1,1152 +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 .
-*/
-namespace TShockDBEditor
-{
- partial class TShockDBEditor
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- 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.groupBox2 = new System.Windows.Forms.GroupBox();
- this.label12 = new System.Windows.Forms.Label();
- this.btn_deletegroup = new System.Windows.Forms.Button();
- this.lbl_grpchild = new System.Windows.Forms.Label();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.label11 = new System.Windows.Forms.Label();
- this.btn_newgroup = new System.Windows.Forms.Button();
- this.txt_grpname = new System.Windows.Forms.TextBox();
- this.lst_inheritgrps = new System.Windows.Forms.ComboBox();
- this.label10 = new System.Windows.Forms.Label();
- 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.tabPage5 = new System.Windows.Forms.TabPage();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.lbl_useraddstatus = new System.Windows.Forms.Label();
- this.btn_adduser = new System.Windows.Forms.Button();
- this.label20 = new System.Windows.Forms.Label();
- this.label22 = new System.Windows.Forms.Label();
- this.txt_newusername = new System.Windows.Forms.TextBox();
- this.txt_newuserpass = new System.Windows.Forms.TextBox();
- this.txt_newuserip = new System.Windows.Forms.TextBox();
- this.lst_newusergrplist = new System.Windows.Forms.ComboBox();
- this.label24 = new System.Windows.Forms.Label();
- this.label25 = new System.Windows.Forms.Label();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.label13 = new System.Windows.Forms.Label();
- this.btn_deluser = new System.Windows.Forms.Button();
- this.label23 = new System.Windows.Forms.Label();
- this.txt_username = new System.Windows.Forms.TextBox();
- this.txt_userpass = new System.Windows.Forms.TextBox();
- this.txt_userip = new System.Windows.Forms.TextBox();
- this.lst_usergrplist = new System.Windows.Forms.ComboBox();
- this.label21 = new System.Windows.Forms.Label();
- this.label14 = new System.Windows.Forms.Label();
- this.lst_userlist = new System.Windows.Forms.ListBox();
- this.tabPage6 = new System.Windows.Forms.TabPage();
- this.groupBox7 = new System.Windows.Forms.GroupBox();
- this.lst_bans = new System.Windows.Forms.ListBox();
- this.groupBox6 = new System.Windows.Forms.GroupBox();
- this.lbl_newbanstatus = new System.Windows.Forms.Label();
- this.label16 = new System.Windows.Forms.Label();
- this.btn_bannew = new System.Windows.Forms.Button();
- this.txt_newbanip = new System.Windows.Forms.TextBox();
- this.txt_newbanreason = new System.Windows.Forms.TextBox();
- this.txt_newbanname = new System.Windows.Forms.TextBox();
- this.label27 = new System.Windows.Forms.Label();
- this.label26 = new System.Windows.Forms.Label();
- this.groupBox5 = new System.Windows.Forms.GroupBox();
- this.label17 = new System.Windows.Forms.Label();
- this.txt_banip = new System.Windows.Forms.TextBox();
- this.btn_bandelete = new System.Windows.Forms.Button();
- this.txt_banname = new System.Windows.Forms.TextBox();
- this.label19 = new System.Windows.Forms.Label();
- this.txt_banreason = new System.Windows.Forms.TextBox();
- this.label18 = new System.Windows.Forms.Label();
- 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_dbpassword = new System.Windows.Forms.TextBox();
- this.label8 = new System.Windows.Forms.Label();
- this.txt_dbusername = 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.tabControl.SuspendLayout();
- this.tabPage1.SuspendLayout();
- this.tabPage2.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.groupBox1.SuspendLayout();
- this.tabPage5.SuspendLayout();
- this.groupBox4.SuspendLayout();
- this.groupBox3.SuspendLayout();
- this.tabPage6.SuspendLayout();
- this.groupBox7.SuspendLayout();
- this.groupBox6.SuspendLayout();
- this.groupBox5.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.Controls.Add(this.tabPage5);
- this.tabControl.Controls.Add(this.tabPage6);
- 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, 108);
- 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, 79);
- 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, 195);
- 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, 166);
- 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.groupBox2);
- this.tabPage2.Controls.Add(this.groupBox1);
- 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;
- //
- // groupBox2
- //
- this.groupBox2.Controls.Add(this.label12);
- this.groupBox2.Controls.Add(this.btn_deletegroup);
- this.groupBox2.Controls.Add(this.lbl_grpchild);
- this.groupBox2.Location = new System.Drawing.Point(222, 6);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(374, 54);
- this.groupBox2.TabIndex = 27;
- this.groupBox2.TabStop = false;
- this.groupBox2.Text = "Selected Group";
- //
- // label12
- //
- this.label12.AutoSize = true;
- this.label12.Location = new System.Drawing.Point(6, 26);
- this.label12.Name = "label12";
- this.label12.Size = new System.Drawing.Size(65, 13);
- this.label12.TabIndex = 24;
- this.label12.Text = "Group Child:";
- //
- // btn_deletegroup
- //
- this.btn_deletegroup.Location = new System.Drawing.Point(183, 19);
- 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);
- //
- // lbl_grpchild
- //
- this.lbl_grpchild.AutoSize = true;
- this.lbl_grpchild.Location = new System.Drawing.Point(77, 26);
- this.lbl_grpchild.Name = "lbl_grpchild";
- this.lbl_grpchild.Size = new System.Drawing.Size(31, 13);
- this.lbl_grpchild.TabIndex = 25;
- this.lbl_grpchild.Text = "none";
- //
- // groupBox1
- //
- this.groupBox1.Controls.Add(this.label11);
- this.groupBox1.Controls.Add(this.btn_newgroup);
- this.groupBox1.Controls.Add(this.txt_grpname);
- this.groupBox1.Controls.Add(this.lst_inheritgrps);
- this.groupBox1.Controls.Add(this.label10);
- this.groupBox1.Location = new System.Drawing.Point(222, 66);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(374, 76);
- this.groupBox1.TabIndex = 26;
- this.groupBox1.TabStop = false;
- this.groupBox1.Text = "Create New Group";
- //
- // label11
- //
- this.label11.AutoSize = true;
- this.label11.Location = new System.Drawing.Point(6, 25);
- this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(65, 13);
- this.label11.TabIndex = 22;
- this.label11.Text = "Inherit From:";
- //
- // btn_newgroup
- //
- this.btn_newgroup.Location = new System.Drawing.Point(183, 47);
- 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);
- //
- // txt_grpname
- //
- this.txt_grpname.Location = new System.Drawing.Point(77, 49);
- this.txt_grpname.Name = "txt_grpname";
- this.txt_grpname.Size = new System.Drawing.Size(100, 20);
- this.txt_grpname.TabIndex = 21;
- //
- // lst_inheritgrps
- //
- this.lst_inheritgrps.FormattingEnabled = true;
- this.lst_inheritgrps.Location = new System.Drawing.Point(77, 22);
- this.lst_inheritgrps.Name = "lst_inheritgrps";
- this.lst_inheritgrps.Size = new System.Drawing.Size(100, 21);
- this.lst_inheritgrps.TabIndex = 23;
- //
- // label10
- //
- this.label10.AutoSize = true;
- this.label10.Location = new System.Drawing.Point(1, 52);
- this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(70, 13);
- this.label10.TabIndex = 20;
- this.label10.Text = "Group Name:";
- //
- // 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, 225);
- 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(290, 313);
- 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(290, 284);
- 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(290, 196);
- 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);
- //
- // tabPage5
- //
- this.tabPage5.Controls.Add(this.groupBox4);
- this.tabPage5.Controls.Add(this.groupBox3);
- this.tabPage5.Controls.Add(this.lst_userlist);
- this.tabPage5.Location = new System.Drawing.Point(4, 22);
- this.tabPage5.Name = "tabPage5";
- this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage5.Size = new System.Drawing.Size(602, 381);
- this.tabPage5.TabIndex = 2;
- this.tabPage5.Text = "User Manager";
- this.tabPage5.UseVisualStyleBackColor = true;
- //
- // groupBox4
- //
- this.groupBox4.Controls.Add(this.lbl_useraddstatus);
- this.groupBox4.Controls.Add(this.btn_adduser);
- this.groupBox4.Controls.Add(this.label20);
- this.groupBox4.Controls.Add(this.label22);
- this.groupBox4.Controls.Add(this.txt_newusername);
- this.groupBox4.Controls.Add(this.txt_newuserpass);
- this.groupBox4.Controls.Add(this.txt_newuserip);
- this.groupBox4.Controls.Add(this.lst_newusergrplist);
- this.groupBox4.Controls.Add(this.label24);
- this.groupBox4.Controls.Add(this.label25);
- this.groupBox4.Location = new System.Drawing.Point(294, 173);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new System.Drawing.Size(296, 161);
- this.groupBox4.TabIndex = 15;
- this.groupBox4.TabStop = false;
- this.groupBox4.Text = "New User";
- //
- // lbl_useraddstatus
- //
- this.lbl_useraddstatus.AutoSize = true;
- this.lbl_useraddstatus.Location = new System.Drawing.Point(87, 135);
- this.lbl_useraddstatus.Name = "lbl_useraddstatus";
- this.lbl_useraddstatus.Size = new System.Drawing.Size(146, 13);
- this.lbl_useraddstatus.TabIndex = 23;
- this.lbl_useraddstatus.Text = "Status messages display here";
- this.lbl_useraddstatus.Visible = false;
- //
- // btn_adduser
- //
- this.btn_adduser.Location = new System.Drawing.Point(6, 130);
- this.btn_adduser.Name = "btn_adduser";
- this.btn_adduser.Size = new System.Drawing.Size(75, 23);
- this.btn_adduser.TabIndex = 22;
- this.btn_adduser.Text = "Add User";
- this.btn_adduser.UseVisualStyleBackColor = true;
- this.btn_adduser.Click += new System.EventHandler(this.btn_adduser_Click);
- //
- // label20
- //
- this.label20.AutoSize = true;
- this.label20.Location = new System.Drawing.Point(6, 28);
- this.label20.Name = "label20";
- this.label20.Size = new System.Drawing.Size(63, 13);
- this.label20.TabIndex = 14;
- this.label20.Text = "User Name:";
- //
- // label22
- //
- this.label22.AutoSize = true;
- this.label22.Location = new System.Drawing.Point(13, 107);
- this.label22.Name = "label22";
- this.label22.Size = new System.Drawing.Size(56, 13);
- this.label22.TabIndex = 21;
- this.label22.Text = "Password:";
- //
- // txt_newusername
- //
- this.txt_newusername.Location = new System.Drawing.Point(75, 25);
- this.txt_newusername.Name = "txt_newusername";
- this.txt_newusername.Size = new System.Drawing.Size(221, 20);
- this.txt_newusername.TabIndex = 18;
- //
- // txt_newuserpass
- //
- this.txt_newuserpass.Location = new System.Drawing.Point(75, 104);
- this.txt_newuserpass.Name = "txt_newuserpass";
- this.txt_newuserpass.Size = new System.Drawing.Size(221, 20);
- this.txt_newuserpass.TabIndex = 19;
- //
- // txt_newuserip
- //
- this.txt_newuserip.Location = new System.Drawing.Point(75, 78);
- this.txt_newuserip.Name = "txt_newuserip";
- this.txt_newuserip.Size = new System.Drawing.Size(221, 20);
- this.txt_newuserip.TabIndex = 20;
- //
- // lst_newusergrplist
- //
- this.lst_newusergrplist.FormattingEnabled = true;
- this.lst_newusergrplist.Location = new System.Drawing.Point(75, 51);
- this.lst_newusergrplist.Name = "lst_newusergrplist";
- this.lst_newusergrplist.Size = new System.Drawing.Size(221, 21);
- this.lst_newusergrplist.TabIndex = 16;
- //
- // label24
- //
- this.label24.AutoSize = true;
- this.label24.Location = new System.Drawing.Point(49, 81);
- this.label24.Name = "label24";
- this.label24.Size = new System.Drawing.Size(20, 13);
- this.label24.TabIndex = 17;
- this.label24.Text = "IP:";
- //
- // label25
- //
- this.label25.AutoSize = true;
- this.label25.Location = new System.Drawing.Point(30, 54);
- this.label25.Name = "label25";
- this.label25.Size = new System.Drawing.Size(39, 13);
- this.label25.TabIndex = 15;
- this.label25.Text = "Group:";
- //
- // groupBox3
- //
- this.groupBox3.Controls.Add(this.label13);
- this.groupBox3.Controls.Add(this.btn_deluser);
- this.groupBox3.Controls.Add(this.label23);
- this.groupBox3.Controls.Add(this.txt_username);
- this.groupBox3.Controls.Add(this.txt_userpass);
- this.groupBox3.Controls.Add(this.txt_userip);
- this.groupBox3.Controls.Add(this.lst_usergrplist);
- this.groupBox3.Controls.Add(this.label21);
- this.groupBox3.Controls.Add(this.label14);
- this.groupBox3.Location = new System.Drawing.Point(294, 7);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(302, 159);
- this.groupBox3.TabIndex = 14;
- this.groupBox3.TabStop = false;
- this.groupBox3.Text = "Current User";
- //
- // label13
- //
- this.label13.AutoSize = true;
- this.label13.Location = new System.Drawing.Point(6, 26);
- this.label13.Name = "label13";
- this.label13.Size = new System.Drawing.Size(63, 13);
- this.label13.TabIndex = 1;
- this.label13.Text = "User Name:";
- //
- // btn_deluser
- //
- this.btn_deluser.Location = new System.Drawing.Point(6, 128);
- this.btn_deluser.Name = "btn_deluser";
- this.btn_deluser.Size = new System.Drawing.Size(75, 23);
- this.btn_deluser.TabIndex = 8;
- this.btn_deluser.Text = "Delete User";
- this.btn_deluser.UseVisualStyleBackColor = true;
- this.btn_deluser.Click += new System.EventHandler(this.btn_deluser_Click);
- //
- // label23
- //
- this.label23.AutoSize = true;
- this.label23.Location = new System.Drawing.Point(13, 105);
- this.label23.Name = "label23";
- this.label23.Size = new System.Drawing.Size(56, 13);
- this.label23.TabIndex = 13;
- this.label23.Text = "Password:";
- //
- // txt_username
- //
- this.txt_username.Location = new System.Drawing.Point(75, 23);
- this.txt_username.Name = "txt_username";
- this.txt_username.ReadOnly = true;
- this.txt_username.Size = new System.Drawing.Size(221, 20);
- this.txt_username.TabIndex = 9;
- //
- // txt_userpass
- //
- this.txt_userpass.Location = new System.Drawing.Point(75, 102);
- this.txt_userpass.Name = "txt_userpass";
- this.txt_userpass.ReadOnly = true;
- this.txt_userpass.Size = new System.Drawing.Size(221, 20);
- this.txt_userpass.TabIndex = 10;
- //
- // txt_userip
- //
- this.txt_userip.Location = new System.Drawing.Point(75, 76);
- this.txt_userip.Name = "txt_userip";
- this.txt_userip.ReadOnly = true;
- this.txt_userip.Size = new System.Drawing.Size(221, 20);
- this.txt_userip.TabIndex = 12;
- //
- // lst_usergrplist
- //
- this.lst_usergrplist.FormattingEnabled = true;
- this.lst_usergrplist.Location = new System.Drawing.Point(75, 49);
- this.lst_usergrplist.Name = "lst_usergrplist";
- this.lst_usergrplist.Size = new System.Drawing.Size(221, 21);
- this.lst_usergrplist.TabIndex = 4;
- this.lst_usergrplist.SelectedIndexChanged += new System.EventHandler(this.lst_usergrplist_SelectedIndexChanged);
- //
- // label21
- //
- this.label21.AutoSize = true;
- this.label21.Location = new System.Drawing.Point(49, 79);
- this.label21.Name = "label21";
- this.label21.Size = new System.Drawing.Size(20, 13);
- this.label21.TabIndex = 6;
- this.label21.Text = "IP:";
- //
- // label14
- //
- this.label14.AutoSize = true;
- this.label14.Location = new System.Drawing.Point(30, 52);
- this.label14.Name = "label14";
- this.label14.Size = new System.Drawing.Size(39, 13);
- this.label14.TabIndex = 3;
- this.label14.Text = "Group:";
- //
- // lst_userlist
- //
- this.lst_userlist.FormattingEnabled = true;
- this.lst_userlist.Location = new System.Drawing.Point(9, 7);
- this.lst_userlist.Name = "lst_userlist";
- this.lst_userlist.Size = new System.Drawing.Size(275, 368);
- this.lst_userlist.TabIndex = 0;
- this.lst_userlist.SelectedIndexChanged += new System.EventHandler(this.lst_userlist_SelectedIndexChanged);
- //
- // tabPage6
- //
- this.tabPage6.Controls.Add(this.groupBox7);
- this.tabPage6.Controls.Add(this.groupBox6);
- this.tabPage6.Controls.Add(this.groupBox5);
- this.tabPage6.Location = new System.Drawing.Point(4, 22);
- this.tabPage6.Name = "tabPage6";
- this.tabPage6.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage6.Size = new System.Drawing.Size(602, 381);
- this.tabPage6.TabIndex = 3;
- this.tabPage6.Text = "Ban Manager";
- this.tabPage6.UseVisualStyleBackColor = true;
- //
- // groupBox7
- //
- this.groupBox7.Controls.Add(this.lst_bans);
- this.groupBox7.Location = new System.Drawing.Point(6, 23);
- this.groupBox7.Name = "groupBox7";
- this.groupBox7.Size = new System.Drawing.Size(284, 352);
- this.groupBox7.TabIndex = 13;
- this.groupBox7.TabStop = false;
- this.groupBox7.Text = "Ban List";
- //
- // lst_bans
- //
- this.lst_bans.FormattingEnabled = true;
- this.lst_bans.Location = new System.Drawing.Point(6, 19);
- this.lst_bans.Name = "lst_bans";
- this.lst_bans.Size = new System.Drawing.Size(272, 329);
- this.lst_bans.TabIndex = 0;
- this.lst_bans.SelectedIndexChanged += new System.EventHandler(this.lst_bans_SelectedIndexChanged);
- //
- // groupBox6
- //
- this.groupBox6.Controls.Add(this.lbl_newbanstatus);
- this.groupBox6.Controls.Add(this.label16);
- this.groupBox6.Controls.Add(this.btn_bannew);
- this.groupBox6.Controls.Add(this.txt_newbanip);
- this.groupBox6.Controls.Add(this.txt_newbanreason);
- this.groupBox6.Controls.Add(this.txt_newbanname);
- this.groupBox6.Controls.Add(this.label27);
- this.groupBox6.Controls.Add(this.label26);
- this.groupBox6.Location = new System.Drawing.Point(296, 165);
- this.groupBox6.Name = "groupBox6";
- this.groupBox6.Size = new System.Drawing.Size(300, 137);
- this.groupBox6.TabIndex = 12;
- this.groupBox6.TabStop = false;
- this.groupBox6.Text = "New Ban";
- //
- // lbl_newbanstatus
- //
- this.lbl_newbanstatus.AutoSize = true;
- this.lbl_newbanstatus.Location = new System.Drawing.Point(90, 113);
- this.lbl_newbanstatus.Name = "lbl_newbanstatus";
- this.lbl_newbanstatus.Size = new System.Drawing.Size(146, 13);
- this.lbl_newbanstatus.TabIndex = 16;
- this.lbl_newbanstatus.Text = "Status messages display here";
- this.lbl_newbanstatus.Visible = false;
- //
- // label16
- //
- this.label16.AutoSize = true;
- this.label16.Location = new System.Drawing.Point(2, 33);
- this.label16.Name = "label16";
- this.label16.Size = new System.Drawing.Size(65, 13);
- this.label16.TabIndex = 10;
- this.label16.Text = "*IP Address:";
- //
- // btn_bannew
- //
- this.btn_bannew.Location = new System.Drawing.Point(9, 108);
- this.btn_bannew.Name = "btn_bannew";
- this.btn_bannew.Size = new System.Drawing.Size(75, 23);
- this.btn_bannew.TabIndex = 10;
- this.btn_bannew.Text = "New Ban";
- this.btn_bannew.UseVisualStyleBackColor = true;
- this.btn_bannew.Click += new System.EventHandler(this.btn_bannew_Click);
- //
- // txt_newbanip
- //
- this.txt_newbanip.Location = new System.Drawing.Point(73, 30);
- this.txt_newbanip.Name = "txt_newbanip";
- this.txt_newbanip.Size = new System.Drawing.Size(221, 20);
- this.txt_newbanip.TabIndex = 13;
- //
- // txt_newbanreason
- //
- this.txt_newbanreason.Location = new System.Drawing.Point(74, 82);
- this.txt_newbanreason.Multiline = true;
- this.txt_newbanreason.Name = "txt_newbanreason";
- this.txt_newbanreason.Size = new System.Drawing.Size(220, 20);
- this.txt_newbanreason.TabIndex = 15;
- //
- // txt_newbanname
- //
- this.txt_newbanname.Location = new System.Drawing.Point(74, 56);
- this.txt_newbanname.Name = "txt_newbanname";
- this.txt_newbanname.Size = new System.Drawing.Size(220, 20);
- this.txt_newbanname.TabIndex = 14;
- //
- // label27
- //
- this.label27.AutoSize = true;
- this.label27.Location = new System.Drawing.Point(25, 59);
- this.label27.Name = "label27";
- this.label27.Size = new System.Drawing.Size(42, 13);
- this.label27.TabIndex = 11;
- this.label27.Text = "*Name:";
- //
- // label26
- //
- this.label26.AutoSize = true;
- this.label26.Location = new System.Drawing.Point(21, 85);
- this.label26.Name = "label26";
- this.label26.Size = new System.Drawing.Size(47, 13);
- this.label26.TabIndex = 12;
- this.label26.Text = "Reason:";
- //
- // groupBox5
- //
- this.groupBox5.Controls.Add(this.label17);
- this.groupBox5.Controls.Add(this.txt_banip);
- this.groupBox5.Controls.Add(this.btn_bandelete);
- this.groupBox5.Controls.Add(this.txt_banname);
- this.groupBox5.Controls.Add(this.label19);
- this.groupBox5.Controls.Add(this.txt_banreason);
- this.groupBox5.Controls.Add(this.label18);
- this.groupBox5.Location = new System.Drawing.Point(296, 23);
- this.groupBox5.Name = "groupBox5";
- this.groupBox5.Size = new System.Drawing.Size(300, 129);
- this.groupBox5.TabIndex = 11;
- this.groupBox5.TabStop = false;
- this.groupBox5.Text = "Selected Ban";
- //
- // label17
- //
- this.label17.AutoSize = true;
- this.label17.Location = new System.Drawing.Point(6, 26);
- this.label17.Name = "label17";
- this.label17.Size = new System.Drawing.Size(61, 13);
- this.label17.TabIndex = 3;
- this.label17.Text = "IP Address:";
- //
- // txt_banip
- //
- this.txt_banip.Location = new System.Drawing.Point(73, 23);
- this.txt_banip.Name = "txt_banip";
- this.txt_banip.ReadOnly = true;
- this.txt_banip.Size = new System.Drawing.Size(221, 20);
- this.txt_banip.TabIndex = 6;
- //
- // btn_bandelete
- //
- this.btn_bandelete.Location = new System.Drawing.Point(9, 100);
- this.btn_bandelete.Name = "btn_bandelete";
- this.btn_bandelete.Size = new System.Drawing.Size(75, 23);
- this.btn_bandelete.TabIndex = 9;
- this.btn_bandelete.Text = "Delete Ban";
- this.btn_bandelete.UseVisualStyleBackColor = true;
- this.btn_bandelete.Click += new System.EventHandler(this.btn_bandelete_Click);
- //
- // txt_banname
- //
- this.txt_banname.Location = new System.Drawing.Point(74, 49);
- this.txt_banname.Name = "txt_banname";
- this.txt_banname.ReadOnly = true;
- this.txt_banname.Size = new System.Drawing.Size(220, 20);
- this.txt_banname.TabIndex = 7;
- //
- // label19
- //
- this.label19.AutoSize = true;
- this.label19.Location = new System.Drawing.Point(21, 78);
- this.label19.Name = "label19";
- this.label19.Size = new System.Drawing.Size(47, 13);
- this.label19.TabIndex = 5;
- this.label19.Text = "Reason:";
- //
- // txt_banreason
- //
- this.txt_banreason.Location = new System.Drawing.Point(74, 75);
- this.txt_banreason.Multiline = true;
- this.txt_banreason.Name = "txt_banreason";
- this.txt_banreason.Size = new System.Drawing.Size(220, 20);
- this.txt_banreason.TabIndex = 8;
- this.txt_banreason.TextChanged += new System.EventHandler(this.txt_banreason_TextChanged);
- //
- // label18
- //
- this.label18.AutoSize = true;
- this.label18.Location = new System.Drawing.Point(30, 52);
- this.label18.Name = "label18";
- this.label18.Size = new System.Drawing.Size(38, 13);
- this.label18.TabIndex = 4;
- this.label18.Text = "Name:";
- //
- // 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_dbpassword);
- this.tabPage4.Controls.Add(this.label8);
- this.tabPage4.Controls.Add(this.txt_dbusername);
- 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_dbpassword
- //
- this.txt_dbpassword.Location = new System.Drawing.Point(272, 33);
- this.txt_dbpassword.Name = "txt_dbpassword";
- this.txt_dbpassword.Size = new System.Drawing.Size(100, 20);
- this.txt_dbpassword.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_dbusername
- //
- this.txt_dbusername.Location = new System.Drawing.Point(272, 7);
- this.txt_dbusername.Name = "txt_dbusername";
- this.txt_dbusername.Size = new System.Drawing.Size(100, 20);
- this.txt_dbusername.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:";
- //
- // 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.Load += new System.EventHandler(this.TShockDBEditor_Load);
- this.tabControl.ResumeLayout(false);
- this.tabPage1.ResumeLayout(false);
- this.tabPage1.PerformLayout();
- this.tabPage2.ResumeLayout(false);
- this.tabPage2.PerformLayout();
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.tabPage5.ResumeLayout(false);
- this.groupBox4.ResumeLayout(false);
- this.groupBox4.PerformLayout();
- this.groupBox3.ResumeLayout(false);
- this.groupBox3.PerformLayout();
- this.tabPage6.ResumeLayout(false);
- this.groupBox7.ResumeLayout(false);
- this.groupBox6.ResumeLayout(false);
- this.groupBox6.PerformLayout();
- this.groupBox5.ResumeLayout(false);
- this.groupBox5.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_dbpassword;
- private System.Windows.Forms.Label label8;
- private System.Windows.Forms.TextBox txt_dbusername;
- 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;
- private System.Windows.Forms.TabPage tabPage5;
- private System.Windows.Forms.Label label14;
- private System.Windows.Forms.Label label13;
- private System.Windows.Forms.ListBox lst_userlist;
- private System.Windows.Forms.ComboBox lst_usergrplist;
- private System.Windows.Forms.TabPage tabPage6;
- private System.Windows.Forms.ListBox lst_bans;
- private System.Windows.Forms.Label label18;
- private System.Windows.Forms.Label label17;
- private System.Windows.Forms.TextBox txt_banreason;
- private System.Windows.Forms.TextBox txt_banname;
- private System.Windows.Forms.TextBox txt_banip;
- private System.Windows.Forms.Label label19;
- private System.Windows.Forms.Button btn_bannew;
- private System.Windows.Forms.Button btn_bandelete;
- private System.Windows.Forms.Label label21;
- private System.Windows.Forms.Button btn_deluser;
- private System.Windows.Forms.Label label23;
- private System.Windows.Forms.TextBox txt_userip;
- private System.Windows.Forms.TextBox txt_userpass;
- private System.Windows.Forms.TextBox txt_username;
- private System.Windows.Forms.GroupBox groupBox2;
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.GroupBox groupBox3;
- private System.Windows.Forms.GroupBox groupBox4;
- private System.Windows.Forms.Button btn_adduser;
- private System.Windows.Forms.Label label20;
- private System.Windows.Forms.Label label22;
- private System.Windows.Forms.TextBox txt_newusername;
- private System.Windows.Forms.TextBox txt_newuserpass;
- private System.Windows.Forms.TextBox txt_newuserip;
- private System.Windows.Forms.ComboBox lst_newusergrplist;
- private System.Windows.Forms.Label label24;
- private System.Windows.Forms.Label label25;
- private System.Windows.Forms.Label lbl_useraddstatus;
- private System.Windows.Forms.GroupBox groupBox6;
- private System.Windows.Forms.GroupBox groupBox5;
- private System.Windows.Forms.Label label16;
- private System.Windows.Forms.TextBox txt_newbanip;
- private System.Windows.Forms.TextBox txt_newbanreason;
- private System.Windows.Forms.TextBox txt_newbanname;
- private System.Windows.Forms.Label label27;
- private System.Windows.Forms.Label label26;
- private System.Windows.Forms.Label lbl_newbanstatus;
- private System.Windows.Forms.GroupBox groupBox7;
- }
-}
-
diff --git a/DBEditor/Main.cs b/DBEditor/Main.cs
deleted file mode 100644
index 81d21f04..00000000
--- a/DBEditor/Main.cs
+++ /dev/null
@@ -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 .
-*/
-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 groups = new List();
- public static List CommandList = new List();
- 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("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("GroupName"));
- lst_inheritgrps.Items.Add(reader.Get("GroupName"));
- lst_usergrplist.Items.Add(reader.Get("GroupName"));
- lst_newusergrplist.Items.Add(reader.Get("GroupName"));
- }
- }
-
- using (var reader = com.ExecuteReader())
- {
- while (reader.Read())
- {
- foreach (string command in reader.Get("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("UserName") != "")
- lst_userlist.Items.Add(reader.Get("UserName"));
- else
- lst_userlist.Items.Add(reader.Get("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("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("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("GroupName"));
- lst_usergrplist.Items.Add(reader.Get("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("IP");
- txt_banname.Text = reader.Get("Name");
- txt_banreason.Text = reader.Get("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("Username");
-
- if (reader.Get("IP") != "")
- txt_userip.Text = reader.Get("IP");
- else
- txt_userip.Text = "User does not have IP";
-
- if (reader.Get("Password") != "")
- txt_userpass.Text = reader.Get("Password");
- else
- txt_userpass.Text = "User does not have Pasword";
-
- foreach (string name in lst_usergrplist.Items)
- {
- if (name == reader.Get("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("Password") != "")
- txt_userpass.Text = reader.Get("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("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)
- {
-
- }
- }
-}
\ No newline at end of file
diff --git a/DBEditor/Main.resx b/DBEditor/Main.resx
deleted file mode 100644
index 1af7de15..00000000
--- a/DBEditor/Main.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/DBEditor/Properties/AssemblyInfo.cs b/DBEditor/Properties/AssemblyInfo.cs
deleted file mode 100644
index 80567a20..00000000
--- a/DBEditor/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -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 .
-*/
-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")]
diff --git a/DBEditor/Properties/Resources.Designer.cs b/DBEditor/Properties/Resources.Designer.cs
deleted file mode 100644
index ef2100a0..00000000
--- a/DBEditor/Properties/Resources.Designer.cs
+++ /dev/null
@@ -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 .
-*/
-
-//------------------------------------------------------------------------------
-//
-// 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.
-//
-//------------------------------------------------------------------------------
-
-namespace TShockDBEditor.Properties {
- using System;
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // 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() {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [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;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/DBEditor/Properties/Resources.resx b/DBEditor/Properties/Resources.resx
deleted file mode 100644
index af7dbebb..00000000
--- a/DBEditor/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/DBEditor/Properties/Settings.Designer.cs b/DBEditor/Properties/Settings.Designer.cs
deleted file mode 100644
index 0288467b..00000000
--- a/DBEditor/Properties/Settings.Designer.cs
+++ /dev/null
@@ -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 .
-*/
-
-//------------------------------------------------------------------------------
-//
-// 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.
-//
-//------------------------------------------------------------------------------
-
-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;
- }
- }
- }
-}
diff --git a/DBEditor/Properties/Settings.settings b/DBEditor/Properties/Settings.settings
deleted file mode 100644
index 39645652..00000000
--- a/DBEditor/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/DBEditor/TShockDBEditor.csproj b/DBEditor/TShockDBEditor.csproj
deleted file mode 100644
index 25b8d7d8..00000000
--- a/DBEditor/TShockDBEditor.csproj
+++ /dev/null
@@ -1,148 +0,0 @@
-
-
-
- Debug
- x86
- 8.0.30703
- 2.0
- {F1AE395C-6B4D-40E0-8BF8-0D8A126488D3}
- WinExe
- Properties
- TShockDBEditor
- TShockDBEditor
- v4.0
-
-
- 512
- false
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- true
-
-
- x86
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- x86
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- ..\SqlBins\Mono.Data.Sqlite.dll
-
-
- False
- ..\SqlBins\MySql.Data.dll
- True
-
-
- False
- ..\SqlBins\MySql.Web.dll
- True
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Form
-
-
- Main.cs
-
-
-
-
-
- Main.cs
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- True
- Resources.resx
- True
-
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
- True
- Settings.settings
- True
-
-
-
-
-
-
-
-
- False
- Microsoft .NET Framework 4 %28x86 and x64%29
- true
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- false
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
-
\ No newline at end of file
diff --git a/DBEditor/TShockDBEditor.licenseheader b/DBEditor/TShockDBEditor.licenseheader
deleted file mode 100644
index 12ed0ea9..00000000
--- a/DBEditor/TShockDBEditor.licenseheader
+++ /dev/null
@@ -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 .
-*/
\ No newline at end of file
diff --git a/DBEditor/app.config b/DBEditor/app.config
deleted file mode 100644
index e3656033..00000000
--- a/DBEditor/app.config
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/README.md b/README.md
index 0eae0b9a..a993e427 100644
--- a/README.md
+++ b/README.md
@@ -1,63 +1,27 @@
-TShock is a server modification for Terraria.
+# TShock [](https://travis-ci.org/NyxStudios/TShock)
-__Continuous Integration__: http://ci.tshock.co/
+TShock is a server modification for Terraria, written in C#, and based upon the [Terraria Server API](https://github.com/Deathmax/TerrariaAPI-Server). It uses JSON for configuration management, and offers several features not present in the Terraria Server normally.
-__Support Forums__: http://tshock.co/
+## Features
-__Wiki__: http://ci.tshock.co:8080/
+* MySQL support
+* Permissions
+* Multiple administrators
+* Anti-cheat
+* User registration
+* Reserved slots
+* User punishment (kicking, banning, muting)
-----
+## Community
-### Helping out
+Feeling like helping out? Want to find an awesome server? Some awesome plugins?
-If you'd like to help out, the best thing you can do is to fork this repository, add changes, and request a pull back in. Try to make your changes on the latest code possible so that merging doesn't take ages, but other than that we accept any improvements or changes.
+* [Website & Forums](http://tshock.co/xf/)
+* [Wiki](https://tshock.atlassian.net/wiki/display/TSHOCKPLUGINS/Home)
+* [IRC: #tshock @ irc.rizon.net](http://tshock.co/xf/index.php?ezirc/)
-----
+## Download
-### Teamspeak
-
-We communicate on the ShankShock Temspeak server whilst programming.
-
-__IP__: ts3.shankshock.com
-
-__Port__: 9987
-
-### IRC
-
-We love IRC (although a little less than Teamspeak). If you need support, or just want to hang around, feel free to join.
-
-__IP__: irc.shankshock.com
-
-__Channel__: #terraria-dev or #terraria
-
-----
-
-### Pull Request Dev Guidelines
-
-These guidelines are for contributors. If you do not follow these guidelines your commits will be reverted.
-
-Required:
-- Follow the code style. We generally use microsofts except for m_ infront of private variables.
-- Do not push unfinished features to the master branch, instead create a remote branch and push to that.
-- Do not push untested code to the master branch, instead push to the test branch.
-- Document all compatibility issues in the COMPATIBILITY file. (IE file formats changing)
-- DO NOT MASS COMMIT. Commit changes as you go (without pushing). That way when you push we don't get a thousand changes with a 1-3 line commit message.
-
-Optional:
-- Build Version Increment (http://autobuildversion.codeplex.com/).
-
-----
-
-### Dev Team Guidelines
-
-These guidelines are to be followed by all developers with commit level access to this repository:
-
-- Do not, for any reason, submit code to the master branch before it hits the development branch first. If the development branch is far ahead, and a new bug fix is going out, branch master, then merge with master and remove your branch.
- - If you are found to do this, you will be the person merging and rebasing your code to fit general-devel.
-- Prior to posting any version on the website, you must tick the version in AssemblyInfo.cs. This is the versioning formula:
- - Major.Minor.Revision.BuildDate (tick Revision if you're fixing prior to an actual planned release)
-- Do not release any development builds on the forums without consulting another developer first.
-- __Document code prior to marking it done in JIRA__
-- Move any un-tested code to the "Needs Validation" section on JIRA prior to marking it as done.
-- Do not push changes to any branch without a proper issue being assigned in JIRA. If a feature isn't planned for this release, __it shouldn't be in the repo about to be released__.
-- Submit all pull requests to the general-devel branch prior to the master branch, or you will be ignored.
\ No newline at end of file
+* [Github Releases](https://github.com/TShock/TShock/releases)
+* [Download Archive](https://github.com/TShock/TShock/downloads)
+* [Latest Version (4.0.5)](https://s3.amazonaws.com/tshock/TShock+4.0.5.zip)
diff --git a/TShock.sln b/TShock.sln
index 7731de44..da320f87 100644
--- a/TShock.sln
+++ b/TShock.sln
@@ -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
diff --git a/TShockAPI/BackupManager.cs b/TShockAPI/BackupManager.cs
index bb51336e..bc5cec6a 100644
--- a/TShockAPI/BackupManager.cs
+++ b/TShockAPI/BackupManager.cs
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
-Copyright (C) 2011-2012 The TShock Team
+Copyright (C) 2011-2013 Nyx Studios (fka. 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
@@ -15,6 +15,7 @@ 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 .
*/
+
using System;
using System.IO;
using System.Threading;
@@ -60,22 +61,22 @@ namespace TShockAPI
if (worldpath != null && !Directory.Exists(worldpath))
Directory.CreateDirectory(worldpath);
- TShock.Utils.Broadcast("Server map saving, potential lag spike");
+ TShock.Utils.Broadcast("Server map saving, potential lag spike.");
Console.WriteLine("Backing up world...");
SaveManager.Instance.SaveWorld();
- Console.WriteLine("World backed up");
+ Console.WriteLine("World backed up.");
Console.ForegroundColor = ConsoleColor.Gray;
- Log.Info(string.Format("World backed up ({0})", Main.worldPathName));
+ Log.Info(string.Format("World backed up ({0}).", Main.worldPathName));
Main.worldPathName = worldname;
}
catch (Exception ex)
{
Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("Backup failed");
+ Console.WriteLine("Backup failed!");
Console.ForegroundColor = ConsoleColor.Gray;
- Log.Error("Backup failed");
+ Log.Error("Backup failed!");
Log.Error(ex.ToString());
}
}
diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs
index 0dc8d053..d26ac5f6 100644
--- a/TShockAPI/Commands.cs
+++ b/TShockAPI/Commands.cs
@@ -1,6 +1,6 @@
/*
TShock, a server mod for Terraria
-Copyright (C) 2011-2012 The TShock Team
+Copyright (C) 2011-2013 Nyx Studios (fka. 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
@@ -15,18 +15,18 @@ 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 .
*/
+
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
-using System.Net;
using System.Text;
using System.Threading;
+using TShockAPI.PluginUpdater;
using Terraria;
using TShockAPI.DB;
-using System.Reflection;
namespace TShockAPI
{
@@ -64,38 +64,60 @@ namespace TShockAPI
}
public List Names { get; protected set; }
+ public bool AllowServer { get; set; }
public bool DoLog { get; set; }
- public string Permission { get; protected set; }
- private CommandDelegate command;
+ public List Permissions { get; protected set; }
+
+ private CommandDelegate commandDelegate;
+ public CommandDelegate CommandDelegate
+ {
+ get { return commandDelegate; }
+ set
+ {
+ if (value == null)
+ throw new ArgumentNullException();
+
+ commandDelegate = value;
+ }
+ }
+
+ public Command(List permissionsneeded, CommandDelegate cmd, params string[] names)
+ : this(cmd, names)
+ {
+ Permissions = permissionsneeded;
+ }
public Command(string permissionneeded, CommandDelegate cmd, params string[] names)
: this(cmd, names)
{
- Permission = permissionneeded;
+ Permissions = new List { permissionneeded };
}
public Command(CommandDelegate cmd, params string[] names)
{
+ if (cmd == null)
+ throw new ArgumentNullException("cmd");
if (names == null || names.Length < 1)
- throw new NotSupportedException();
- Permission = null;
+ throw new ArgumentException("names");
+ Permissions = new List();
Names = new List(names);
- command = cmd;
+ CommandDelegate = cmd;
+ AllowServer = true;
DoLog = true;
}
public bool Run(string msg, TSPlayer ply, List parms)
{
- if (!ply.Group.HasPermission(Permission))
+ if (!CanRun(ply))
return false;
try
{
- command(new CommandArgs(msg, ply, parms));
+ CommandDelegate(new CommandArgs(msg, ply, parms));
}
catch (Exception e)
{
- ply.SendMessage("Command failed, check logs for more details.");
+ ply.SendErrorMessage("Command failed, check logs for more details.");
Log.Error(e.ToString());
}
@@ -109,54 +131,80 @@ namespace TShockAPI
public bool CanRun(TSPlayer ply)
{
- return ply.Group.HasPermission(Permission);
+ if (Permissions == null || Permissions.Count < 1)
+ return true;
+ foreach (var Permission in Permissions)
+ {
+ if (ply.Group.HasPermission(Permission))
+ return true;
+ }
+ return false;
}
}
public static class Commands
{
public static List ChatCommands = new List();
+ public static ReadOnlyCollection TShockCommands = new ReadOnlyCollection(new List());
private delegate void AddChatCommand(string permission, CommandDelegate command, params string[] names);
public static void InitCommands()
{
- AddChatCommand add = (p, c, n) => ChatCommands.Add(new Command(p, c, n));
- ChatCommands.Add(new Command(Permissions.canchangepassword, PasswordUser, "password") { DoLog = false });
- ChatCommands.Add(new Command(Permissions.canregister, RegisterUser, "register") { DoLog = false });
- ChatCommands.Add(new Command(Permissions.rootonly, ManageUsers, "user") { DoLog = false });
- ChatCommands.Add(new Command(Permissions.canlogin, AttemptLogin, "login") { DoLog = false });
+ List tshockCommands = new List(100);
+ Action add2 = (cmd) =>
+ {
+ tshockCommands.Add(cmd);
+ ChatCommands.Add(cmd);
+ };
+ AddChatCommand add = (p, c, n) => add2(new Command(p, c, n));
+
+ add2(new Command(AuthToken, "auth") { AllowServer = false });
+ add2(new Command(Permissions.canchangepassword, PasswordUser, "password") { AllowServer = false, DoLog = false });
+ add2(new Command(Permissions.canregister, RegisterUser, "register") { AllowServer = false, DoLog = false });
+ add2(new Command(Permissions.rootonly, ManageUsers, "user") { DoLog = false });
+ add2(new Command(Permissions.canlogin, AttemptLogin, "login") { AllowServer = false, DoLog = false });
+ add2(new Command(Permissions.buff, Buff, "buff") { AllowServer = false });
+ add2(new Command(Permissions.cfg, SetSpawn, "setspawn") { AllowServer = false });
+ add2(new Command(Permissions.grow, Grow, "grow") { AllowServer = false });
+ add2(new Command(Permissions.item, Item, "item", "i") { AllowServer = false });
+ add2(new Command(Permissions.home, Home, "home") { AllowServer = false });
+ add2(new Command(Permissions.canpartychat, PartyChat, "p") { AllowServer = false });
+ add2(new Command(Permissions.spawn, Spawn, "spawn") { AllowServer = false });
+ add2(new Command(Permissions.tp, TP, "tp") { AllowServer = false });
+ add2(new Command(Permissions.tphere, TPHere, "tphere") { AllowServer = false });
+ add2(new Command(Permissions.tpallow, TPAllow, "tpallow") { AllowServer = false });
add(Permissions.kick, Kick, "kick");
- add(Permissions.ban, Ban, "ban", "banip", "listbans", "unban", "unbanip", "clearbans");
+ add(Permissions.ban, Ban, "ban");
add(Permissions.whitelist, Whitelist, "whitelist");
add(Permissions.maintenance, Off, "off", "exit");
- add(Permissions.maintenance, Restart, "restart"); //Added restart command
+ add(Permissions.maintenance, Restart, "restart");
add(Permissions.maintenance, OffNoSave, "off-nosave", "exit-nosave");
add(Permissions.maintenance, CheckUpdates, "checkupdates");
+ add(Permissions.updateplugins, UpdatePlugins, "updateplugins");
add(Permissions.causeevents, DropMeteor, "dropmeteor");
add(Permissions.causeevents, Star, "star");
add(Permissions.causeevents, Fullmoon, "fullmoon");
add(Permissions.causeevents, Bloodmoon, "bloodmoon");
add(Permissions.causeevents, Invade, "invade");
- add(Permissions.spawnboss, SpawnBoss, "boss", "eater", "king", "eye", "skeletron", "wof", "wallofflesh", "twins",
- "destroyer", "prime", "skeletronp", "hardcore");
- add(Permissions.spawnmob, SpawnMob, "spawnmob", "sm");
- add(Permissions.tp, Home, "home");
- add(Permissions.tp, Spawn, "spawn");
- add(Permissions.tp, TP, "tp");
- add(Permissions.tphere, TPHere, "tphere");
- add(Permissions.tpallow, TPAllow, "tpallow");
- add(Permissions.warp, Warp, "warp", "setwarp", "delwarp", "sendwarp", "sw");
- add(Permissions.managegroup, AddGroup, "addgroup");
- add(Permissions.managegroup, DeleteGroup, "delgroup");
- add(Permissions.managegroup, ModifyGroup, "modgroup");
- add(Permissions.managegroup, ViewGroups, "group");
- add(Permissions.manageitem, AddItem, "additem", "banitem");
- add(Permissions.manageitem, DeleteItem, "delitem", "unbanitem");
- add(Permissions.manageitem, ListItems, "listitems", "listbanneditems");
- add(Permissions.manageitem, AddItemGroup, "additemgroup");
- add(Permissions.manageitem, DeleteItemGroup, "delitemgroup");
- add(Permissions.cfg, SetSpawn, "setspawn");
+ add(Permissions.spawnboss, Eater, "eater");
+ add(Permissions.spawnboss, Eye, "eye");
+ add(Permissions.spawnboss, King, "king");
+ add(Permissions.spawnboss, Skeletron, "skeletron");
+ add(Permissions.spawnboss, WoF, "wof", "wallofflesh");
+ add(Permissions.spawnboss, Twins, "twins");
+ add(Permissions.spawnboss, Destroyer, "destroyer");
+ add(Permissions.spawnboss, SkeletronPrime, "skeletronp", "prime");
+ add(Permissions.spawnboss, Hardcore, "hardcore");
+ add(Permissions.spawnmob, SpawnMob, "spawnmob", "sm");
+ add(Permissions.warp, Warp, "warp");
+ add(Permissions.managegroup, Group, "group");
+ add(Permissions.managegroup, GroupDeprecated, "addgroup", "delgroup", "modgroup");
+ add(Permissions.manageitem, ItemBan, "itemban");
+ add(Permissions.manageitem, ItemBanDeprecated,
+ "additem", "additemgroup", "banitem", "delitem", "delitemgroup", "listitems", "listbanneditems", "unbanitem");
+ add(Permissions.manageregion, Region, "region");
+ add(Permissions.manageregion, DebugRegions, "debugreg");
add(Permissions.cfg, Reload, "reload");
add(Permissions.cfg, ServerPassword, "serverpassword");
add(Permissions.cfg, Save, "save");
@@ -167,16 +215,12 @@ namespace TShockAPI
add(Permissions.pvpfun, Slap, "slap");
add(Permissions.editspawn, ToggleAntiBuild, "antibuild");
add(Permissions.editspawn, ProtectSpawn, "protectspawn");
- add(Permissions.manageregion, Region, "region");
- add(Permissions.manageregion, DebugRegions, "debgreg");
add(Permissions.maintenance, GetVersion, "version");
add(null, ListConnectedPlayers, "playing", "online", "who");
- add(null, AuthToken, "auth");
add(null, Motd, "motd");
add(null, Rules, "rules");
add(null, Help, "help");
add(Permissions.cantalkinthird, ThirdPerson, "me");
- add(Permissions.canpartychat, PartyChat, "p");
add(Permissions.mute, Mute, "mute", "unmute");
add(Permissions.logs, DisplayLogs, "displaylogs");
add(Permissions.userinfo, GrabUserUserInfo, "userinfo", "ui");
@@ -187,19 +231,23 @@ namespace TShockAPI
add(Permissions.annoy, Annoy, "annoy");
add(Permissions.kill, Kill, "kill");
add(Permissions.butcher, Butcher, "butcher");
- add(Permissions.item, Item, "item", "i");
add(Permissions.item, Give, "give", "g");
add(Permissions.clearitems, ClearItems, "clear", "clearitems");
add(Permissions.heal, Heal, "heal");
- add(Permissions.buff, Buff, "buff");
add(Permissions.buffplayer, GBuff, "gbuff", "buffplayer");
- add(Permissions.grow, Grow, "grow");
add(Permissions.hardmode, StartHardMode, "hardmode");
add(Permissions.hardmode, DisableHardMode, "stophardmode", "disablehardmode");
add(Permissions.cfg, ServerInfo, "stats");
add(Permissions.cfg, WorldInfo, "world");
add(Permissions.savessi, SaveSSI, "savessi");
add(Permissions.savessi, OverrideSSI, "overridessi", "ossi");
+ add(Permissions.xmas, ForceXmas, "forcexmas");
+ add(Permissions.settempgroup, TempGroup, "tempgroup");
+ add(null, Aliases, "aliases");
+ add(Rests.RestPermissions.restmanage, ManageRest, "rest");
+ //add(null, TestCallbackCommand, "test");
+
+ TShockCommands = new ReadOnlyCollection(tshockCommands);
}
public static bool HandleCommand(TSPlayer player, string text)
@@ -213,26 +261,42 @@ namespace TShockAPI
string cmdName = args[0].ToLower();
args.RemoveAt(0);
- Command cmd = ChatCommands.FirstOrDefault(c => c.HasAlias(cmdName));
+ if (Hooks.PlayerHooks.OnPlayerCommand(player, cmdName, cmdText, args))
+ return true;
- if (cmd == null)
+ IEnumerable cmds = ChatCommands.Where(c => c.HasAlias(cmdName));
+
+ if (cmds.Count() == 0)
{
- player.SendMessage("Invalid Command Entered. Type /help for a list of valid Commands.", Color.Red);
+ if (player.AwaitingResponse.ContainsKey(cmdName))
+ {
+ Action call = player.AwaitingResponse[cmdName];
+ player.AwaitingResponse.Remove(cmdName);
+ call(new CommandArgs(cmdText, player, args));
+ return true;
+ }
+ player.SendErrorMessage("Invalid command entered. Type /help for a list of valid commands.");
return true;
}
-
- if (!cmd.CanRun(player))
- {
- TShock.Utils.SendLogs(string.Format("{0} tried to execute {1}", player.Name, cmd.Name), Color.Red);
- player.SendMessage("You do not have access to that command.", Color.Red);
- }
- else
- {
- if (cmd.DoLog)
- TShock.Utils.SendLogs(string.Format("{0} executed: /{1}", player.Name, cmdText), Color.Red);
- cmd.Run(cmdText, player, args);
- }
- return true;
+ foreach (Command cmd in cmds)
+ {
+ if (!cmd.CanRun(player))
+ {
+ TShock.Utils.SendLogs(string.Format("{0} tried to execute /{1}.", player.Name, cmdText), Color.PaleVioletRed, player);
+ player.SendErrorMessage("You do not have access to that command.");
+ }
+ else if (!cmd.AllowServer && !player.RealPlayer)
+ {
+ player.SendErrorMessage("You must use this command in-game.");
+ }
+ else
+ {
+ if (cmd.DoLog)
+ TShock.Utils.SendLogs(string.Format("{0} executed: /{1}.", player.Name, cmdText), Color.PaleVioletRed, player);
+ cmd.Run(cmdText, player, args);
+ }
+ }
+ return true;
}
///
@@ -317,41 +381,59 @@ namespace TShockAPI
return c == ' ' || c == '\t' || c == '\n';
}
+ //private static void TestCallbackCommand(CommandArgs args)
+ //{
+ // Action