diff --git a/TShock.sln b/TShock.sln
index 2f54cde7..ffd92353 100644
--- a/TShock.sln
+++ b/TShock.sln
@@ -1,14 +1,12 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.40629.0
+# Visual Studio 15
+VisualStudioVersion = 15.0.25807.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{755F5B05-0924-47E9-9563-26EB20FE3F67}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TShockAPI", "TShockAPI\TShockAPI.csproj", "{49606449-072B-4CF5-8088-AA49DA586694}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TerrariaServer", "TerrariaServerAPI\TerrariaServer.csproj", "{6877506E-ADC6-4142-98A6-79E4FA02855A}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -29,16 +27,6 @@ Global
{49606449-072B-4CF5-8088-AA49DA586694}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Release|x86.ActiveCfg = Release|Any CPU
- {6877506E-ADC6-4142-98A6-79E4FA02855A}.Debug|Any CPU.ActiveCfg = Debug|x86
- {6877506E-ADC6-4142-98A6-79E4FA02855A}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {6877506E-ADC6-4142-98A6-79E4FA02855A}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {6877506E-ADC6-4142-98A6-79E4FA02855A}.Debug|x86.ActiveCfg = Debug|x86
- {6877506E-ADC6-4142-98A6-79E4FA02855A}.Debug|x86.Build.0 = Debug|x86
- {6877506E-ADC6-4142-98A6-79E4FA02855A}.Release|Any CPU.ActiveCfg = Release|x86
- {6877506E-ADC6-4142-98A6-79E4FA02855A}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {6877506E-ADC6-4142-98A6-79E4FA02855A}.Release|Mixed Platforms.Build.0 = Release|x86
- {6877506E-ADC6-4142-98A6-79E4FA02855A}.Release|x86.ActiveCfg = Release|x86
- {6877506E-ADC6-4142-98A6-79E4FA02855A}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/TShockAPI/BackupManager.cs b/TShockAPI/BackupManager.cs
index 58b544f4..b5bf734d 100644
--- a/TShockAPI/BackupManager.cs
+++ b/TShockAPI/BackupManager.cs
@@ -62,7 +62,7 @@ namespace TShockAPI
string worldname = Main.worldPathName;
string name = Path.GetFileName(worldname);
- Main.worldPathName = Path.Combine(BackupPath, string.Format("{0}.{1:dd.MM.yy-HH.mm.ss}.bak", name, DateTime.UtcNow));
+ Main.ActiveWorldFileData._path = Path.Combine(BackupPath, string.Format("{0}.{1:dd.MM.yy-HH.mm.ss}.bak", name, DateTime.UtcNow));
string worldpath = Path.GetDirectoryName(Main.worldPathName);
if (worldpath != null && !Directory.Exists(worldpath))
@@ -80,7 +80,7 @@ namespace TShockAPI
Console.ForegroundColor = ConsoleColor.Gray;
TShock.Log.Info(string.Format("World backed up ({0}).", Main.worldPathName));
- Main.worldPathName = worldname;
+ Main.ActiveWorldFileData._path = worldname;
}
catch (Exception ex)
{
diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs
old mode 100755
new mode 100644
index 754d6fab..8e5ffd91
--- a/TShockAPI/Commands.cs
+++ b/TShockAPI/Commands.cs
@@ -31,6 +31,8 @@ using TShockAPI.DB;
using TerrariaApi.Server;
using TShockAPI.Hooks;
using Terraria.GameContent.Events;
+using Microsoft.Xna.Framework;
+using OTAPI.Tile;
namespace TShockAPI
{
@@ -2116,7 +2118,7 @@ namespace TShockAPI
else
{
Main.anglerWhoFinishedToday.Clear();
- NetMessage.SendAnglerQuest();
+ NetMessage.SendAnglerQuest(-1);
args.Player.SendSuccessMessage("Cleared all users from the angler quest completion list for today.");
}
}
@@ -4437,7 +4439,7 @@ namespace TShockAPI
// Could be improved by sending raw tile data to the client instead but not really
// worth the effort as chances are very low that overwriting the wire for a few
// nanoseconds will cause much trouble.
- Tile tile = Main.tile[boundaryPoint.X, boundaryPoint.Y];
+ ITile tile = Main.tile[boundaryPoint.X, boundaryPoint.Y];
bool oldWireState = tile.wire();
tile.wire(true);
diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs
old mode 100755
new mode 100644
diff --git a/TShockAPI/DB/BanManager.cs b/TShockAPI/DB/BanManager.cs
old mode 100755
new mode 100644
diff --git a/TShockAPI/DB/CharacterManager.cs b/TShockAPI/DB/CharacterManager.cs
old mode 100755
new mode 100644
diff --git a/TShockAPI/DB/GroupManager.cs b/TShockAPI/DB/GroupManager.cs
old mode 100755
new mode 100644
diff --git a/TShockAPI/DB/ItemManager.cs b/TShockAPI/DB/ItemManager.cs
old mode 100755
new mode 100644
diff --git a/TShockAPI/DB/ProjectileManager.cs b/TShockAPI/DB/ProjectileManager.cs
old mode 100755
new mode 100644
diff --git a/TShockAPI/DB/RegionManager.cs b/TShockAPI/DB/RegionManager.cs
old mode 100755
new mode 100644
index 47fb4843..1e1ed74e
--- a/TShockAPI/DB/RegionManager.cs
+++ b/TShockAPI/DB/RegionManager.cs
@@ -22,6 +22,7 @@ using System.Data;
using System.Linq;
using MySql.Data.MySqlClient;
using Terraria;
+using Microsoft.Xna.Framework;
namespace TShockAPI.DB
{
diff --git a/TShockAPI/DB/RememberedPosManager.cs b/TShockAPI/DB/RememberedPosManager.cs
old mode 100755
new mode 100644
index 44b21a5d..cb1735ad
--- a/TShockAPI/DB/RememberedPosManager.cs
+++ b/TShockAPI/DB/RememberedPosManager.cs
@@ -20,6 +20,7 @@ using System;
using System.Data;
using MySql.Data.MySqlClient;
using Terraria;
+using Microsoft.Xna.Framework;
namespace TShockAPI.DB
{
diff --git a/TShockAPI/DB/SqlTable.cs b/TShockAPI/DB/SqlTable.cs
old mode 100755
new mode 100644
diff --git a/TShockAPI/DB/TileManager.cs b/TShockAPI/DB/TileManager.cs
old mode 100755
new mode 100644
diff --git a/TShockAPI/DB/UserManager.cs b/TShockAPI/DB/UserManager.cs
old mode 100755
new mode 100644
diff --git a/TShockAPI/DB/WarpsManager.cs b/TShockAPI/DB/WarpsManager.cs
old mode 100755
new mode 100644
index f06003f6..9ea67600
--- a/TShockAPI/DB/WarpsManager.cs
+++ b/TShockAPI/DB/WarpsManager.cs
@@ -23,6 +23,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Linq;
using MySql.Data.MySqlClient;
using Terraria;
+using Microsoft.Xna.Framework;
namespace TShockAPI.DB
{
diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs
old mode 100755
new mode 100644
index 82db3096..cead709a
--- a/TShockAPI/GetDataHandlers.cs
+++ b/TShockAPI/GetDataHandlers.cs
@@ -32,6 +32,8 @@ using Terraria;
using Terraria.ObjectData;
using Terraria.DataStructures;
using Terraria.GameContent.Tile_Entities;
+using Microsoft.Xna.Framework;
+using OTAPI.Tile;
namespace TShockAPI
{
@@ -2053,7 +2055,7 @@ namespace TShockAPI
Item selectedItem = args.Player.SelectedItem;
int lastKilledProj = args.Player.LastKilledProjectile;
- Tile tile = Main.tile[tileX, tileY];
+ ITile tile = Main.tile[tileX, tileY];
if (action == EditAction.PlaceTile)
{
diff --git a/TShockAPI/Hooks/AccountHooks.cs b/TShockAPI/Hooks/AccountHooks.cs
old mode 100755
new mode 100644
diff --git a/TShockAPI/PaginationTools.cs b/TShockAPI/PaginationTools.cs
index 3bc6de89..55526040 100644
--- a/TShockAPI/PaginationTools.cs
+++ b/TShockAPI/PaginationTools.cs
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
+using Microsoft.Xna.Framework;
using System;
using System.Collections;
using System.Collections.Generic;
diff --git a/TShockAPI/PlayerData.cs b/TShockAPI/PlayerData.cs
index 7422bc80..d0da70a7 100644
--- a/TShockAPI/PlayerData.cs
+++ b/TShockAPI/PlayerData.cs
@@ -16,7 +16,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
-using Terraria;
+using Microsoft.Xna.Framework;
+using Terraria;
using TShockAPI;
namespace TShockAPI
diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs
old mode 100755
new mode 100644
diff --git a/TShockAPI/Rest/SecureRest.cs b/TShockAPI/Rest/SecureRest.cs
index cf3a9fd2..da74099b 100644
--- a/TShockAPI/Rest/SecureRest.cs
+++ b/TShockAPI/Rest/SecureRest.cs
@@ -23,6 +23,7 @@ using System.Net;
using HttpServer;
using TShockAPI;
using TShockAPI.DB;
+using Microsoft.Xna.Framework;
namespace Rests
{
diff --git a/TShockAPI/SaveManager.cs b/TShockAPI/SaveManager.cs
index 9ff98287..52166b2a 100644
--- a/TShockAPI/SaveManager.cs
+++ b/TShockAPI/SaveManager.cs
@@ -15,6 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
+using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Threading;
diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs
old mode 100755
new mode 100644
index 96ba95af..d03681eb
--- a/TShockAPI/TSPlayer.cs
+++ b/TShockAPI/TSPlayer.cs
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
+using Microsoft.Xna.Framework;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -24,6 +25,7 @@ using System.IO;
using System.Text;
using System.Threading;
using System.Timers;
+using OTAPI.Tile;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
@@ -121,12 +123,12 @@ namespace TShockAPI
///
/// A queue of tiles destroyed by the player for reverting.
///
- public Dictionary TilesDestroyed { get; protected set; }
+ public Dictionary TilesDestroyed { get; protected set; }
///
/// A queue of tiles placed by the player for reverting.
///
- public Dictionary TilesCreated { get; protected set; }
+ public Dictionary TilesCreated { get; protected set; }
///
/// The player's group.
@@ -641,8 +643,8 @@ namespace TShockAPI
/// The player's index in the.
public TSPlayer(int index)
{
- TilesDestroyed = new Dictionary();
- TilesCreated = new Dictionary();
+ TilesDestroyed = new Dictionary();
+ TilesCreated = new Dictionary();
Index = index;
Group = Group.DefaultGroup;
IceTiles = new List();
@@ -655,8 +657,8 @@ namespace TShockAPI
/// The player's name.
protected TSPlayer(String playerName)
{
- TilesDestroyed = new Dictionary();
- TilesCreated = new Dictionary();
+ TilesDestroyed = new Dictionary();
+ TilesCreated = new Dictionary();
Index = -1;
FakePlayer = new Player {name = playerName, whoAmI = -1};
Group = Group.DefaultGroup;
diff --git a/TShockAPI/TSServerPlayer.cs b/TShockAPI/TSServerPlayer.cs
index 72517a52..94036b96 100644
--- a/TShockAPI/TSServerPlayer.cs
+++ b/TShockAPI/TSServerPlayer.cs
@@ -16,6 +16,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
+using Microsoft.Xna.Framework;
+using OTAPI.Tile;
using System;
using System.Collections.Generic;
using Terraria;
@@ -165,10 +167,10 @@ namespace TShockAPI
NetMessage.SendData((int)PacketTypes.NpcStrike, -1, -1, "", npcid, damage, knockBack, hitDirection);
}
- public void RevertTiles(Dictionary tiles)
+ public void RevertTiles(Dictionary tiles)
{
// Update Main.Tile first so that when tile sqaure is sent it is correct
- foreach (KeyValuePair entry in tiles)
+ foreach (KeyValuePair entry in tiles)
{
Main.tile[(int)entry.Key.X, (int)entry.Key.Y] = entry.Value;
}
diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs
old mode 100755
new mode 100644
index c4d06606..6e8d0bf0
--- a/TShockAPI/TShock.cs
+++ b/TShockAPI/TShock.cs
@@ -39,6 +39,7 @@ using TShockAPI.DB;
using TShockAPI.Hooks;
using TShockAPI.ServerSideCharacters;
using Terraria.Utilities;
+using Microsoft.Xna.Framework;
namespace TShockAPI
{
@@ -578,7 +579,7 @@ namespace TShockAPI
{
if (Main.worldPathName != null && Config.SaveWorldOnCrash)
{
- Main.worldPathName += ".crash";
+ Main.ActiveWorldFileData._path += ".crash";
SaveManager.Instance.SaveWorld();
}
}
@@ -675,7 +676,7 @@ namespace TShockAPI
}
case "-autoshutdown":
{
- Main.instance.autoShut();
+ Main.instance.EnableAutoShutdown();
break;
}
case "-autocreate":
@@ -705,9 +706,11 @@ namespace TShockAPI
int limit;
if (int.TryParse(parms[++i], out limit))
{
+ /* Todo - Requires an OTAPI modification
Netplay.MaxConnections = limit;
ServerApi.LogWriter.PluginWriteLine(this, string.Format(
- "Connections per IP have been limited to {0} connections.", limit), TraceLevel.Verbose);
+ "Connections per IP have been limited to {0} connections.", limit), TraceLevel.Verbose);*/
+ ServerApi.LogWriter.PluginWriteLine(this, "\"-connperip\" is not supported in this version of TShock.", TraceLevel.Verbose);
}
else
ServerApi.LogWriter.PluginWriteLine(this, "Invalid value given for command line argument \"-connperip\".", TraceLevel.Warning);
@@ -1684,7 +1687,10 @@ namespace TShockAPI
invasionSize = 100 + (Config.InvasionMultiplier * Utils.ActivePlayers());
}
- Main.StartInvasion(type, invasionSize);
+ // Note: This is a workaround to previously providing the size as a parameter in StartInvasion
+ Main.invasionSize = invasionSize;
+
+ Main.StartInvasion(type);
}
/// CheckProjectilePermission - Checks if a projectile is banned.
diff --git a/TShockAPI/TShockAPI.csproj b/TShockAPI/TShockAPI.csproj
index c6c65341..351ffc4f 100644
--- a/TShockAPI/TShockAPI.csproj
+++ b/TShockAPI/TShockAPI.csproj
@@ -72,9 +72,16 @@
..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll
True
+
+ ..\prebuilts\OTAPI.dll
+
+
+ False
+ ..\prebuilts\TerrariaServer.exe
+
@@ -177,12 +184,6 @@
true
-
-
- {6877506E-ADC6-4142-98A6-79E4FA02855A}
- TerrariaServer
-
-
@@ -194,7 +195,7 @@
-
+