C# Класс TShockAPI.TShock

Наследование: TerrariaPlugin
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
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

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
CrashReporter_HeapshotRequesting ( object sender, EventArgs e ) : void
Dispose ( bool disposing ) : void

Dispose - Called when disposing.

Приватные методы

Метод Описание
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.

Описание методов

CheckIgnores() публичный статический Метод

CheckIgnores - Checks a players ignores...?
public static CheckIgnores ( TShockAPI.TSPlayer player ) : bool
player TShockAPI.TSPlayer player - The TSPlayer object.
Результат bool

CheckProjectilePermission() публичный статический Метод

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.
Результат bool

CheckRangePermission() публичный статический Метод

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.
Результат bool

CheckSpawn() публичный статический Метод

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.
Результат bool

CheckTilePermission() публичный статический Метод

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.
Результат bool

CheckTilePermission() публичный статический Метод

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.
Результат bool

CrashReporter_HeapshotRequesting() защищенный Метод

protected CrashReporter_HeapshotRequesting ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void

Dispose() защищенный Метод

Dispose - Called when disposing.
protected Dispose ( bool disposing ) : void
disposing bool disposing - If set, disposes of all hooks and other systems.
Результат void

Distance() публичный статический Метод

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.
Результат float

HackedInventory() публичный статический Метод

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.
Результат bool

HandleCommandLinePostConfigLoad() публичный статический Метод

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.
Результат void

OnConfigRead() публичный Метод

OnConfigRead - Fired when the config file has been read.
public OnConfigRead ( ConfigFile file ) : void
file ConfigFile file - The config file object.
Результат void

StartInvasion() публичный статический Метод

StartInvasion - Starts an invasion on the server.
public static StartInvasion ( int type ) : void
type int type - The invasion type id.
Результат void

TShock() публичный Метод

TShock - The constructor for the TShock plugin.
public TShock ( Terraria.Main game ) : System
game Terraria.Main game - The Terraria main game.
Результат System

Описание свойств

AuthToken публичное статическое свойство

AuthToken - The auth token used by the /auth system to grant temporary superadmin access to new admins.
public static int AuthToken
Результат int

Backups публичное статическое свойство

Backups - Static reference to the backup manager for accessing the backup system.
public static BackupManager,TShockAPI Backups
Результат BackupManager

Bans публичное статическое свойство

Bans - Static reference to the ban manager for accessing bans & related functions.
public static BanManager Bans
Результат BanManager

CharacterDB публичное статическое свойство

CharacterDB - Static reference to the SSC character manager.
public static CharacterManager,TShockAPI.DB CharacterDB
Результат TShockAPI.DB.CharacterManager

DB публичное статическое свойство

DB - Static reference to the database.
public static IDbConnection DB
Результат IDbConnection

Geo публичное статическое свойство

Geo - Static reference to the GeoIP system which determines the location of an IP address.
public static GeoIPCountry,MaxMind Geo
Результат MaxMind.GeoIPCountry

Groups публичное статическое свойство

Groups - Static reference to the group manager for accessing the group system.
public static GroupManager,TShockAPI.DB Groups
Результат TShockAPI.DB.GroupManager

Itembans публичное статическое свойство

Itembans - Static reference to the item ban system.
public static ItemManager Itembans
Результат ItemManager

Log публичное статическое свойство

Log - Static reference to the log system, which outputs to either SQL or a text file, depending on user config.
public static ILog Log
Результат ILog

OverridePort публичное статическое свойство

OverridePort - Determines if TShock should override the server port.
public static bool OverridePort
Результат bool

Players публичное статическое свойство

Players - Contains all TSPlayer objects for accessing TSPlayers currently on the server
public static TSPlayer[],TShockAPI Players
Результат TShockAPI.TSPlayer[]

ProjectileBans публичное статическое свойство

ProjectileBans - Static reference to the projectile ban system.
public static ProjectileManagager ProjectileBans
Результат ProjectileManagager

RESTStartupTokens публичное статическое свойство

Used for implementing REST Tokens prior to the REST system starting up.
public static Dictionary RESTStartupTokens
Результат SecureRest.TokenData>.Dictionary

Regions публичное статическое свойство

Regions - Static reference to the region manager for accessing the region system.
public static RegionManager Regions
Результат RegionManager

RememberedPos публичное статическое свойство

RememberedPos - Static reference to the remembered position manager.
public static RememberedPosManager,TShockAPI.DB RememberedPos
Результат TShockAPI.DB.RememberedPosManager

RestApi публичное статическое свойство

RestApi - Static reference to the Rest API authentication manager.
public static SecureRest,Rests RestApi
Результат Rests.SecureRest

RestManager публичное статическое свойство

RestManager - Static reference to the Rest API manager.
public static RestManager,TShockAPI RestManager
Результат RestManager

SavePath публичное статическое свойство

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
Результат string

ServerSideCharacterConfig публичное статическое свойство

ServerSideCharacterConfig - Static reference to the server side character config, for accessing values set by users to modify SSC.
public static ServerSideConfig ServerSideCharacterConfig
Результат ServerSideConfig

ShuttingDown публичное статическое свойство

Will be set to true once Utils.StopServer() is called.
public static bool ShuttingDown
Результат bool

StatTracker публичное статическое свойство

StatTracker - Static reference to the stat tracker, which is created immediately when declared.
public static StatTracker,TShockAPI StatTracker
Результат StatTracker

TileBans публичное статическое свойство

TileBans - Static reference to the tile ban system.
public static TileManager TileBans
Результат TileManager

UpdateManager публичное статическое свойство

UpdateManager - Static reference to the update checker, which checks for updates and notifies server admins of updates.
public static UpdateManager,TShockAPI UpdateManager
Результат TShockAPI.UpdateManager

Users публичное статическое свойство

Users - Static reference to the user manager for accessing the user database system.
public static UserManager,TShockAPI.DB Users
Результат TShockAPI.DB.UserManager

Utils публичное статическое свойство

Utils - Static reference to the utilities class, which contains a variety of utility functions.
public static Utils Utils
Результат Utils

VersionCodename публичное статическое свойство

VersionCodename - The version codename is displayed when the server starts. Inspired by software codenames conventions.
public static string VersionCodename
Результат string

VersionNum публичное статическое свойство

VersionNum - The version number the TerrariaAPI will return back to the API. We just use the Assembly info.
public static Version,System VersionNum
Результат System.Version

Warps публичное статическое свойство

Warps - Static reference to the warp manager for accessing the warp system.
public static WarpManager,TShockAPI.DB Warps
Результат TShockAPI.DB.WarpManager

instance публичное статическое свойство

instance - Static reference to the TerrariaPlugin instance.
public static TerrariaPlugin instance
Результат TerrariaPlugin