From e5a4f825d2ef93d032774a40bf57f4954f17912c Mon Sep 17 00:00:00 2001 From: Zack Date: Wed, 28 Jan 2015 15:05:19 -0500 Subject: [PATCH 01/37] Commit latest TSAPI to repo. --- TerrariaServerAPI | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TerrariaServerAPI b/TerrariaServerAPI index 2fc5b098..50a04c45 160000 --- a/TerrariaServerAPI +++ b/TerrariaServerAPI @@ -1 +1 @@ -Subproject commit 2fc5b098323ce7062df5ed91b1c532066fb8cb65 +Subproject commit 50a04c45bfc2d1de2de1a31b215f7bdc546cfdd5 From f188bd743cae8fe729f71b0507ba42636d9f5b8b Mon Sep 17 00:00:00 2001 From: Zack Date: Wed, 28 Jan 2015 15:24:50 -0500 Subject: [PATCH 02/37] Remove StatTracker --- TShockAPI/TShock.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index c298e091..dcbb70e5 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -76,7 +76,6 @@ namespace TShockAPI public static SecureRest RestApi; public static RestManager RestManager; public static Utils Utils = Utils.Instance; - public static StatTracker StatTracker = new StatTracker(); public static UpdateManager UpdateManager; /// /// Used for implementing REST Tokens prior to the REST system starting up. @@ -613,7 +612,6 @@ namespace TShockAPI ComputeMaxStyles(); FixChestStacks(); - StatTracker.Initialize(); UpdateManager = new UpdateManager(); } From f9bf470b1dc9414812a42f597db4e89433900f6f Mon Sep 17 00:00:00 2001 From: Zack Date: Wed, 28 Jan 2015 15:29:13 -0500 Subject: [PATCH 03/37] Tick version and update copyright --- TShockAPI/BackupManager.cs | 2 +- TShockAPI/Commands.cs | 2 +- TShockAPI/ConfigFile.cs | 2 +- TShockAPI/DB/BanManager.cs | 2 +- TShockAPI/DB/CharacterManager.cs | 2 +- TShockAPI/DB/GroupManager.cs | 2 +- TShockAPI/DB/IQueryBuilder.cs | 2 +- TShockAPI/DB/ItemManager.cs | 2 +- TShockAPI/DB/ProjectileManager.cs | 2 +- TShockAPI/DB/RegionManager.cs | 2 +- TShockAPI/DB/RememberedPosManager.cs | 2 +- TShockAPI/DB/SqlColumn.cs | 2 +- TShockAPI/DB/SqlTable.cs | 2 +- TShockAPI/DB/SqlValue.cs | 2 +- TShockAPI/DB/TileManager.cs | 2 +- TShockAPI/DB/UserManager.cs | 2 +- TShockAPI/DB/WarpsManager.cs | 2 +- TShockAPI/Extensions/DbExt.cs | 2 +- TShockAPI/Extensions/LinqExt.cs | 2 +- TShockAPI/Extensions/RandomExt.cs | 2 +- TShockAPI/Extensions/StringExt.cs | 2 +- TShockAPI/FileTools.cs | 2 +- TShockAPI/GeoIPCountry.cs | 2 +- TShockAPI/GetDataHandlers.cs | 2 +- TShockAPI/Group.cs | 2 +- TShockAPI/HandlerList.cs | 2 +- TShockAPI/Hooks/GeneralHooks.cs | 2 +- TShockAPI/Hooks/PlayerHooks.cs | 2 +- TShockAPI/IPackable.cs | 2 +- TShockAPI/Log.cs | 2 +- TShockAPI/Net/BaseMsg.cs | 2 +- TShockAPI/Net/DisconnectMsg.cs | 2 +- TShockAPI/Net/NetTile.cs | 2 +- TShockAPI/Net/ProjectileRemoveMsg.cs | 2 +- TShockAPI/Net/SpawnMsg.cs | 2 +- TShockAPI/Net/WorldInfoMsg.cs | 2 +- TShockAPI/PacketBufferer.cs | 2 +- TShockAPI/PaginationTools.cs | 2 +- TShockAPI/Permissions.cs | 2 +- TShockAPI/Properties/AssemblyInfo.cs | 8 ++++---- TShockAPI/RconHandler.cs | 2 +- TShockAPI/Rest/Rest.cs | 2 +- TShockAPI/Rest/RestCommand.cs | 2 +- TShockAPI/Rest/RestManager.cs | 2 +- TShockAPI/Rest/RestObject.cs | 2 +- TShockAPI/Rest/RestPermissions.cs | 2 +- TShockAPI/Rest/RestVerbs.cs | 2 +- TShockAPI/Rest/SecureRest.cs | 2 +- TShockAPI/SaveManager.cs | 2 +- TShockAPI/ServerSideCharacters/ServerSideConfig.cs | 2 +- TShockAPI/TSPlayer.cs | 2 +- TShockAPI/TShock.cs | 2 +- TShockAPI/TShockAPI.licenseheader | 2 +- TShockAPI/UpdateManager.cs | 2 +- TShockAPI/Utils.cs | 2 +- 55 files changed, 58 insertions(+), 58 deletions(-) diff --git a/TShockAPI/BackupManager.cs b/TShockAPI/BackupManager.cs index 13f94587..1882d0bb 100644 --- a/TShockAPI/BackupManager.cs +++ b/TShockAPI/BackupManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 6c9aeb38..7837af80 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index e1eb1014..2b4726d8 100755 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/BanManager.cs b/TShockAPI/DB/BanManager.cs index 4e38bd3f..89a62c99 100644 --- a/TShockAPI/DB/BanManager.cs +++ b/TShockAPI/DB/BanManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/CharacterManager.cs b/TShockAPI/DB/CharacterManager.cs index 7df75c29..a1f6b5b2 100755 --- a/TShockAPI/DB/CharacterManager.cs +++ b/TShockAPI/DB/CharacterManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/GroupManager.cs b/TShockAPI/DB/GroupManager.cs index cf0e8006..cd0f6d87 100644 --- a/TShockAPI/DB/GroupManager.cs +++ b/TShockAPI/DB/GroupManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/IQueryBuilder.cs b/TShockAPI/DB/IQueryBuilder.cs index 64988c7c..ac030759 100644 --- a/TShockAPI/DB/IQueryBuilder.cs +++ b/TShockAPI/DB/IQueryBuilder.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/ItemManager.cs b/TShockAPI/DB/ItemManager.cs index 9ef62d47..141f2925 100644 --- a/TShockAPI/DB/ItemManager.cs +++ b/TShockAPI/DB/ItemManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/ProjectileManager.cs b/TShockAPI/DB/ProjectileManager.cs index bba1d15b..a9cbf31b 100644 --- a/TShockAPI/DB/ProjectileManager.cs +++ b/TShockAPI/DB/ProjectileManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/RegionManager.cs b/TShockAPI/DB/RegionManager.cs index dd66c20d..40e9b957 100644 --- a/TShockAPI/DB/RegionManager.cs +++ b/TShockAPI/DB/RegionManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/RememberedPosManager.cs b/TShockAPI/DB/RememberedPosManager.cs index 86943784..ad2d62e2 100644 --- a/TShockAPI/DB/RememberedPosManager.cs +++ b/TShockAPI/DB/RememberedPosManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/SqlColumn.cs b/TShockAPI/DB/SqlColumn.cs index e72297a6..8fd72d88 100644 --- a/TShockAPI/DB/SqlColumn.cs +++ b/TShockAPI/DB/SqlColumn.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/SqlTable.cs b/TShockAPI/DB/SqlTable.cs index 0f8fd974..7fb62ed9 100644 --- a/TShockAPI/DB/SqlTable.cs +++ b/TShockAPI/DB/SqlTable.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/SqlValue.cs b/TShockAPI/DB/SqlValue.cs index e7c393b7..9edb13e0 100644 --- a/TShockAPI/DB/SqlValue.cs +++ b/TShockAPI/DB/SqlValue.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/TileManager.cs b/TShockAPI/DB/TileManager.cs index dc73f2c3..9362e664 100644 --- a/TShockAPI/DB/TileManager.cs +++ b/TShockAPI/DB/TileManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/UserManager.cs b/TShockAPI/DB/UserManager.cs index 38dc8745..07b94f63 100644 --- a/TShockAPI/DB/UserManager.cs +++ b/TShockAPI/DB/UserManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/DB/WarpsManager.cs b/TShockAPI/DB/WarpsManager.cs index 709298f2..fc4890af 100644 --- a/TShockAPI/DB/WarpsManager.cs +++ b/TShockAPI/DB/WarpsManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Extensions/DbExt.cs b/TShockAPI/Extensions/DbExt.cs index d11309ef..5dd6e0e6 100644 --- a/TShockAPI/Extensions/DbExt.cs +++ b/TShockAPI/Extensions/DbExt.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Extensions/LinqExt.cs b/TShockAPI/Extensions/LinqExt.cs index 99448df1..e1885bbd 100644 --- a/TShockAPI/Extensions/LinqExt.cs +++ b/TShockAPI/Extensions/LinqExt.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Extensions/RandomExt.cs b/TShockAPI/Extensions/RandomExt.cs index 68fc37a5..42abce9a 100644 --- a/TShockAPI/Extensions/RandomExt.cs +++ b/TShockAPI/Extensions/RandomExt.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Extensions/StringExt.cs b/TShockAPI/Extensions/StringExt.cs index 57d4cf1d..fe6dcfa2 100644 --- a/TShockAPI/Extensions/StringExt.cs +++ b/TShockAPI/Extensions/StringExt.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/FileTools.cs b/TShockAPI/FileTools.cs index fe7a6040..071da3fc 100644 --- a/TShockAPI/FileTools.cs +++ b/TShockAPI/FileTools.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/GeoIPCountry.cs b/TShockAPI/GeoIPCountry.cs index 2131fd17..764a69a2 100644 --- a/TShockAPI/GeoIPCountry.cs +++ b/TShockAPI/GeoIPCountry.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index e3beae8f..2680ac10 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Group.cs b/TShockAPI/Group.cs index ddd3c029..7efcb07a 100644 --- a/TShockAPI/Group.cs +++ b/TShockAPI/Group.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/HandlerList.cs b/TShockAPI/HandlerList.cs index 9524c79e..07b9d548 100644 --- a/TShockAPI/HandlerList.cs +++ b/TShockAPI/HandlerList.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Hooks/GeneralHooks.cs b/TShockAPI/Hooks/GeneralHooks.cs index 8e6168d6..d07c4f4f 100644 --- a/TShockAPI/Hooks/GeneralHooks.cs +++ b/TShockAPI/Hooks/GeneralHooks.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Hooks/PlayerHooks.cs b/TShockAPI/Hooks/PlayerHooks.cs index 6e69e19d..73e862a8 100644 --- a/TShockAPI/Hooks/PlayerHooks.cs +++ b/TShockAPI/Hooks/PlayerHooks.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/IPackable.cs b/TShockAPI/IPackable.cs index ffef9e42..7dbb2d93 100644 --- a/TShockAPI/IPackable.cs +++ b/TShockAPI/IPackable.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Log.cs b/TShockAPI/Log.cs index 9b239ce9..b2bb540f 100644 --- a/TShockAPI/Log.cs +++ b/TShockAPI/Log.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Net/BaseMsg.cs b/TShockAPI/Net/BaseMsg.cs index 02d4c201..c6f3de54 100644 --- a/TShockAPI/Net/BaseMsg.cs +++ b/TShockAPI/Net/BaseMsg.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Net/DisconnectMsg.cs b/TShockAPI/Net/DisconnectMsg.cs index 5ca32855..9e5789b4 100644 --- a/TShockAPI/Net/DisconnectMsg.cs +++ b/TShockAPI/Net/DisconnectMsg.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Net/NetTile.cs b/TShockAPI/Net/NetTile.cs index bd8249a6..c3ee7d6f 100644 --- a/TShockAPI/Net/NetTile.cs +++ b/TShockAPI/Net/NetTile.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Net/ProjectileRemoveMsg.cs b/TShockAPI/Net/ProjectileRemoveMsg.cs index 4d68305e..a576e5bd 100644 --- a/TShockAPI/Net/ProjectileRemoveMsg.cs +++ b/TShockAPI/Net/ProjectileRemoveMsg.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Net/SpawnMsg.cs b/TShockAPI/Net/SpawnMsg.cs index bb5d7fed..2fa15e59 100644 --- a/TShockAPI/Net/SpawnMsg.cs +++ b/TShockAPI/Net/SpawnMsg.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Net/WorldInfoMsg.cs b/TShockAPI/Net/WorldInfoMsg.cs index a2e4fc1e..e4763bb6 100644 --- a/TShockAPI/Net/WorldInfoMsg.cs +++ b/TShockAPI/Net/WorldInfoMsg.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/PacketBufferer.cs b/TShockAPI/PacketBufferer.cs index b624d394..051a9531 100644 --- a/TShockAPI/PacketBufferer.cs +++ b/TShockAPI/PacketBufferer.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/PaginationTools.cs b/TShockAPI/PaginationTools.cs index eb208ae7..e3161a3c 100644 --- a/TShockAPI/PaginationTools.cs +++ b/TShockAPI/PaginationTools.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Permissions.cs b/TShockAPI/Permissions.cs index 85847bfc..d970182a 100644 --- a/TShockAPI/Permissions.cs +++ b/TShockAPI/Permissions.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs index ba209b94..1ace0f53 100644 --- a/TShockAPI/Properties/AssemblyInfo.cs +++ b/TShockAPI/Properties/AssemblyInfo.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 @@ -28,7 +28,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Nyx Studios & TShock Contributors")] [assembly: AssemblyProduct("TShockAPI")] -[assembly: AssemblyCopyright("Copyright © Nyx Studios 2011-2014")] +[assembly: AssemblyCopyright("Copyright © Nyx Studios 2011-2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -49,5 +49,5 @@ using System.Runtime.InteropServices; // Build Number // MMdd of the build -[assembly: AssemblyVersion("4.2.3.0909")] -[assembly: AssemblyFileVersion("4.2.3.0909")] +[assembly: AssemblyVersion("4.2.4.0128")] +[assembly: AssemblyFileVersion("4.2.4.0128")] diff --git a/TShockAPI/RconHandler.cs b/TShockAPI/RconHandler.cs index cdd76d3e..39f32fa2 100644 --- a/TShockAPI/RconHandler.cs +++ b/TShockAPI/RconHandler.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Rest/Rest.cs b/TShockAPI/Rest/Rest.cs index 740f9bde..c23d0552 100644 --- a/TShockAPI/Rest/Rest.cs +++ b/TShockAPI/Rest/Rest.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Rest/RestCommand.cs b/TShockAPI/Rest/RestCommand.cs index d08616cb..681d7cbf 100644 --- a/TShockAPI/Rest/RestCommand.cs +++ b/TShockAPI/Rest/RestCommand.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Rest/RestManager.cs b/TShockAPI/Rest/RestManager.cs index e34177ff..93d81eee 100644 --- a/TShockAPI/Rest/RestManager.cs +++ b/TShockAPI/Rest/RestManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Rest/RestObject.cs b/TShockAPI/Rest/RestObject.cs index 890c33c7..65503bec 100644 --- a/TShockAPI/Rest/RestObject.cs +++ b/TShockAPI/Rest/RestObject.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Rest/RestPermissions.cs b/TShockAPI/Rest/RestPermissions.cs index 18851ac9..5b8c765d 100644 --- a/TShockAPI/Rest/RestPermissions.cs +++ b/TShockAPI/Rest/RestPermissions.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Rest/RestVerbs.cs b/TShockAPI/Rest/RestVerbs.cs index 02e5d056..ab8c1500 100644 --- a/TShockAPI/Rest/RestVerbs.cs +++ b/TShockAPI/Rest/RestVerbs.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Rest/SecureRest.cs b/TShockAPI/Rest/SecureRest.cs index 9845bc08..ee9eac2f 100644 --- a/TShockAPI/Rest/SecureRest.cs +++ b/TShockAPI/Rest/SecureRest.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/SaveManager.cs b/TShockAPI/SaveManager.cs index 725637ff..0557183d 100644 --- a/TShockAPI/SaveManager.cs +++ b/TShockAPI/SaveManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/ServerSideCharacters/ServerSideConfig.cs b/TShockAPI/ServerSideCharacters/ServerSideConfig.cs index fbec579f..ea4cc931 100644 --- a/TShockAPI/ServerSideCharacters/ServerSideConfig.cs +++ b/TShockAPI/ServerSideCharacters/ServerSideConfig.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.ComponentModel; /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index 158dc5d7..3c711431 100755 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index dcbb70e5..04a4551f 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/TShockAPI.licenseheader b/TShockAPI/TShockAPI.licenseheader index aa42eaf1..936b8a9b 100644 --- a/TShockAPI/TShockAPI.licenseheader +++ b/TShockAPI/TShockAPI.licenseheader @@ -1,7 +1,7 @@ extensions: .cs /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/UpdateManager.cs b/TShockAPI/UpdateManager.cs index 4f8305f6..bfe7c836 100644 --- a/TShockAPI/UpdateManager.cs +++ b/TShockAPI/UpdateManager.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index 4b6c6208..8fc6a0c1 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -1,6 +1,6 @@ /* TShock, a server mod for Terraria -Copyright (C) 2011-2014 Nyx Studios (fka. The TShock Team) +Copyright (C) 2011-2015 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 From da856554727e690448980befc6efc784561848a0 Mon Sep 17 00:00:00 2001 From: Zack Date: Wed, 28 Jan 2015 15:38:52 -0500 Subject: [PATCH 04/37] Update tshock_update.json --- tshock_update.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tshock_update.json b/tshock_update.json index 67fd67a0..c62d91bf 100644 --- a/tshock_update.json +++ b/tshock_update.json @@ -1,4 +1,4 @@ { - "version": "4.2.3.0720", - "changes": "TShock 4.2.3 for Terraria 1.2.4.1 Update 1\nhttp://tshock.co/xf/index.php?threads/tshock-4-2-3-for-terraria-1-2-4-1-update-1.3055/" + "version": "4.2.4.0128", + "changes": "TShock 4.2.4 for Terraria 1.2.4.1\nhttp://tshock.co/xf/index.php?threads/tshock-4-2-4-for-terraria-1-2-4-1.3398/" } From e93d4c97418ba4bf4f898e8297eb8fd88965c867 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 21 Feb 2015 15:21:44 -0700 Subject: [PATCH 05/37] Switch UpdateManager to use mimic server --- TShockAPI/UpdateManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 TShockAPI/UpdateManager.cs diff --git a/TShockAPI/UpdateManager.cs b/TShockAPI/UpdateManager.cs old mode 100644 new mode 100755 index bfe7c836..bfb96740 --- a/TShockAPI/UpdateManager.cs +++ b/TShockAPI/UpdateManager.cs @@ -27,7 +27,7 @@ namespace TShockAPI { public class UpdateManager { - private string updateUrl = "https://github.com/NyxStudios/TShock/blob/general-devel/tshock_update.json?raw=true"; + private string updateUrl = "http://update.tshock.co/latest/"; /// /// Check once every X minutes. @@ -115,7 +115,7 @@ namespace TShockAPI private void NotifyAdministrator(TSPlayer player, string[] changes) { - player.SendMessage("The server is out of date.", Color.Red); + player.SendMessage("The server is out of date. Latest version: ", Color.Red); for (int j = 0; j < changes.Length; j++) { player.SendMessage(changes[j], Color.Red); From 3104e76d21948bd2521f57ce8c0285e3161c7593 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 21 Feb 2015 15:26:00 -0700 Subject: [PATCH 06/37] Version tick: 4.2.5 Changed versioning system to remove the date from the version string. Fixes #836 --- TShockAPI/Properties/AssemblyInfo.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) mode change 100644 => 100755 TShockAPI/Properties/AssemblyInfo.cs diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs old mode 100644 new mode 100755 index 1ace0f53..61a58e2a --- a/TShockAPI/Properties/AssemblyInfo.cs +++ b/TShockAPI/Properties/AssemblyInfo.cs @@ -47,7 +47,11 @@ using System.Runtime.InteropServices; // Major Version // Minor Version // Build Number -// MMdd of the build +// Starting in version 4.2.5, we are no longer including the fourth decimal +// location, which previously held the date and time. -[assembly: AssemblyVersion("4.2.4.0128")] -[assembly: AssemblyFileVersion("4.2.4.0128")] +// Also, be sure to release on github with the exact assembly version tag as below +// so that the update manager works correctly (via the Github releases api and mimic) + +[assembly: AssemblyVersion("4.2.5")] +[assembly: AssemblyFileVersion("4.2.5")] From f8a513d9da5f4a51e117dbbe6a207b0bf12bb364 Mon Sep 17 00:00:00 2001 From: Zack Date: Sat, 21 Feb 2015 19:00:57 -0500 Subject: [PATCH 07/37] Change output of REST to UTF8, which is what Terraria uses behind the scenes. Also changed content type to include the encoding. Fixes #858 --- TShockAPI/Rest/Rest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Rest/Rest.cs b/TShockAPI/Rest/Rest.cs index c23d0552..4fbf94e4 100644 --- a/TShockAPI/Rest/Rest.cs +++ b/TShockAPI/Rest/Rest.cs @@ -155,9 +155,9 @@ namespace Rests str = string.Format("{0}({1});", jsonp, str); } e.Response.Connection.Type = ConnectionType.Close; - e.Response.ContentType = new ContentTypeHeader("application/json"); + e.Response.ContentType = new ContentTypeHeader("application/json; charset=utf-8"); e.Response.Add(serverHeader); - e.Response.Body.Write(Encoding.ASCII.GetBytes(str), 0, str.Length); + e.Response.Body.Write(Encoding.UTF8.GetBytes(str), 0, str.Length); e.Response.Status = HttpStatusCode.OK; } From 484ebd6d81ae02f3a2237db200dafacf16af6603 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 21 Feb 2015 17:13:01 -0700 Subject: [PATCH 08/37] Do not auto-recreate the default groups on startup --- TShockAPI/DB/GroupManager.cs | 49 ++++++++++++++++++------------------ TShockAPI/DB/SqlTable.cs | 5 +++- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/TShockAPI/DB/GroupManager.cs b/TShockAPI/DB/GroupManager.cs index cd0f6d87..41c96534 100644 --- a/TShockAPI/DB/GroupManager.cs +++ b/TShockAPI/DB/GroupManager.cs @@ -47,34 +47,35 @@ namespace TShockAPI.DB db.GetSqlType() == SqlType.Sqlite ? (IQueryBuilder) new SqliteQueryCreator() : new MysqlQueryCreator()); - creator.EnsureExists(table); + if (creator.EnsureExists(table)) + { + // Add default groups if they don't exist + AddDefaultGroup("guest", "", + string.Join(",", Permissions.canbuild, Permissions.canregister, Permissions.canlogin, Permissions.canpartychat, + Permissions.cantalkinthird, Permissions.canchat)); + + AddDefaultGroup("default", "guest", + string.Join(",", Permissions.warp, Permissions.canchangepassword)); + + AddDefaultGroup("newadmin", "default", + string.Join(",", Permissions.kick, Permissions.editspawn, Permissions.reservedslot)); + + AddDefaultGroup("admin", "newadmin", + string.Join(",", Permissions.ban, Permissions.whitelist, "tshock.world.time.*", Permissions.spawnboss, + Permissions.spawnmob, Permissions.managewarp, Permissions.time, Permissions.tp, Permissions.slap, + Permissions.kill, Permissions.logs, + Permissions.immunetokick, Permissions.tpothers)); + + AddDefaultGroup("trustedadmin", "admin", + string.Join(",", Permissions.maintenance, "tshock.cfg.*", "tshock.world.*", Permissions.butcher, Permissions.item, + Permissions.heal, Permissions.immunetoban, Permissions.usebanneditem)); + + AddDefaultGroup("vip", "default", string.Join(",", Permissions.reservedslot)); + } // Load Permissions from the DB LoadPermisions(); - // Add default groups if they don't exist - AddDefaultGroup("guest", "", - string.Join(",", Permissions.canbuild, Permissions.canregister, Permissions.canlogin, Permissions.canpartychat, - Permissions.cantalkinthird, Permissions.canchat)); - - AddDefaultGroup("default", "guest", - string.Join(",", Permissions.warp, Permissions.canchangepassword)); - - AddDefaultGroup("newadmin", "default", - string.Join(",", Permissions.kick, Permissions.editspawn, Permissions.reservedslot)); - - AddDefaultGroup("admin", "newadmin", - string.Join(",", Permissions.ban, Permissions.whitelist, "tshock.world.time.*", Permissions.spawnboss, - Permissions.spawnmob, Permissions.managewarp, Permissions.time, Permissions.tp, Permissions.slap, - Permissions.kill, Permissions.logs, - Permissions.immunetokick, Permissions.tpothers)); - - AddDefaultGroup("trustedadmin", "admin", - string.Join(",", Permissions.maintenance, "tshock.cfg.*", "tshock.world.*", Permissions.butcher, Permissions.item, - Permissions.heal, Permissions.immunetoban, Permissions.usebanneditem)); - - AddDefaultGroup("vip", "default", string.Join(",", Permissions.reservedslot)); - Group.DefaultGroup = GetGroupByName(TShock.Config.DefaultGuestGroupName); } diff --git a/TShockAPI/DB/SqlTable.cs b/TShockAPI/DB/SqlTable.cs index 7fb62ed9..b7a77b91 100644 --- a/TShockAPI/DB/SqlTable.cs +++ b/TShockAPI/DB/SqlTable.cs @@ -52,7 +52,8 @@ namespace TShockAPI.DB creator = provider; } - public void EnsureExists(SqlTable table) + // Returns true if the table was created; false if it was not. + public bool EnsureExists(SqlTable table) { var columns = GetColumns(table); if (columns.Count > 0) @@ -66,7 +67,9 @@ namespace TShockAPI.DB else { database.Query(creator.CreateTable(table)); + return true; } + return false; } public List GetColumns(SqlTable table) From 964115dbb54dd66b100ea6744acb73891d9e269b Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 21 Feb 2015 17:34:39 -0700 Subject: [PATCH 09/37] /user add now returns sensible errors --- TShockAPI/Commands.cs | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 7837af80..6d04e914 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -910,28 +910,36 @@ namespace TShockAPI { var user = new User(); - try + if (args.Parameters.Count == 4) { - if (args.Parameters.Count == 4) + user.Name = args.Parameters[1]; + user.Password = args.Parameters[2]; + user.Group = args.Parameters[3]; + + try { - user.Name = args.Parameters[1]; - user.Password = args.Parameters[2]; - user.Group = args.Parameters[3]; - - args.Player.SendSuccessMessage("Account " + user.Name + " has been added to group " + user.Group + "!"); TShock.Users.AddUser(user); TShock.CharacterDB.SeedInitialData(TShock.Users.GetUser(user)); + args.Player.SendSuccessMessage("Account " + user.Name + " has been added to group " + user.Group + "!"); Log.ConsoleInfo(args.Player.Name + " added Account " + user.Name + " to group " + user.Group); } - else + catch (GroupNotExistsException e) { - args.Player.SendErrorMessage("Invalid syntax. Try /user help."); + args.Player.SendErrorMessage("Group " + user.Group + " does not exist!"); + } + catch (UserExistsException e) + { + args.Player.SendErrorMessage("User " + user.Name + " already exists!"); + } + catch (UserManagerException e) + { + args.Player.SendErrorMessage("User " + user.Name + " could not be added, check console for details."); + Log.ConsoleError(e.ToString()); } } - catch (UserManagerException ex) + else { - args.Player.SendErrorMessage(ex.Message); - Log.ConsoleError(ex.ToString()); + args.Player.SendErrorMessage("Invalid syntax. Try /user help."); } } // User deletion requires a username From 32c764579559e8791ab5a742e298735f58e0583c Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 21 Feb 2015 17:36:32 -0700 Subject: [PATCH 10/37] /user del now responds appropriately if the user doesn't exist --- TShockAPI/Commands.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 6d04e914..da190a88 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -954,13 +954,18 @@ namespace TShockAPI args.Player.SendSuccessMessage("Account removed successfully."); Log.ConsoleInfo(args.Player.Name + " successfully deleted account: " + args.Parameters[1] + "."); } + catch (UserNotExistException e) + { + args.Player.SendErrorMessage("The user " + user.Name + " does not exist! Deleted nobody!"); + } catch (UserManagerException ex) { args.Player.SendMessage(ex.Message, Color.Red); Log.ConsoleError(ex.ToString()); } } - // Password changing requires a username, and a new password to set + + // Password changing requires a username, and a new password to set else if (subcmd == "password") { var user = new User(); @@ -985,11 +990,11 @@ namespace TShockAPI Log.ConsoleError(ex.ToString()); } } - // Group changing requires a username or IP address, and a new group to set + // Group changing requires a username or IP address, and a new group to set else if (subcmd == "group") { - var user = new User(); - user.Name = args.Parameters[1]; + var user = new User(); + user.Name = args.Parameters[1]; try { From 70104f795cdebef6f91f435d17398df31e71ad60 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 21 Feb 2015 17:40:58 -0700 Subject: [PATCH 11/37] /user password now returns correct message if user does not exist --- TShockAPI/Commands.cs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index da190a88..4aaa9d8c 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -971,23 +971,27 @@ namespace TShockAPI var user = new User(); user.Name = args.Parameters[1]; - try + if (args.Parameters.Count == 3) { - if (args.Parameters.Count == 3) + try { - args.Player.SendSuccessMessage("Password change succeeded for " + user.Name + "."); TShock.Users.SetUserPassword(user, args.Parameters[2]); Log.ConsoleInfo(args.Player.Name + " changed the password of account " + user.Name); + args.Player.SendSuccessMessage("Password change succeeded for " + user.Name + "."); } - else + catch (UserNotExistException e) { - args.Player.SendErrorMessage("Invalid user password syntax. Try /user help."); + args.Player.SendErrorMessage("User " + user.Name + " does not exist!"); + } + catch (UserManagerException e) + { + args.Player.SendErrorMessage("Password change for " + user.Name + " failed! Check console!"); + Log.ConsoleError(e.ToString()); } } - catch (UserManagerException ex) + else { - args.Player.SendErrorMessage(ex.Message); - Log.ConsoleError(ex.ToString()); + args.Player.SendErrorMessage("Invalid user password syntax. Try /user help."); } } // Group changing requires a username or IP address, and a new group to set From deb4113c73be332a634e91eec081dd8028543735 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 21 Feb 2015 17:50:19 -0700 Subject: [PATCH 12/37] /user group has proper error handling This blast of commits fixes #543 --- TShockAPI/Commands.cs | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 4aaa9d8c..ec378ae0 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -1000,23 +1000,31 @@ namespace TShockAPI var user = new User(); user.Name = args.Parameters[1]; - try + if (args.Parameters.Count == 3) { - if (args.Parameters.Count == 3) + try { - args.Player.SendSuccessMessage("Account " + user.Name + " has been changed to group " + args.Parameters[2] + "!"); TShock.Users.SetUserGroup(user, args.Parameters[2]); Log.ConsoleInfo(args.Player.Name + " changed account " + user.Name + " to group " + args.Parameters[2] + "."); + args.Player.SendSuccessMessage("Account " + user.Name + " has been changed to group " + args.Parameters[2] + "!"); } - else + catch (GroupNotExistsException e) { - args.Player.SendErrorMessage("Invalid user group syntax. Try /user help."); + args.Player.SendErrorMessage("That group does not exist!"); } + catch (UserNotExistException e) + { + args.Player.SendErrorMessage("User " + user.Name + " does not exist!"); + } + catch (UserManagerException e) + { + args.Player.SendErrorMessage("User " + user.Name + " could not be added. Check console for details."); + } + } - catch (UserManagerException ex) + else { - args.Player.SendMessage(ex.Message, Color.Green); - Log.ConsoleError(ex.ToString()); + args.Player.SendErrorMessage("Invalid user group syntax. Try /user help."); } } else if (subcmd == "help") From bd066589b858009818d23699fd07ec8ee853b265 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 21 Feb 2015 18:46:12 -0700 Subject: [PATCH 13/37] UpdateManager no longer silently shuts down after failure --- TShockAPI/UpdateManager.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/TShockAPI/UpdateManager.cs b/TShockAPI/UpdateManager.cs index bfb96740..5448fb35 100755 --- a/TShockAPI/UpdateManager.cs +++ b/TShockAPI/UpdateManager.cs @@ -32,7 +32,7 @@ namespace TShockAPI /// /// Check once every X minutes. /// - private readonly int CheckXMinutes = 30; + private int CheckXMinutes = 30; public UpdateManager() { @@ -44,11 +44,12 @@ namespace TShockAPI try { UpdateCheck(state); + CheckXMinutes = 30; } catch (Exception) { - //swallow the exception - return; + // Skip this run and check more frequently... + CheckXMinutes = 5; } Thread.Sleep(CheckXMinutes * 60 * 1000); From aa633084e5af2f9778fa4158578bf1b4954b8324 Mon Sep 17 00:00:00 2001 From: Zack Date: Sat, 21 Feb 2015 20:53:36 -0500 Subject: [PATCH 14/37] Add deploy to github button. --- deploy_release.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 deploy_release.py diff --git a/deploy_release.py b/deploy_release.py new file mode 100644 index 00000000..f92e5326 --- /dev/null +++ b/deploy_release.py @@ -0,0 +1,18 @@ +import requests +import json +import sys +import os + +branch = sys.argv[1] +tag_name = sys.argv[2] +name = sys.argv[3] +token = os.environ['GITHUB_TSHOCK_OAUTH'] +body = 'This is the newest release for TShock. Please see the release thread for more information @ http://tshock.co/xf' + +data = {'tag_name':tag_name, 'target_commitish':branch, 'name':name, 'body':body, 'draft':False, 'prerelease':False} +headers = {'Content-Type': 'application/json', 'Authorization': 'token ' + token} + +print json.dumps(data) +req = requests.post('https://api.github.com/repos/NyxStudios/TShock/releases', data = json.dumps(data), headers = headers) + +print req.text \ No newline at end of file From 349ac17388ec71b2ebd0bc5d85940c1317f60d2d Mon Sep 17 00:00:00 2001 From: Zack Date: Sat, 21 Feb 2015 21:06:21 -0500 Subject: [PATCH 15/37] Rather hacky solution to security issues :( --- deploy_release.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deploy_release.py b/deploy_release.py index f92e5326..0944c289 100644 --- a/deploy_release.py +++ b/deploy_release.py @@ -6,7 +6,11 @@ import os branch = sys.argv[1] tag_name = sys.argv[2] name = sys.argv[3] -token = os.environ['GITHUB_TSHOCK_OAUTH'] + +#because we can't find any other secure way to get a token into this script run from bamboo :'( +with open('/home/bamboo/scripts/token.py') as f: + token = f.read().rsplit('=', 1)[1].strip() + body = 'This is the newest release for TShock. Please see the release thread for more information @ http://tshock.co/xf' data = {'tag_name':tag_name, 'target_commitish':branch, 'name':name, 'body':body, 'draft':False, 'prerelease':False} From 44c8f40a6afff5fbff197ecb0e743fa8d471fabc Mon Sep 17 00:00:00 2001 From: Zack Date: Sat, 21 Feb 2015 21:17:44 -0500 Subject: [PATCH 16/37] Use environment variables from bamboo, maybe? --- deploy_release.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy_release.py b/deploy_release.py index 0944c289..de4cc9a5 100644 --- a/deploy_release.py +++ b/deploy_release.py @@ -3,9 +3,9 @@ import json import sys import os -branch = sys.argv[1] -tag_name = sys.argv[2] -name = sys.argv[3] +branch = os.environ["GIT_BRANCH"] +tag_name = os.environ["bamboo_tag_name"] +name = os.environ["bamboo_release_name"] #because we can't find any other secure way to get a token into this script run from bamboo :'( with open('/home/bamboo/scripts/token.py') as f: From 0280e7abbd56eb745b80003a15afffa54ed55796 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 21 Feb 2015 19:33:30 -0700 Subject: [PATCH 17/37] Remove erroneous CONTRIBUTING file --- CONTRIBUTING | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 CONTRIBUTING diff --git a/CONTRIBUTING b/CONTRIBUTING deleted file mode 100644 index 095ad8ea..00000000 --- a/CONTRIBUTING +++ /dev/null @@ -1,36 +0,0 @@ -### 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 From cc7e4356b180790a7afce05212dea35c970ab0b9 Mon Sep 17 00:00:00 2001 From: Zack Date: Sat, 21 Feb 2015 21:37:21 -0500 Subject: [PATCH 18/37] Use urllib2 because @nicatrontg failed to install requests. --- deploy_release.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/deploy_release.py b/deploy_release.py index de4cc9a5..35d3b963 100644 --- a/deploy_release.py +++ b/deploy_release.py @@ -1,8 +1,9 @@ -import requests +import urllib2 import json import sys import os +req_url = 'https://api.github.com/repos/NyxStudios/TShock/releases' branch = os.environ["GIT_BRANCH"] tag_name = os.environ["bamboo_tag_name"] name = os.environ["bamboo_release_name"] @@ -14,9 +15,9 @@ with open('/home/bamboo/scripts/token.py') as f: body = 'This is the newest release for TShock. Please see the release thread for more information @ http://tshock.co/xf' data = {'tag_name':tag_name, 'target_commitish':branch, 'name':name, 'body':body, 'draft':False, 'prerelease':False} + headers = {'Content-Type': 'application/json', 'Authorization': 'token ' + token} -print json.dumps(data) -req = requests.post('https://api.github.com/repos/NyxStudios/TShock/releases', data = json.dumps(data), headers = headers) - -print req.text \ No newline at end of file +json_data = json.dumps(data) +req = urllib2.Request(req_url, json_data, headers) +urllib2.urlopen(req) \ No newline at end of file From 41d4206cc9d5f17ee094d5bd1075880f9caa455f Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 21 Feb 2015 19:38:01 -0700 Subject: [PATCH 19/37] Remove old useless junk files --- Build/TerrariaServer.XML | 90 ------ docs/generate.bat | 6 - docs/readme.md | 15 - docs/src/config.md | 580 --------------------------------------- docs/src/index.md | 43 --- docs/src/install.md | 35 --- docs/src/permissions.md | 259 ----------------- docs/src/perms.md | 17 -- 8 files changed, 1045 deletions(-) delete mode 100644 Build/TerrariaServer.XML delete mode 100644 docs/generate.bat delete mode 100644 docs/readme.md delete mode 100644 docs/src/config.md delete mode 100644 docs/src/index.md delete mode 100644 docs/src/install.md delete mode 100644 docs/src/permissions.md delete mode 100644 docs/src/perms.md diff --git a/Build/TerrariaServer.XML b/Build/TerrariaServer.XML deleted file mode 100644 index 1b7deea8..00000000 --- a/Build/TerrariaServer.XML +++ /dev/null @@ -1,90 +0,0 @@ - - - - TerrariaServer - - - - - Hooks interface - - - - - List of players - - - - - See generic HandlerList - - - - - Works like an event. Allows for registering delegates with a higher or lower priority. - - - - - - Register a handler - - Delegate to be called - Priority of the delegate - Should the handler receive a call even if it has been handled - - - - Attempts to damage the player. - - int - how much damage to give - - - - Sends message to specified player - - string - text to send - Color - color for the text - - - - Meant to only be used by TServer. - - - - - The character name of the player. - - - - - Return a list of interfaces this plugin exposes. - - - - - - Called before initialize passing all the interfaces gathered from plugins - - - - - - Gets the T interface from the collection. Returns null if its not found. - - - - - - - - Called when the player first connects. They are not fully in the game yet, for that see Greet. - - - - - Called when the player is actually loaded into the game. - - - - diff --git a/docs/generate.bat b/docs/generate.bat deleted file mode 100644 index b5bfc3d0..00000000 --- a/docs/generate.bat +++ /dev/null @@ -1,6 +0,0 @@ -@echo off -:main -echo Generating Pandoc docs -cd src -for %%F in (*.md) do pandoc %%F > %%F.html -pause \ No newline at end of file diff --git a/docs/readme.md b/docs/readme.md deleted file mode 100644 index 7f29d689..00000000 --- a/docs/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# Building - -1. Install [Pandoc](http://johnmacfarlane.net/pandoc). -2. cd to docs/src -3. pandoc index.md -o ../index.html -4. pandoc permissions.md -o ../permissions.html - -# Adding stuff - -1. Everything is [Markdown](http://daringfireball.net/projects/markdown/) -2. If you add a new page, include [Markdown-CSS](https://github.com/clownfart/Markdown-CSS) for best results. - -# Demo - -You can access the docs at the [TShock Github Page](http://tshock.github.com/). \ No newline at end of file diff --git a/docs/src/config.md b/docs/src/config.md deleted file mode 100644 index 4d747eab..00000000 --- a/docs/src/config.md +++ /dev/null @@ -1,580 +0,0 @@ - - -# The config file - -[Back to index](index.md.html) - ----- - -Each TShock installation automatically generates a configuration file which can edit basic settings when the server starts. - -The file "config.json" is located in the *tshock* folder, in the same directory as TerrariaServer.exe. - -Being a JSON file, it is extremely critical that you edit the file in a standard text editor. Use [Notepad++](http://notepad-plus-plus.org/) to edit your file, or another text editor used for programming. Before restarting TShock, check the syntax of your file using [JSONLint](http://jsonlint.com/), and verify that it contains no errors. - -An example configuration file is below. - - { - "InvasionMultiplier": 1, - "DefaultMaximumSpawns": 0, - "DefaultSpawnRate": 600, - "ServerPort": 7777, - "EnableWhitelist": false, - "InfiniteInvasion": false, - "PvPMode": "normal", - "SpawnProtection": true, - "SpawnProtectionRadius": 5, - "MaxSlots": 8, - "RangeChecks": true, - "DisableBuild": false, - "SuperAdminChatRGB": [ - 255.0, - 0.0, - 0.0 - ], - "SuperAdminChatPrefix": "(Admin) ", - "SuperAdminChatSuffix": "", - "BackupInterval": 0, - "BackupKeepFor": 60, - "RememberLeavePos": false, - "HardcoreOnly": false, - "MediumcoreOnly": false, - "KickOnMediumcoreDeath": false, - "BanOnMediumcoreDeath": false, - "AutoSave": true, - "AnnounceSave": true, - "MaximumLoginAttempts": 3, - "RconPassword": "", - "RconPort": 7777, - "ServerName": "", - "MasterServer": "127.0.0.1", - "StorageType": "sqlite", - "MySqlHost": "localhost:3306", - "MySqlDbName": "", - "MySqlUsername": "", - "MySqlPassword": "", - "MediumcoreBanReason": "Death results in a ban", - "MediumcoreKickReason": "Death results in a kick", - "EnableDNSHostResolution": false, - "EnableIPBans": true, - "EnableBanOnUsernames": false, - "DefaultRegistrationGroupName": "default", - "DefaultGuestGroupName": "guest", - "DisableSpewLogs": true, - "HashAlgorithm": "sha512", - "BufferPackets": true, - "ServerFullReason": "Server is full", - "ServerFullNoReservedReason": "Server is full. No reserved slots open.", - "SaveWorldOnCrash": true, - "EnableGeoIP": false, - "EnableTokenEndpointAuthentication": false, - "ServerNickname": "TShock Server", - "RestApiEnabled": false, - "RestApiPort": 7878, - "DisableTombstones": true, - "DisplayIPToAdmins": false, - "EnableInsecureTileFixes": true, - "KickProxyUsers": true, - "DisableHardmode": false, - "DisableDungeonGuardian": false, - "ServerSideInventory": false, - "ServerSideInventorySave": 15, - "LogonDiscardThreshold": 250, - "DisablePlayerCountReporting": false, - "DisableClownBombs": false, - "DisableSnowBalls": false, - "ChatFormat": "{1}{2}{3}: {4}", - "ForceTime": "normal", - "TileKillThreshold": 60, - "TilePlaceThreshold": 20, - "TileLiquidThreshold": 15, - "ProjectileThreshold": 50, - "ProjIgnoreShrapnel": true, - "RequireLogin": true, - "DisableInvisPvP": false, - "MaxRangeForDisabled": 10, - "ServerPassword": "", - "RegionProtectChests": false, - "DisableLoginBeforeJoin": false, - "AllowRegisterAnyUsername": false, - "AllowLoginAnyUsername": true, - "MaxDamage": 175, - "MaxProjDamage": 175, - "IgnoreProjUpdate": false, - "IgnoreProjKill": false, - "IgnoreNoClip": false, - "AllowIce": true - } - -In this file, if you wanted to change the maximum players to 64, you would edit that the file so that the line referring to max players looked like so: - - "MaxSlots": 64, - -The following is the official documentation for the configuration file: - -## AllowCorruptionCreep -**Type:** Boolean -**Description:** Allows corrutption to spread when a world is hardmode. -**Default:** "True" - -## AllowHallowCreep -**Type:** Boolean -**Description:** Allows hallow to spread when a world is hardmode. -**Default:** "True" - -## AllowIce -**Type:** Boolean -**Description:** Allow Ice placement even when user does not have canbuild -**Default:** "False" - -## AllowLoginAnyUsername -**Type:** Boolean -**Description:** Allows users to login with any username with /login -**Default:** "True" - -## AllowRegisterAnyUsername -**Type:** Boolean -**Description:** Allows users to register any username with /register -**Default:** "False" - -## AutoSave -**Type:** Boolean -**Description:** Enable/Disable Terrarias built in auto save -**Default:** "True" - -## AnnounceSave -**Type:** Boolean -**Description:** Enable/Disable save announcements -**Default:** "True" - -## BackupInterval -**Type:** Int32 -**Description:** Backup frequency in minutes. So, a value of 60 = 60 minutes. Backups are stored in the \tshock\backups folder. -**Default:** "0" - -## BackupKeepFor -**Type:** Int32 -**Description:** How long backups are kept in minutes. 2880 = 2 days. -**Default:** "60" - -## BanOnMediumcoreDeath -**Type:** Boolean -**Description:** Bans a Hardcore player on death. -**Default:** "False" - -## BufferPackets -**Type:** Boolean -**Description:** Buffers up the packets and sends them out at the end of each frame -**Default:** "True" - -## ChatFormat -**Type:** String -**Description:** Change ingame chat format, {0} = Group Name, {1} = Group Prefix, {2} = Player Name, {3} = Group Suffix, {4} = Chat Message -**Default:** "{1}{2}{3}: {4}" - -## DefaultGuestGroupName -**Type:** String -**Description:** Selects the default group name to place non registered users under -**Default:** "guest" - -## DefaultMaximumSpawns -**Type:** Int32 -**Description:** The default maximum mobs that will spawn per wave. Higher means more mobs in that wave. -**Default:** "5" - -## DefaultRegistrationGroupName -**Type:** String -**Description:** Selects the default group name to place new registrants under -**Default:** "default" - -## DefaultSpawnRate -**Type:** Int32 -**Description:** The delay between waves. Shorter values lead to less mobs. -**Default:** "600" - -## DisableBuild -**Type:** Boolean -**Description:** Disables any building; placing of blocks -**Default:** "False" - -## DisableClownBombs -**Type:** Boolean -**Description:** Disables clown bomb projectiles from spawning -**Default:** "False" - -## DisableDungeonGuardian -**Type:** Boolean -**Description:** Disables Dungeon Guardian from being spawned by player packets, this will instead force a respawn -**Default:** "False" - -## DisableHardmode -**Type:** Boolean -**Description:** Disables hardmode, can't never be activated. Overrides /starthardmode -**Default:** "False" - -## DisableInvisPvP -**Type:** Boolean -**Description:** Disables Invisibility potions from being used in PvP (Note, they can use them on the client, but the effect isn't sent to the rest of the server) -**Default:** "False" - -## DisableLoginBeforeJoin -**Type:** Boolean -**Description:** Disable users from being able to login with account password when joining -**Default:** "False" - -## DisablePiggybanksOnSSI -**Type:** Boolean -**Description:** Prevent banks on SSI -**Default:** "False" - -## DisablePlayerCountReporting -**Type:** Boolean -**Description:** Disables reporting of playercount to the stat system. -**Default:** "False" - -## DisableSnowBalls -**Type:** Boolean -**Description:** Disables snow ball projectiles from spawning -**Default:** "False" - -## DisableSpewLogs -**Type:** Boolean -**Description:** Force-Disable printing logs to players with the log permission -**Default:** "True" - -## DisableTombstones -**Type:** Boolean -**Description:** Disable tombstones for all players. -**Default:** "True" - -## DisplayIPToAdmins -**Type:** Boolean -**Description:** Displays a player's IP on join to everyone who has the log permission -**Default:** "False" - -## EnableBanOnUsernames -**Type:** Boolean -**Description:** Enables kicking of banned users by matching their Character Name -**Default:** "False" - -## EnableDNSHostResolution -**Type:** Boolean -**Description:** Enables DNS resolution of incoming connections with GetGroupForIPExpensive. -**Default:** "False" - -## EnableGeoIP -**Type:** Boolean -**Description:** This will announce a player's location on join -**Default:** "False" - -## EnableInsecureTileFixes -**Type:** Boolean -**Description:** Some tiles are 'fixed' by not letting TShock handle them. Disabling this may break certain asthetic tiles. -**Default:** "True" - -## EnableIPBans -**Type:** Boolean -**Description:** Enables kicking of banned users by matching their IP Address -**Default:** "True" - -## EnableTokenEndpointAuthentication -**Type:** Boolean -**Description:** This will turn on a token requirement for the /status API endpoint. -**Default:** "False" - -## EnableWhitelist -**Type:** Boolean -**Description:** Enable or disable the whitelist based on IP addresses in whitelist.txt -**Default:** "False" - -## ForceTime -**Type:** String -**Description:** Force the world time to be normal, day, or night -**Default:** "normal" - -## HardcoreOnly -**Type:** Boolean -**Description:** Hardcore players ONLY. This means softcore players cannot join. -**Default:** "False" - -## HashAlgorithm -**Type:** String -**Description:** Valid types are "sha512", "sha256", "md5", append with "-xp" for the xp supported algorithms -**Default:** "sha512" - -## IgnoreNoClip -**Type:** Boolean -**Description:** Ignores all no clip checks for players -**Default:** "False" - -## IgnoreProjKill -**Type:** Boolean -**Description:** Ignores checking to see if player 'can' kill a projectile -**Default:** "False" - -## IgnoreProjUpdate -**Type:** Boolean -**Description:** Ignores checking to see if player 'can' update a projectile -**Default:** "False" - -## InfiniteInvasion -**Type:** Boolean -**Description:** Enable the ability for invaison size to never decrease. Make sure to run /invade, and note that this adds 2 million+ goblins to the spawn que for the map. -**Default:** "False" - -## InvasionMultiplier -**Type:** Int32 -**Description:** The equation for calculating invasion size is 100 + (multiplier * (number of active players with greater than 200 health)) -**Default:** "1" - -## KickOnMediumcoreDeath -**Type:** Boolean -**Description:** Kicks a Hardcore player on death. -**Default:** "False" - -## KickProxyUsers -**Type:** Boolean -**Description:** Kicks users using a proxy as identified with the GeoIP database -**Default:** "True" - -## LogonDiscardThreshold -**Type:** Int32 -**Description:** Time, in milliseconds, to disallow discarding items after logging in when ServerSideInventory is ON -**Default:** "250" - -## MasterServer -**Type:** String -**Description:** Not implemented -**Default:** "127.0.0.1" - -## MaxDamage -**Type:** Int32 -**Description:** The maximum damage a player/npc can inflict -**Default:** "175" - -## MaximumLoginAttempts -**Type:** Int32 -**Description:** Number of failed login attempts before kicking the player. -**Default:** "3" - -## MaxProjDamage -**Type:** Int32 -**Description:** The maximum damage a projectile can inflict -**Default:** "175" - -## MaxRangeForDisabled -**Type:** Int32 -**Description:** The maximum distance players disabled for various reasons can move from -**Default:** "10" - -## MaxSlots -**Type:** Int32 -**Description:** Max slots for the server. If you want people to be kicked with "Server is full" set this to how many players you want max and then set Terraria max players to 2 higher. -**Default:** "8" - -## MediumcoreBanReason -**Type:** String -**Description:** Bans a Mediumcore player on death. -**Default:** "Death results in a ban" - -## MediumcoreKickReason -**Type:** String -**Description:** Kicks a Mediumcore player on death. -**Default:** "Death results in a kick" - -## MediumcoreOnly -**Type:** Boolean -**Description:** Mediumcore players ONLY. This means softcore players cannot join. -**Default:** "False" - -## MySqlDbName -**Type:** String -**Description:** Database name to connect to -**Default:** "" - -## MySqlHost -**Type:** String -**Description:** The MySQL Hostname and port to direct connections to -**Default:** "localhost:3306" - -## MySqlPassword -**Type:** String -**Description:** Database password to connect with -**Default:** "" - -## MySqlUsername -**Type:** String -**Description:** Database username to connect with -**Default:** "" - -## PreventBannedItemSpawn -**Type:** Boolean -**Description:** Prevent banned items from being /i or /give -**Default:** "False" - -## ProjectileThreshold -**Type:** Int32 -**Description:** Disable a player if they exceed this number of projectile new within 1 second. -**Default:** "50" - -## ProjIgnoreShrapnel -**Type:** Boolean -**Description:** Ignore shrapnel from crystal bullets for Projectile Threshold. -**Default:** "True" - -## PvPMode -**Type:** String -**Description:** Set the server pvp mode. Vaild types are, "normal", "always", "disabled" -**Default:** "normal" - -## RangeChecks -**Type:** Boolean -**Description:** Global protection agent for any block distance based anti-grief check. -**Default:** "True" - -## RconPassword -**Type:** String -**Description:** Not implemented -**Default:** "" - -## RconPort -**Type:** Int32 -**Description:** Not implemented -**Default:** "7777" - -## RegionProtectChests -**Type:** Boolean -**Description:** Protect chests with region and build permissions -**Default:** "False" - -## RememberLeavePos -**Type:** Boolean -**Description:** Remembers where a player left off. It works by remembering the IP, NOT the character. -eg. When you try to disconnect, and reconnect to be automatically placed at spawn, you'll be at your last location. Note: Won't save after server restarts. -**Default:** "False" - -## RequireLogin -**Type:** Boolean -**Description:** Require all players to register or login before being allowed to play. -**Default:** "False" - -## RestApiEnabled -**Type:** Boolean -**Description:** Enable/Disable the rest api. -**Default:** "False" - -## RestApiPort -**Type:** Int32 -**Description:** This is the port which the rest api will listen on. -**Default:** "7878" - -## SaveWorldOnCrash -**Type:** Boolean -**Description:** This will save the world if Terraria crashes from an unhandled exception. -**Default:** "True" - -## ServerFullNoReservedReason -**Type:** String -**Description:** String that is used when kicking people when the server is full with no reserved slots. -**Default:** "Server is full. No reserved slots open." - -## ServerFullReason -**Type:** String -**Description:** String that is used when kicking people when the server is full. -**Default:** "Server is full" - -## ServerName -**Type:** String -**Description:** Used when replying to a rest /status request. -**Default:** "" - -## ServerNickname -**Type:** String -**Description:** This is used when the API endpoint /status is queried. -**Default:** "TShock Server" - -## ServerPassword -**Type:** String -**Description:** Server password required to join server -**Default:** "" - -## ServerPort -**Type:** Int32 -**Description:** The port the server runs on. -**Default:** "7777" - -## ServerSideInventory -**Type:** Boolean -**Description:** Enable Server Side Inventory checks, EXPERIMENTAL -**Default:** "False" - -## ServerSideInventorySave -**Type:** Int32 -**Description:** How often SSI should save, in minutes -**Default:** "15" - -## SpawnProtection -**Type:** Boolean -**Description:** Prevents tiles from being placed within SpawnProtectionRadius of the default spawn. -**Default:** "True" - -## SpawnProtectionRadius -**Type:** Int32 -**Description:** Radius from spawn tile for SpawnProtection. -**Default:** "10" - -## StatueSpawn200 -**Type:** Int32 -**Description:** How many things a statue can spawn within 200 pixels(?) before it stops spawning. Default = 3 -**Default:** "3" - -## StatueSpawn600 -**Type:** Int32 -**Description:** How many things a statue can spawn within 600 pixels(?) before it stops spawning. Default = 6 -**Default:** "6" - -## StatueSpawnWorld -**Type:** Int32 -**Description:** How many things a statue spawns can exist in the world before it stops spawning. Default = 10 -**Default:** "10" - -## StorageType -**Type:** String -**Description:** Valid types are "sqlite" and "mysql" -**Default:** "sqlite" - -## SuperAdminChatPrefix -**Type:** String -**Description:** Super admin group chat prefix -**Default:** "(Admin) " - -## SuperAdminChatRGB -**Type:** Single[] -**Description:** #.#.#. = Red/Blue/Green - RGB Colors for the Admin Chat Color. Max value: 255 -**Default:** "System.Single[]" - -## SuperAdminChatSuffix -**Type:** String -**Description:** Super admin group chat suffix -**Default:** "" - -## TileKillThreshold -**Type:** Int32 -**Description:** Disable/Revert a player if they exceed this number of tile kills within 1 second. -**Default:** "60" - -## TileLiquidThreshold -**Type:** Int32 -**Description:** Disable a player if they exceed this number of liquid sets within 1 second. -**Default:** "15" - -## TilePlaceThreshold -**Type:** Int32 -**Description:** Disable/Revert a player if they exceed this number of tile places within 1 second. -**Default:** "20" - -## WhitelistKickReason -**Type:** String -**Description:** String that is used when a user is kicked due to not being on the whitelist. -**Default:** "You are not on the whitelist." - diff --git a/docs/src/index.md b/docs/src/index.md deleted file mode 100644 index 011bc89c..00000000 --- a/docs/src/index.md +++ /dev/null @@ -1,43 +0,0 @@ - - -# TShock Downloaded Documentation - -*Created for TShock version: 3.9.x.x* - -*Last updated: 5/26/2012* - ----- - -## Preface - -Welcome to the official TShock for Terraria downloaded documentation. This guide will walk through the installation and basic configuration of your newly downloaded TShock server, and should provide a basic knowledge as to how to get help from outside resources if needed. - -## Resources - -* [The Confluence wiki](http://develop.tshock.co:8080/) contains the most up to date information compiled by the community members. If your question isn't answered here, you might find it there. -* [The forums](http://tshock.co/xf/) provide an excellent place to ask other TShock users and developers questions. Please refrain from making posts about questions that may be answered here, however. -* [Our Github page](http://github.com/TShock/TShock) is where you'll be able to find the source code and the bug tracker. -* [IRC](irc://irc.shankshock.com/terraria) is our IRC channel, if you prefer that medium for support. -* Lastly, we can be found in the "Nyx" channel on the Teamspeak 3 server: ts3.shankshock.com, port 9987. - ----- - -## Table of contents - -1. [Installation & basic usage](install.md.html) -2. [Permissions](perms.md.html) -3. [The config file](config.md.html) -4. [Credits](#Credits) - ----- - -## Credits - -TShock wouldn't be possible without: - -* [Xenon Servers](http://xns.cc/) -* [Kerplunc Gaming](http://kerpluncgaming.com/) -* [Multiplay UK](http://multiplay.co.uk/) -* [Atlassian](http://www.atlassian.com/) -* [Github](http://github.com/) -* You :) \ No newline at end of file diff --git a/docs/src/install.md b/docs/src/install.md deleted file mode 100644 index 99d0a349..00000000 --- a/docs/src/install.md +++ /dev/null @@ -1,35 +0,0 @@ - - -# Install instructions & basic usage - -[Back to index](index.md.html) - ----- - -1. Assuming you've extracted TShock, you're done as far as files go. Run the TerrariaServer.exe file in the folder you've extracted TShock into. -2. Check to verify that the server window states that some version of TerrariaShock is now running. If this is not the case, stop. Re-download all files and extract them to a new folder, being sure to keep the file structure in tact. -3. Select a world and port to start the server. *TShock now uses its configuration file to control the number of players on the server. You can edit this value in the configuration file, discussed later. If you are generating a new world, you may experience a significantly longer time as the world creates itself. This is normal. -4. Once the server is finished starting, you will be greeted with TShock's main console window. You will see a message in yellow that states "*To become superadmin, join the game and type /auth*" preceding a series of numbers. This set of numbers we will refer to as the "authcode" in succeeding steps. -5. Connect to the server. Your IP address is 127.0.0.1, and the port will by default be on what you entered in the server console. -6. Immediately chat the following: "**/auth [authcode]**". Replace [authcode] with the code given in the server console. Example: /auth 123456. -7. Next, we will create a user account that you can login to. In the game, chat the command "**/user add [username]:[password] superadmin**". Replace [username] and [password] respectively with your appropriate details. You should be able to remeber your password, and it shouldn't be easily guessed. From now on, the phrase "run the command" is synonymous with "chat in the game chat box". In addition, where brackets ([]) are, we will assume you will replace those brackets with information that you have created. -8. Assuming the last step was a success, login. Run the command "**/login [username] [password]**". -9. To finalize installation, run the command "**/auth-verify**". This will disable the authcode, enable any previously disabled functionality, and allow the server to be used in production. - ----- - -### Basic Usage - -Now that TShock is running, you may be interested in a few other features prior to playing Terraria. - -* You can add admins through two methods. If the user is already registered, you can use "**/user group [username] [group-to-change-to]**". By default, TShock comes with the "vip" group, the "trustedadmin" group, and the "newadmin" group. If the user has yet to register, you can use "**/user add [username]:[password] [group]**" to generate an account with elevated permissions for them. -* When you join the server and already have an account, the server will ask for your account password, even if the server has no password setup. In the event that you set a password on the server, unregistered users will be required to enter it. Users that already have an account must enter their own password. -* If a user wishes to change accounts but retain their group, a config option exists that will allow you to allow users to login to accounts with any username. - ----- - -## Closing remarks - -Thanks for downloading TShock. Your continued support helps make TShock what it is today. We wouldn't be here without you. - -From everyone at TShock, thank-you. \ No newline at end of file diff --git a/docs/src/permissions.md b/docs/src/permissions.md deleted file mode 100644 index be2992f8..00000000 --- a/docs/src/permissions.md +++ /dev/null @@ -1,259 +0,0 @@ - - -# Permission Nodes - -These are the permissions that TShock currently supports, with associated commands. [Back to permissions](perms.md.html) - ----- - -## allowclientsideworldedit -**Description:** Allow unrestricted Send Tile Square usage, for client side world editing -**Commands:** None - -## annoy -**Description:** None -**Commands:** /annoy - -## ban -**Description:** User can ban others -**Commands:** /ban /banip /unban /unbanip - -## buff -**Description:** User can buff self -**Commands:** /buff - -## buffplayer -**Description:** User can buff other players -**Commands:** /gbuff(/buffplayer) - -## butcher -**Description:** User can kill all enemy npcs -**Commands:** /butcher - -## bypassinventorychecks -**Description:** Bypass Server Side Inventory checks -**Commands:** None - -## canbuild -**Description:** Required to be able to build (modify tiles and liquid) -**Commands:** None - -## canchangepassword -**Description:** User can change password in game -**Commands:** /password - -## canlogin -**Description:** User can login in game -**Commands:** /login - -## canpartychat -**Description:** User can use party chat in game -**Commands:** /p - -## canregister -**Description:** User can register account in game -**Commands:** /register - -## cantalkinthird -**Description:** User can talk in third person -**Commands:** /me - -## causeevents -**Description:** None -**Commands:** /dropmeteor /star /fullmoon /bloodmoon /invade - -## cfg -**Description:** User can edit sevrer configurations -**Commands:** /setspawn /reload /serverpassword /save /settle /maxspawns /spawnrate /broadcast(/bc /say) /stats /world - -## clearitems -**Description:** User can clear item drops. -**Commands:** /clear(/clearitems) - -## converthardmode -**Description:** User can convert hallow into corruption and vice-versa -**Commands:** /convertcorruption /converthallow /removespecial - -## editspawn -**Description:** Allows you to edit the spawn -**Commands:** /antibuild /protectspawn - -## grow -**Description:** None -**Commands:** /grow - -## hardmode -**Description:** User can change hardmode state. -**Commands:** /hardmode /stophardmode(/disablehardmode) - -## heal -**Description:** None -**Commands:** /heal - -## ignoredamagecap -**Description:** Prevents your actions from being ignored if damage is too high -**Commands:** None - -## ignorekilltiledetection -**Description:** Prevents you from being reverted by kill tile abuse detection -**Commands:** None - -## ignoreliquidsetdetection -**Description:** Prevents you from being disabled by liquid set abuse detection -**Commands:** None - -## ignorenoclipdetection -**Description:** Prevents you from being reverted by no clip detection -**Commands:** None - -## ignoreplacetiledetection -**Description:** Prevents you from being reverted by place tile abuse detection -**Commands:** None - -## ignoreprojectiledetection -**Description:** Prevents you from being disabled by liquid set abuse detection -**Commands:** None - -## ignorestackhackdetection -**Description:** Prevents you from being disabled by stack hack detection -**Commands:** None - -## ignorestathackdetection -**Description:** Prevents you from being kicked by hacked health detection -**Commands:** None - -## immunetoban -**Description:** Prevents you from being banned -**Commands:** None - -## immunetokick -**Description:** Prevents you from being kicked -**Commands:** None - -## item -**Description:** User can spawn items -**Commands:** /item(/i) /give(/g) - -## kick -**Description:** User can kick others -**Commands:** /kick - -## kill -**Description:** None -**Commands:** /kill - -## logs -**Description:** Specific log messages are sent to users with this permission -**Commands:** /displaylogs - -## maintenance -**Description:** User is notified when an update is available -**Commands:** /clearbans /off(/exit) /restart /off-nosave(/exit-nosave) /checkupdates - -## managegroup -**Description:** User can manage groups -**Commands:** /addgroup /delgroup /modgroup /group - -## manageitem -**Description:** User can manage item bans -**Commands:** /additem(/banitem) /delitem(/unbanitem) /listitems(/listbanneditems) /additemgroup /delitemgroup - -## manageregion -**Description:** User can edit regions -**Commands:** /region /debugreg - -## managewarp -**Description:** User can manage warps -**Commands:** /setwarp /delwarp /hidewarp - -## movenpc -**Description:** User can change the homes of NPCs. -**Commands:** None - -## mute -**Description:** User can mute and unmute users -**Commands:** /mute(/unmute) - -## pvpfun -**Description:** None -**Commands:** /slap - -## reservedslot -**Description:** Allows you to bypass the max slots for up to 5 slots above your max -**Commands:** None - -## restapi -**Description:** User can use rest api calls. -**Commands:** None - -## rootonly -**Description:** Meant for super admins only -**Commands:** /user /auth-verify - -## savessi -**Description:** User can save all the players SSI state. -**Commands:** /savessi /overridessi(/ossi) - -## seeids -**Description:** User can see the id of players with /who -**Commands:** None - -## spawnboss -**Description:** User can spawn bosses -**Commands:** /eater /eye /king /skeletron /wof(/wallofflesh) /twins /destroyer /skeletronp(/prime) /hardcore - -## spawnmob -**Description:** User can spawn npcs -**Commands:** /spawnmob(/sm) - -## startinvasion -**Description:** User can start invasions (Goblin/Snow Legion) using items -**Commands:** None - -## summonboss -**Description:** User can summon bosses using items -**Commands:** None - -## time -**Description:** None -**Commands:** /time - -## tp -**Description:** User can teleport -**Commands:** /home /spawn /tp - -## tpall -**Description:** Users can tp to anyone -**Commands:** None - -## tpallow -**Description:** Users can stop people from TPing to them -**Commands:** /tpallow - -## tphere -**Description:** User can teleport people to them -**Commands:** /tphere /sendwarp(/sw) - -## tphide -**Description:** Users can tp to people without showing a notice -**Commands:** None - -## usebanneditem -**Description:** Allows you to use banned items -**Commands:** None - -## userinfo -**Description:** Allows player to get user info -**Commands:** /userinfo(/ui) - -## warp -**Description:** User can use warps -**Commands:** /warp - -## whisper -**Description:** User can whisper to others -**Commands:** /whisper(/w /tell) /reply(/r) - -## whitelist -**Description:** User can modify the whitelist -**Commands:** /whitelist \ No newline at end of file diff --git a/docs/src/perms.md b/docs/src/perms.md deleted file mode 100644 index c51fdde0..00000000 --- a/docs/src/perms.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# Permissions - -[Back to index](index.md.html) - -## Permissions - -Like Bukkit and other administrative modifications, TShock supports adding groups and permissions. In the current implementation, you can only edit groups ingame, adding and removing them isn't supported *yet*. - -## Adding permissions: - -To add a permission to a given group, use the command "**/modgroup [add|del] [group] [permission]**". Example: */modgroup add trustedadmin tpall*. - -## Permission nodes: - -[A list of permission nodes can be found here.](permissions.md.html) \ No newline at end of file From 1f97447ea882808af1f7bdde519f54e6d8e1b3d2 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 21 Feb 2015 19:39:28 -0700 Subject: [PATCH 20/37] Remove 4 year old Terraria.csproj file --- Terraria.csproj | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 Terraria.csproj diff --git a/Terraria.csproj b/Terraria.csproj deleted file mode 100644 index 9500409a..00000000 --- a/Terraria.csproj +++ /dev/null @@ -1,46 +0,0 @@ - - - - local - 7.10.377 - 2.0 - {1528EA3F-A6D2-49F6-BF75-7A842CF4D97B} - Debug - TShock - WinExe - v4.0 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - \ No newline at end of file From 5788beed1ce93c73d6ffcd1ff2e53d4f8925bf0c Mon Sep 17 00:00:00 2001 From: Zack Date: Sat, 21 Feb 2015 23:13:52 -0500 Subject: [PATCH 21/37] Revert back to using requests... --- deploy_release.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/deploy_release.py b/deploy_release.py index 35d3b963..b4e7dfc6 100644 --- a/deploy_release.py +++ b/deploy_release.py @@ -1,9 +1,11 @@ -import urllib2 +import requests import json import sys import os -req_url = 'https://api.github.com/repos/NyxStudios/TShock/releases' +create_release_url = 'https://api.github.com/repos/NyxStudios/TShock/releases' +release_name = 'tshock_release.zip' + branch = os.environ["GIT_BRANCH"] tag_name = os.environ["bamboo_tag_name"] name = os.environ["bamboo_release_name"] @@ -11,13 +13,20 @@ name = os.environ["bamboo_release_name"] #because we can't find any other secure way to get a token into this script run from bamboo :'( with open('/home/bamboo/scripts/token.py') as f: token = f.read().rsplit('=', 1)[1].strip() - body = 'This is the newest release for TShock. Please see the release thread for more information @ http://tshock.co/xf' data = {'tag_name':tag_name, 'target_commitish':branch, 'name':name, 'body':body, 'draft':False, 'prerelease':False} - -headers = {'Content-Type': 'application/json', 'Authorization': 'token ' + token} - +create_headers = {'Content-Type': 'application/json', 'Authorization': 'token ' + token} json_data = json.dumps(data) -req = urllib2.Request(req_url, json_data, headers) -urllib2.urlopen(req) \ No newline at end of file + +r = requests.post(create_release_url, data=json_data, headers=create_headers) +json_response = json.loads(r.text) + +release_id = json_response['id'] +upload_url = json_response['upload_url'].rsplit('{')[0] +upload_url = upload_url + '?name=' + release_name + +upload_headers = {'Authorization': 'token ' + token} +files = {'file': (release_name, open(release_name, 'rb'), 'application/zip')} +r = requests.post(upload_url, files=files, headers = upload_headers) + From 0bc0b8d4bf73d4180f42f4d9c79ce23531e86e1f Mon Sep 17 00:00:00 2001 From: Zack Date: Sat, 21 Feb 2015 23:21:20 -0500 Subject: [PATCH 22/37] Ignore SSL certs --- deploy_release.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy_release.py b/deploy_release.py index b4e7dfc6..b33cc2ad 100644 --- a/deploy_release.py +++ b/deploy_release.py @@ -28,5 +28,5 @@ upload_url = upload_url + '?name=' + release_name upload_headers = {'Authorization': 'token ' + token} files = {'file': (release_name, open(release_name, 'rb'), 'application/zip')} -r = requests.post(upload_url, files=files, headers = upload_headers) +r = requests.post(upload_url, files=files, headers = upload_headers, verify=False) From ea39210a4f1671e0d6f13708540c03d5659cbf35 Mon Sep 17 00:00:00 2001 From: Zack Date: Sat, 21 Feb 2015 23:30:18 -0500 Subject: [PATCH 23/37] Lets not encode the content headers into the binary data being sent causing our zip file to be corrupt, ok? --- deploy_release.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy_release.py b/deploy_release.py index b33cc2ad..375f36a2 100644 --- a/deploy_release.py +++ b/deploy_release.py @@ -13,9 +13,10 @@ name = os.environ["bamboo_release_name"] #because we can't find any other secure way to get a token into this script run from bamboo :'( with open('/home/bamboo/scripts/token.py') as f: token = f.read().rsplit('=', 1)[1].strip() + body = 'This is the newest release for TShock. Please see the release thread for more information @ http://tshock.co/xf' -data = {'tag_name':tag_name, 'target_commitish':branch, 'name':name, 'body':body, 'draft':False, 'prerelease':False} +data = {'tag_name':tag_name, 'target_commitish':branch, 'name':name, 'body':body, 'draft':True, 'prerelease':False} create_headers = {'Content-Type': 'application/json', 'Authorization': 'token ' + token} json_data = json.dumps(data) @@ -26,7 +27,6 @@ release_id = json_response['id'] upload_url = json_response['upload_url'].rsplit('{')[0] upload_url = upload_url + '?name=' + release_name -upload_headers = {'Authorization': 'token ' + token} -files = {'file': (release_name, open(release_name, 'rb'), 'application/zip')} -r = requests.post(upload_url, files=files, headers = upload_headers, verify=False) +upload_headers = {'Authorization': 'token ' + token, 'Content-Type':'application/zip', 'Content-Length':str(os.path.getsize(release_name))} +r = requests.post(upload_url, data=open(release_name, 'rb'), headers = upload_headers, verify=False) From 57029fa0af51737a961fb96fb44c9b03360ea703 Mon Sep 17 00:00:00 2001 From: Zack Date: Sat, 21 Feb 2015 23:34:16 -0500 Subject: [PATCH 24/37] You know it is getting late when you forgot to switch it back to not creating drafts. But hey, it worked \O/ --- deploy_release.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy_release.py b/deploy_release.py index 375f36a2..7d1b7785 100644 --- a/deploy_release.py +++ b/deploy_release.py @@ -16,7 +16,7 @@ with open('/home/bamboo/scripts/token.py') as f: body = 'This is the newest release for TShock. Please see the release thread for more information @ http://tshock.co/xf' -data = {'tag_name':tag_name, 'target_commitish':branch, 'name':name, 'body':body, 'draft':True, 'prerelease':False} +data = {'tag_name':tag_name, 'target_commitish':branch, 'name':name, 'body':body, 'draft':False, 'prerelease':False} create_headers = {'Content-Type': 'application/json', 'Authorization': 'token ' + token} json_data = json.dumps(data) From 91d5fab27de2b1643a288bcc5ae335164d70541b Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 21 Feb 2015 22:35:05 -0700 Subject: [PATCH 25/37] Add account create & delete hooks --- TShockAPI/DB/UserManager.cs | 4 ++ TShockAPI/Hooks/AccountHooks.cs | 66 +++++++++++++++++++++++++++++++++ TShockAPI/TShockAPI.csproj | 3 +- 3 files changed, 72 insertions(+), 1 deletion(-) mode change 100644 => 100755 TShockAPI/DB/UserManager.cs create mode 100755 TShockAPI/Hooks/AccountHooks.cs diff --git a/TShockAPI/DB/UserManager.cs b/TShockAPI/DB/UserManager.cs old mode 100644 new mode 100755 index 07b94f63..a1c8e819 --- a/TShockAPI/DB/UserManager.cs +++ b/TShockAPI/DB/UserManager.cs @@ -76,6 +76,8 @@ namespace TShockAPI.DB if (1 > ret) throw new UserExistsException(user.Name); + + Hooks.AccountHooks.OnAccountCreate(user); } /// @@ -90,6 +92,8 @@ namespace TShockAPI.DB if (affected < 1) throw new UserNotExistException(user.Name); + + Hooks.AccountHooks.OnAccountDelete(user); } catch (Exception ex) { diff --git a/TShockAPI/Hooks/AccountHooks.cs b/TShockAPI/Hooks/AccountHooks.cs new file mode 100755 index 00000000..e9bf76d2 --- /dev/null +++ b/TShockAPI/Hooks/AccountHooks.cs @@ -0,0 +1,66 @@ +/* +TShock, a server mod for Terraria +Copyright (C) 2011-2015 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 +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 TShockAPI.DB; +namespace TShockAPI.Hooks +{ + public class AccountDeleteEventArgs + { + public User User { get; set; } + + public AccountDeleteEventArgs(User user) + { + this.User = user; + } + } + + public class AccountCreateEventArgs + { + public User User { get; set; } + + public AccountCreateEventArgs(User user) + { + this.User = user; + } + } + + public class AccountHooks + { + public delegate void AccountCreateD(AccountCreateEventArgs e); + public static event AccountCreateD AccountCreate; + + public static void OnAccountCreate(User u) + { + if (AccountCreate == null) + return; + + AccountCreate(new AccountCreateEventArgs(u)); + } + + public delegate void AccountDeleteD(AccountDeleteEventArgs e); + public static event AccountDeleteD AccountDelete; + + public static void OnAccountDelete(User u) + { + if (AccountDelete == null) + return; + + AccountDelete(new AccountDeleteEventArgs(u)); + } + } +} diff --git a/TShockAPI/TShockAPI.csproj b/TShockAPI/TShockAPI.csproj index 75ef9782..4072b8ed 100644 --- a/TShockAPI/TShockAPI.csproj +++ b/TShockAPI/TShockAPI.csproj @@ -75,6 +75,7 @@ + @@ -181,7 +182,7 @@ - +