C# Class TShockAPI.TShock

Inheritance: TerrariaPlugin
Afficher le fichier Open project: NyxStudios/TShock Class Usage Examples

Méthodes publiques

Свойство Type Description
AuthToken int
Backups BackupManager
Bans BanManager
CharacterDB TShockAPI.DB.CharacterManager
DB IDbConnection
Geo MaxMind.GeoIPCountry
Groups TShockAPI.DB.GroupManager
Itembans ItemManager
Log ILog
OverridePort bool
Players TShockAPI.TSPlayer[]
ProjectileBans ProjectileManagager
RESTStartupTokens SecureRest.TokenData>.Dictionary
Regions RegionManager
RememberedPos TShockAPI.DB.RememberedPosManager
RestApi Rests.SecureRest
RestManager RestManager
SavePath string
ServerSideCharacterConfig ServerSideConfig
ShuttingDown bool
StatTracker StatTracker
TileBans TileManager
UpdateManager TShockAPI.UpdateManager
Users TShockAPI.DB.UserManager
Utils Utils
VersionCodename string
VersionNum System.Version
Warps TShockAPI.DB.WarpManager
instance TerrariaPlugin

Méthodes publiques

Méthode Description
CheckIgnores ( TShockAPI.TSPlayer player ) : bool

CheckIgnores - Checks a players ignores...?

CheckProjectilePermission ( TShockAPI.TSPlayer player, int index, int type ) : bool

CheckProjectilePermission - Checks if a projectile is banned.

CheckRangePermission ( TShockAPI.TSPlayer player, int x, int y, int range = 32 ) : bool

CheckRangePermission - Checks if a player has permission to modify a tile dependent on range checks.

CheckSpawn ( int x, int y ) : bool

CheckSpawn - Checks to see if a location is inside the spawn protection zone.

CheckTilePermission ( TShockAPI.TSPlayer player, int tileX, int tileY, bool paint = false ) : bool

CheckTilePermission - Checks to see if a player has the ability to modify a tile at a given position.

CheckTilePermission ( TShockAPI.TSPlayer player, int tileX, int tileY, short tileType, GetDataHandlers actionType ) : bool

CheckTilePermission - Checks to see if a player has permission to modify a tile in general.

Distance ( Vector2 value1, Vector2 value2 ) : float

Distance - Determines the distance between two vectors.

HackedInventory ( TShockAPI.TSPlayer player ) : bool

HackedInventory - Checks to see if a user has a hacked inventory. In addition, messages players the result.

HandleCommandLinePostConfigLoad ( string parms ) : void

HandleCommandLinePostConfigLoad - Handles additional command line options after the config file is read.

OnConfigRead ( ConfigFile file ) : void

OnConfigRead - Fired when the config file has been read.

StartInvasion ( int type ) : void

StartInvasion - Starts an invasion on the server.

TShock ( Terraria.Main game ) : System

TShock - The constructor for the TShock plugin.

Méthodes protégées

Méthode Description
CrashReporter_HeapshotRequesting ( object sender, EventArgs e ) : void
Dispose ( bool disposing ) : void

Dispose - Called when disposing.

Private Methods

Méthode Description
ComputeMaxStyles ( ) : void

ComputeMaxStyles - Computes the max styles...

CurrentDomain_UnhandledException ( object sender, UnhandledExceptionEventArgs e ) : void

Handles exceptions that we didn't catch earlier in the code, or in Terraria.

FixChestStacks ( ) : void

FixChestStacks - Verifies that each stack in each chest is valid and not over the max stack count.

HandleCommandLine ( string parms ) : void

HandleCommandLine - Handles the command line parameters passed to the server.

Initialize ( ) : void
NetHooks_NameCollision ( NameCollisionEventArgs args ) : void

NetHooks_NameCollision - Internal hook fired when a name collision happens.

NetHooks_SendData ( Hooks.SendDataEventArgs e ) : void

NetHooks_SendData - Fired when the server sends data.

NpcHooks_OnStrikeNpc ( Hooks.NpcStrikeEventArgs e ) : void

NpcHooks_OnStrikeNpc - Fired when an NPC strike packet happens.

OnAccountCreate ( Hooks args ) : void

OnAccountCreate - Internal hook fired on account creation.

OnAccountDelete ( Hooks args ) : void

OnAccountDelete - Internal hook fired on account delete.

OnChat ( ServerChatEventArgs args ) : void

OnChat - Fired when a player chats. Used for handling chat and commands.

OnConnect ( ConnectEventArgs args ) : void

OnConnect - Fired when a player connects to the server.

OnGetData ( Hooks.GetDataEventArgs e ) : void

OnGetData - Called when the server gets raw data packets.

OnGreetPlayer ( GreetPlayerEventArgs args ) : void

OnGreetPlayer - Fired when a player is greeted by the server. Handles things like the MOTD, join messages, etc.

OnHalloweenCheck ( HalloweenCheckEventArgs args ) : void

OnHalloweenCheck - Internal hook fired when the HalloweenCheck happens.

OnHardUpdate ( HardmodeTileUpdateEventArgs args ) : void

OnHardUpdate - Fired when a hardmode tile update event happens.

OnItemForceIntoChest ( ForceItemIntoChestEventArgs args ) : void

OnItemForceIntoChest - Internal hook fired when a player quick stacks items into a chest.

OnJoin ( JoinEventArgs args ) : void

OnJoin - Internal hook called when a player joins. This is called after OnConnect.

OnLeave ( LeaveEventArgs args ) : void

OnLeave - Called when a player leaves the server.

OnPlayerLogin ( PlayerPostLoginEventArgs args ) : void

OnPlayerLogin - Fires the PlayerLogin hook to listening plugins.

OnPlayerPreLogin ( Hooks args ) : void

OnPlayerPreLogin - Internal hook fired when on player pre login.

OnPostInit ( EventArgs args ) : void

OnPostInit - Fired when the server loads a map, to perform world specific operations.

OnProjectileSetDefaults ( int>.SetDefaultsEventArgs e ) : void

OnProjectileSetDefaults - Called when a projectile sets the default attributes for itself.

OnSecondUpdate ( ) : void

OnSecondUpdate - Called effectively every second for all time based checks.

OnStartHardMode ( HandledEventArgs e ) : void

OnStartHardMode - Fired when hard mode is started.

OnStatueSpawn ( Hooks.StatueSpawnEventArgs args ) : void

OnStatueSpawn - Fired when a statue spawns.

OnUpdate ( EventArgs args ) : void

OnUpdate - Called when ever the server ticks.

OnXmasCheck ( Hooks.ChristmasCheckEventArgs args ) : void

OnXmasCheck - Internal hook fired when the XMasCheck happens.

ServerHooks_OnCommand ( CommandEventArgs args ) : void

Called when a command is issued from the server console.

SetConsoleTitle ( bool empty ) : void

SetConsoleTitle - Updates the console title with some pertinent information.

Method Details

CheckIgnores() public static méthode

CheckIgnores - Checks a players ignores...?
public static CheckIgnores ( TShockAPI.TSPlayer player ) : bool
player TShockAPI.TSPlayer player - The TSPlayer object.
Résultat bool

CheckProjectilePermission() public static méthode

CheckProjectilePermission - Checks if a projectile is banned.
public static CheckProjectilePermission ( TShockAPI.TSPlayer player, int index, int type ) : bool
player TShockAPI.TSPlayer player - The TSPlayer object that created the projectile.
index int index - The projectile index.
type int type - The projectile type.
Résultat bool

CheckRangePermission() public static méthode

CheckRangePermission - Checks if a player has permission to modify a tile dependent on range checks.
public static CheckRangePermission ( TShockAPI.TSPlayer player, int x, int y, int range = 32 ) : bool
player TShockAPI.TSPlayer player - The TSPlayer object.
x int x - The x coordinate of the tile.
y int y - The y coordinate of the tile.
range int range - The range to check for.
Résultat bool

CheckSpawn() public static méthode

CheckSpawn - Checks to see if a location is inside the spawn protection zone.
public static CheckSpawn ( int x, int y ) : bool
x int x - The x coordinate to check.
y int y - The y coordinate to check.
Résultat bool

CheckTilePermission() public static méthode

CheckTilePermission - Checks to see if a player has the ability to modify a tile at a given position.
public static CheckTilePermission ( TShockAPI.TSPlayer player, int tileX, int tileY, bool paint = false ) : bool
player TShockAPI.TSPlayer player - The TSPlayer object.
tileX int tileX - The x coordinate of the tile.
tileY int tileY - The y coordinate of the tile.
paint bool paint - Whether or not the tile is paint.
Résultat bool

CheckTilePermission() public static méthode

CheckTilePermission - Checks to see if a player has permission to modify a tile in general.
public static CheckTilePermission ( TShockAPI.TSPlayer player, int tileX, int tileY, short tileType, GetDataHandlers actionType ) : bool
player TShockAPI.TSPlayer player - The TSPlayer object.
tileX int tileX - The x coordinate of the tile.
tileY int tileY - The y coordinate of the tile.
tileType short tileType - The tile type.
actionType GetDataHandlers actionType - The type of edit that took place.
Résultat bool

CrashReporter_HeapshotRequesting() protected méthode

protected CrashReporter_HeapshotRequesting ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Résultat void

Dispose() protected méthode

Dispose - Called when disposing.
protected Dispose ( bool disposing ) : void
disposing bool disposing - If set, disposes of all hooks and other systems.
Résultat void

Distance() public static méthode

Distance - Determines the distance between two vectors.
public static Distance ( Vector2 value1, Vector2 value2 ) : float
value1 Vector2 value1 - The first vector location.
value2 Vector2 value2 - The second vector location.
Résultat float

HackedInventory() public static méthode

HackedInventory - Checks to see if a user has a hacked inventory. In addition, messages players the result.
public static HackedInventory ( TShockAPI.TSPlayer player ) : bool
player TShockAPI.TSPlayer player - The TSPlayer object.
Résultat bool

HandleCommandLinePostConfigLoad() public static méthode

HandleCommandLinePostConfigLoad - Handles additional command line options after the config file is read.
public static HandleCommandLinePostConfigLoad ( string parms ) : void
parms string parms - The array of arguments passed in through the command line.
Résultat void

OnConfigRead() public méthode

OnConfigRead - Fired when the config file has been read.
public OnConfigRead ( ConfigFile file ) : void
file ConfigFile file - The config file object.
Résultat void

StartInvasion() public static méthode

StartInvasion - Starts an invasion on the server.
public static StartInvasion ( int type ) : void
type int type - The invasion type id.
Résultat void

TShock() public méthode

TShock - The constructor for the TShock plugin.
public TShock ( Terraria.Main game ) : System
game Terraria.Main game - The Terraria main game.
Résultat System

Property Details

AuthToken public_oe static_oe property

AuthToken - The auth token used by the /auth system to grant temporary superadmin access to new admins.
public static int AuthToken
Résultat int

Backups public_oe static_oe property

Backups - Static reference to the backup manager for accessing the backup system.
public static BackupManager,TShockAPI Backups
Résultat BackupManager

Bans public_oe static_oe property

Bans - Static reference to the ban manager for accessing bans & related functions.
public static BanManager Bans
Résultat BanManager

CharacterDB public_oe static_oe property

CharacterDB - Static reference to the SSC character manager.
public static CharacterManager,TShockAPI.DB CharacterDB
Résultat TShockAPI.DB.CharacterManager

DB public_oe static_oe property

DB - Static reference to the database.
public static IDbConnection DB
Résultat IDbConnection

Geo public_oe static_oe property

Geo - Static reference to the GeoIP system which determines the location of an IP address.
public static GeoIPCountry,MaxMind Geo
Résultat MaxMind.GeoIPCountry

Groups public_oe static_oe property

Groups - Static reference to the group manager for accessing the group system.
public static GroupManager,TShockAPI.DB Groups
Résultat TShockAPI.DB.GroupManager

Itembans public_oe static_oe property

Itembans - Static reference to the item ban system.
public static ItemManager Itembans
Résultat ItemManager

Log public_oe static_oe property

Log - Static reference to the log system, which outputs to either SQL or a text file, depending on user config.
public static ILog Log
Résultat ILog

OverridePort public_oe static_oe property

OverridePort - Determines if TShock should override the server port.
public static bool OverridePort
Résultat bool

Players public_oe static_oe property

Players - Contains all TSPlayer objects for accessing TSPlayers currently on the server
public static TSPlayer[],TShockAPI Players
Résultat TShockAPI.TSPlayer[]

ProjectileBans public_oe static_oe property

ProjectileBans - Static reference to the projectile ban system.
public static ProjectileManagager ProjectileBans
Résultat ProjectileManagager

RESTStartupTokens public_oe static_oe property

Used for implementing REST Tokens prior to the REST system starting up.
public static Dictionary RESTStartupTokens
Résultat SecureRest.TokenData>.Dictionary

Regions public_oe static_oe property

Regions - Static reference to the region manager for accessing the region system.
public static RegionManager Regions
Résultat RegionManager

RememberedPos public_oe static_oe property

RememberedPos - Static reference to the remembered position manager.
public static RememberedPosManager,TShockAPI.DB RememberedPos
Résultat TShockAPI.DB.RememberedPosManager

RestApi public_oe static_oe property

RestApi - Static reference to the Rest API authentication manager.
public static SecureRest,Rests RestApi
Résultat Rests.SecureRest

RestManager public_oe static_oe property

RestManager - Static reference to the Rest API manager.
public static RestManager,TShockAPI RestManager
Résultat RestManager

SavePath public_oe static_oe property

SavePath - This is the path TShock saves its data in. This path is relative to the TerrariaServer.exe (not in ServerPlugins).
public static string SavePath
Résultat string

ServerSideCharacterConfig public_oe static_oe property

ServerSideCharacterConfig - Static reference to the server side character config, for accessing values set by users to modify SSC.
public static ServerSideConfig ServerSideCharacterConfig
Résultat ServerSideConfig

ShuttingDown public_oe static_oe property

Will be set to true once Utils.StopServer() is called.
public static bool ShuttingDown
Résultat bool

StatTracker public_oe static_oe property

StatTracker - Static reference to the stat tracker, which is created immediately when declared.
public static StatTracker,TShockAPI StatTracker
Résultat StatTracker

TileBans public_oe static_oe property

TileBans - Static reference to the tile ban system.
public static TileManager TileBans
Résultat TileManager

UpdateManager public_oe static_oe property

UpdateManager - Static reference to the update checker, which checks for updates and notifies server admins of updates.
public static UpdateManager,TShockAPI UpdateManager
Résultat TShockAPI.UpdateManager

Users public_oe static_oe property

Users - Static reference to the user manager for accessing the user database system.
public static UserManager,TShockAPI.DB Users
Résultat TShockAPI.DB.UserManager

Utils public_oe static_oe property

Utils - Static reference to the utilities class, which contains a variety of utility functions.
public static Utils Utils
Résultat Utils

VersionCodename public_oe static_oe property

VersionCodename - The version codename is displayed when the server starts. Inspired by software codenames conventions.
public static string VersionCodename
Résultat string

VersionNum public_oe static_oe property

VersionNum - The version number the TerrariaAPI will return back to the API. We just use the Assembly info.
public static Version,System VersionNum
Résultat System.Version

Warps public_oe static_oe property

Warps - Static reference to the warp manager for accessing the warp system.
public static WarpManager,TShockAPI.DB Warps
Résultat TShockAPI.DB.WarpManager

instance public_oe static_oe property

instance - Static reference to the TerrariaPlugin instance.
public static TerrariaPlugin instance
Résultat TerrariaPlugin