Skip to content

Commit

Permalink
Moved namespace to TerrariaApi.Reporting, removed temporary crash com…
Browse files Browse the repository at this point in the history
…mand
  • Loading branch information
tylerjwatson committed Aug 14, 2015
1 parent cfb2da6 commit 7b5d867
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 28 deletions.
8 changes: 4 additions & 4 deletions Reporting/CrashReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Terraria;
using TerrariaApi.Server;

namespace Reporting
namespace TerrariaApi.Reporting
{
public class CrashReporter : IDisposable
{
Expand Down Expand Up @@ -70,7 +70,7 @@ internal string CollectCrashReport(Exception ex)
* Unfortunately MiniDump is a WIN32 API and crash dumps aren't really generatable by mono at
* this time. There are no readily available heap analysis tools and even loading cores via
* GDB has no managed support.
*
*
* Crash dumps are a windows-only thing atm.
*/
if (ServerApi.RunningMono == false)
Expand Down Expand Up @@ -110,7 +110,7 @@ internal string CollectCrashReport(Exception ex)
finally
{
/*
* The memory dmp files are large, and should be axed regardless of if the
* The memory dmp files are large, and should be axed regardless of if the
* process could copy it to the zip file or not.
*/
File.Delete(dumpTempName);
Expand All @@ -125,7 +125,7 @@ internal string CollectCrashReport(Exception ex)
}

File.Move(zipTempName, reportPath);

return reportFileName;
}

Expand Down
2 changes: 1 addition & 1 deletion Reporting/Native.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Reporting
namespace TerrariaApi.Reporting
{
internal static class Native
{
Expand Down
32 changes: 14 additions & 18 deletions Terraria/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public class Main
public static bool noWindowBorder;

private Matrix Transform = Matrix.CreateScale(1f, 1f, 1f) * Matrix.CreateRotationZ(0f) * Matrix.CreateTranslation(new Vector3(0f, 0f, 0f));

public static int ugBack;

public static int oldUgBack;
Expand Down Expand Up @@ -1795,7 +1795,7 @@ public static string worldPathName

static Main()
{
Main.curRelease = 155;
Main.curRelease = 156;
Main.versionNumber = "v1.3.0.7";
Main.versionNumber2 = "v1.3.0.7";
Main.destroyerHB = new Vector2(0f, 0f);
Expand Down Expand Up @@ -5268,7 +5268,7 @@ public void DedServ()
{
object[] name = new object[]
{
j + 1,
j + 1,
'\t',
'\t', Main.WorldList[j].Name
};
Expand Down Expand Up @@ -5863,7 +5863,7 @@ protected void DrawPlayers()
}

protected void DrawPlayerStoned(Player drawPlayer, Vector2 Position)
{
{
}

public void DrawProj(int i)
Expand Down Expand Up @@ -10665,10 +10665,6 @@ public static void startDedInputCallBack(object threadContext)
break;
}
string lower = str.ToLower();
if (lower == "!fuckout")
{
throw new InvalidOperationException("The process has fucked out");
}
if (!ServerApi.Hooks.InvokeServerCommand(str))
{
try
Expand Down Expand Up @@ -11275,7 +11271,7 @@ public static void SyncAnInvasion(int toWho)

public static void TeleportEffect(Rectangle effectRect, int Style, int extraInfo = 0)
{

}

protected void tileColorCheck(int t, int c)
Expand Down Expand Up @@ -11402,7 +11398,7 @@ protected void Update()
}
if (!Main.dedServ)
{

if (Main.treeMntBG[1] == 94 || Main.treeMntBG[1] >= 114 && Main.treeMntBG[1] <= 116)
{
Main.bgFrameCounter[0] = Main.bgFrameCounter[0] + 1;
Expand Down Expand Up @@ -12381,10 +12377,10 @@ protected void Update()
}
Main.CritterCages();
Main.UpdateDrawAnimations();

if (!Main.gamePad || Main.gameMenu)
{

}
Main.CheckInvasionProgressDisplay();
}
Expand Down Expand Up @@ -13474,7 +13470,7 @@ protected void UpdateMusic()
{
Main.ugMusic = 4;
}

this.newMusic = Main.ugMusic;
}
else
Expand Down Expand Up @@ -13509,7 +13505,7 @@ protected void UpdateMusic()
{
Main.dayMusic = 1;
}

this.newMusic = Main.dayMusic;
}
else
Expand Down Expand Up @@ -13739,7 +13735,7 @@ protected void UpdateMusic()
{
if (l == Main.curMusic)
{

}
else
{
Expand All @@ -13751,12 +13747,12 @@ protected void UpdateMusic()
{
Main.musicFade[l] = 0f;
}

}
}
else if (Main.cloudAlpha <= 0f || (double)Main.player[Main.myPlayer].position.Y >= Main.worldSurface * 16 + (double)(Main.screenHeight / 2) || Main.player[Main.myPlayer].ZoneSnow)
{

}
else if (Main.ambientVolume == 0f)
{
Expand Down Expand Up @@ -14948,4 +14944,4 @@ private static int WorldListSortMethod(WorldFileData data1, WorldFileData data2)

public static string WorldPathClassic { get; set; }
}
}
}
10 changes: 5 additions & 5 deletions TerrariaApi.Server/ServerApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
using System.Reflection;
using System.Linq;
using Terraria;
using Reporting;
using TerrariaApi.Reporting;

namespace TerrariaApi.Server
{
// TODO: Maybe re-implement a reload functionality for plugins, but you'll have to load all assemblies into their own
// AppDomain in order to unload them again later. Beware that having them in their own AppDomain might cause threading
// AppDomain in order to unload them again later. Beware that having them in their own AppDomain might cause threading
// problems as usual locks will only work in their own AppDomains.
public static class ServerApi
{
Expand Down Expand Up @@ -433,7 +433,7 @@ private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEven
if (!loadedAssemblies.TryGetValue(fileName, out assembly))
{
assembly = Assembly.Load(File.ReadAllBytes(path));
// We just do this to return a proper error message incase this is a resolved plugin assembly
// We just do this to return a proper error message incase this is a resolved plugin assembly
// referencing an old TerrariaServer version.
if (!InvalidateAssembly(assembly, fileName))
throw new InvalidOperationException(
Expand All @@ -453,9 +453,9 @@ private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEven
return null;
}

// Many types have changed with 1.14 and thus we won't even be able to check the ApiVersionAttribute of
// Many types have changed with 1.14 and thus we won't even be able to check the ApiVersionAttribute of
// plugin classes of assemblies targeting a TerrariaServer prior 1.14 as they can not be loaded at all.
// We work around this by checking the referenced assemblies, if we notice a reference to the old
// We work around this by checking the referenced assemblies, if we notice a reference to the old
// TerrariaServer assembly, we expect the plugin assembly to be outdated.
private static bool InvalidateAssembly(Assembly assembly, string fileName)
{
Expand Down

0 comments on commit 7b5d867

Please sign in to comment.