diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs
index 2f9d00de..819be966 100755
--- a/TShockAPI/TShock.cs
+++ b/TShockAPI/TShock.cs
@@ -127,26 +127,36 @@ namespace TShockAPI
///
public static event Action Initialized;
+ /// Version - The version required by the TerrariaAPI to be passed back for checking & loading the plugin.
+ /// value - The version number specified in the Assembly, based on the VersionNum variable set in this class.
public override Version Version
{
get { return VersionNum; }
}
+ /// Name - The plugin name.
+ /// value - "TShock"
public override string Name
{
get { return "TShock"; }
}
+ /// Author - The author of the plugin.
+ /// value - "The TShock Team"
public override string Author
{
- get { return "The Nyx Team"; }
+ get { return "The TShock Team"; }
}
+ /// Description - The plugin description.
+ /// value - "The administration modification of the future."
public override string Description
{
get { return "The administration modification of the future."; }
}
+ /// TShock - The constructor for the TShock plugin.
+ /// game - The Terraria main game.
public TShock(Main game)
: base(game)
{
@@ -159,7 +169,7 @@ namespace TShockAPI
instance = this;
}
-
+ /// Initialize - Called by the TerrariaServerAPI during initialization.
[SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]
public override void Initialize()
{
@@ -332,6 +342,8 @@ namespace TShockAPI
}
}
+ /// Dispose - Called when disposing.
+ /// disposing - If set, disposes of all hooks and other systems.
protected override void Dispose(bool disposing)
{
if (disposing)
@@ -343,7 +355,6 @@ namespace TShockAPI
}
SaveManager.Instance.Dispose();
-
ServerApi.Hooks.GamePostInitialize.Deregister(this, OnPostInit);
ServerApi.Hooks.GameUpdate.Deregister(this, OnUpdate);
ServerApi.Hooks.GameHardmodeTileUpdate.Deregister(this, OnHardUpdate);
@@ -376,6 +387,8 @@ namespace TShockAPI
base.Dispose(disposing);
}
+ /// OnPlayerLogin - Fires the PlayerLogin hook to listening plugins.
+ /// args - The PlayerPostLoginEventArgs object.
private void OnPlayerLogin(Hooks.PlayerPostLoginEventArgs args)
{
User u = Users.GetUserByName(args.Player.UserAccountName);
@@ -400,16 +413,22 @@ namespace TShockAPI
Users.UpdateLogin(u);
}
+ /// OnAccountDelete - Internal hook fired on account delete.
+ /// args - The AccountDeleteEventArgs object.
private void OnAccountDelete(Hooks.AccountDeleteEventArgs args)
{
CharacterDB.RemovePlayer(args.User.ID);
}
+ /// OnAccountCreate - Internal hook fired on account creation.
+ /// args - The AccountCreateEventArgs object.
private void OnAccountCreate(Hooks.AccountCreateEventArgs args)
{
CharacterDB.SeedInitialData(Users.GetUser(args.User));
}
+ /// OnPlayerPreLogin - Internal hook fired when on player pre login.
+ /// args - The PlayerPreLoginEventArgs object.
private void OnPlayerPreLogin(Hooks.PlayerPreLoginEventArgs args)
{
if (args.Player.IsLoggedIn)
@@ -422,6 +441,8 @@ namespace TShockAPI
}
}
+ /// NetHooks_NameCollision - Internal hook fired when a name collision happens.
+ /// args - The NameCollisionEventArgs object.
private void NetHooks_NameCollision(NameCollisionEventArgs args)
{
string ip = TShock.Utils.GetRealIP(Netplay.serverSock[args.Who].tcpClient.Client.RemoteEndPoint.ToString());
@@ -449,6 +470,8 @@ namespace TShockAPI
}
}
+ /// OnXmasCheck - Internal hook fired when the XMasCheck happens.
+ /// args - The ChristmasCheckEventArgs object.
private void OnXmasCheck(ChristmasCheckEventArgs args)
{
if (args.Handled)
@@ -461,6 +484,8 @@ namespace TShockAPI
}
}
+ /// OnHalloweenCheck - Internal hook fired when the HalloweenCheck happens.
+ /// args - The HalloweenCheckEventArgs object.
private void OnHalloweenCheck(HalloweenCheckEventArgs args)
{
if (args.Handled)
@@ -473,10 +498,10 @@ namespace TShockAPI
}
}
///
- /// Handles exceptions that we didn't catch or that Red fucked up
+ /// Handles exceptions that we didn't catch earlier in the code, or in Terraria.
///
- ///
- ///
+ /// sender - The object that sent the exception.
+ /// e - The UnhandledExceptionEventArgs object.
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Log.Error(e.ExceptionObject.ToString());
@@ -509,6 +534,8 @@ namespace TShockAPI
}
}
+ /// HandleCommandLine - Handles the command line parameters passed to the server.
+ /// parms - The array of arguments passed in through the command line.
private void HandleCommandLine(string[] parms)
{
string path;
@@ -562,6 +589,8 @@ namespace TShockAPI
}
}
+ /// HandleCommandLinePostConfigLoad - Handles additional command line options after the config file is read.
+ /// parms - The array of arguments passed in through the command line.
public static void HandleCommandLinePostConfigLoad(string[] parms)
{
for (int i = 0; i < parms.Length; i++)
@@ -597,13 +626,11 @@ namespace TShockAPI
}
}
- /*
- * Hooks:
- *
- */
-
+ /// AuthToken - The auth token used by the /auth system to grant temporary superadmin access to new admins.
public static int AuthToken = -1;
+ /// OnPostInit - Fired when the server loads a map, to perform world specific operations.
+ /// args - The EventArgs object.
private void OnPostInit(EventArgs args)
{
SetConsoleTitle(false);