Show / Hide Table of Contents

Class Resource

Represents an MTA resource

Inheritance
Object
SharedResource
Resource
Inherited Members
SharedResource.MtaResource
SharedResource.Name
SharedResource.DynamicRoot
SharedResource.Root
SharedResource.State
SharedResource.ExportedFunctions
SharedResource.Config(String)
SharedResource.Invoke(String, Object[])
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Slipe.Server.Resources
Assembly: SlipeServer.dll
Syntax
public class Resource : SharedResource

Constructors

| Improve this Doc View Source

Resource(String)

Only used to extend a specific resource class

Declaration
protected Resource(string name)
Parameters
Type Name Description
String name

The name of the resource

| Improve this Doc View Source

Resource(String, String)

Create a new empty resource

Declaration
public Resource(string name, string organizationalDir = null)
Parameters
Type Name Description
String name
String organizationalDir

Properties

| Improve this Doc View Source

ACLRequests

This function retrieves the ACL request section from the meta.xml file of the given resource.

Declaration
public AclRequest[] ACLRequests { get; }
Property Value
Type Description
AclRequest[]
| Improve this Doc View Source

All

This function retrieves a table of all the resources that exist on the server.

Declaration
public static Resource[] All { get; }
Property Value
Type Description
Resource[]
| Improve this Doc View Source

IsArchived

Checks whether a resource is currently archived (running from within a ZIP file).

Declaration
public bool IsArchived { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

LastStartTime

Used to check the last starting time and date of a resource

Declaration
public DateTime LastStartTime { get; }
Property Value
Type Description
DateTime
| Improve this Doc View Source

LoadFailureReason

This function retrieves the reason why a resource failed to start.

Declaration
public string LoadFailureReason { get; }
Property Value
Type Description
String
| Improve this Doc View Source

LoadTime

Gets the date and time at which a resource was last loaded in the server.

Declaration
public DateTime LoadTime { get; }
Property Value
Type Description
DateTime
| Improve this Doc View Source

OrganizationalPath

This function returns the organizational file path of this resouce

Declaration
public string OrganizationalPath { get; }
Property Value
Type Description
String
| Improve this Doc View Source

This

Declaration
public static Resource This { get; }
Property Value
Type Description
Resource

Methods

| Improve this Doc View Source

AddConfig(String, String)

Adds a new config to this resource

Declaration
public XmlNode AddConfig(string filePath, string fileType = "server")
Parameters
Type Name Description
String filePath
String fileType
Returns
Type Description
XmlNode
| Improve this Doc View Source

AddMap(String, Int32)

This function adds a new empty mapfile to this resource

Declaration
public XmlNode AddMap(string filePath, int dimension = 0)
Parameters
Type Name Description
String filePath
Int32 dimension
Returns
Type Description
XmlNode
| Improve this Doc View Source

CopyFrom(Resource, String, String)

This function copies a specified resource with a new name

Declaration
public static Resource CopyFrom(Resource resource, string name, string organizationalDir = null)
Parameters
Type Name Description
Resource resource
String name
String organizationalDir
Returns
Type Description
Resource
| Improve this Doc View Source

Delete()

This function deletes this resource from the MTA memory and moves it to the /resources-cache/trash/ directory.

Declaration
public bool Delete()
Returns
Type Description
Boolean
| Improve this Doc View Source

Get(String)

This function is used to retrieve a resource from its name. A resource's name is the same as its folder or file archive name on the server (without the extension).

Declaration
public static Resource Get(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Resource
| Improve this Doc View Source

GetInfo(String)

This function retrieves the value of any attribute in a resource info tag.

Declaration
public string GetInfo(string attribute)
Parameters
Type Name Description
String attribute
Returns
Type Description
String
| Improve this Doc View Source

MapRoot(String)

This function retrieves the root element of a certain map in this resource

Declaration
public Element MapRoot(string mapName)
Parameters
Type Name Description
String mapName
Returns
Type Description
Element
| Improve this Doc View Source

Refresh()

Refreshes the current resource

Declaration
public bool Refresh()
Returns
Type Description
Boolean
| Improve this Doc View Source

RefreshAll()

This function finds new resources and checks for changes to the current ones.

Declaration
public static bool RefreshAll()
Returns
Type Description
Boolean
| Improve this Doc View Source

RemoveFile(String)

This function removes a file from the resource.

Declaration
public bool RemoveFile(string fileName)
Parameters
Type Name Description
String fileName
Returns
Type Description
Boolean
| Improve this Doc View Source

Rename(String, String)

This function renames a resource.

Declaration
public bool Rename(string newName, string organizationalPath)
Parameters
Type Name Description
String newName
String organizationalPath
Returns
Type Description
Boolean
| Improve this Doc View Source

Restart(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)

This function restarts a running resource. Restarting will destroy all the elements that the resource has created (as stopping the resource does).

Declaration
public bool Restart(bool persistent = true, bool configs = true, bool maps = true, bool scripts = true, bool html = true, bool clientConfigs = true, bool clientScripts = true, bool clientFiles = true)
Parameters
Type Name Description
Boolean persistent
Boolean configs
Boolean maps
Boolean scripts
Boolean html
Boolean clientConfigs
Boolean clientScripts
Boolean clientFiles
Returns
Type Description
Boolean
| Improve this Doc View Source

SetInfo(String, String)

This function sets the value of any attribute in a resource info tag.

Declaration
public bool SetInfo(string attribute, string value)
Parameters
Type Name Description
String attribute
String value
Returns
Type Description
Boolean
| Improve this Doc View Source

Start(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)

This function starts a resource either persistently or as a dependency of the current resource.

Declaration
public bool Start(bool persistent = false, bool includedResources = true, bool configs = true, bool maps = true, bool scripts = true, bool html = true, bool clientConfigs = true, bool clientScripts = true, bool clientFiles = true)
Parameters
Type Name Description
Boolean persistent
Boolean includedResources
Boolean configs
Boolean maps
Boolean scripts
Boolean html
Boolean clientConfigs
Boolean clientScripts
Boolean clientFiles
Returns
Type Description
Boolean
| Improve this Doc View Source

Stop()

This function stops a running resource.

Declaration
public bool Stop()
Returns
Type Description
Boolean
| Improve this Doc View Source

UpdateACLRequest(String, Boolean, String)

This function changes the access for one ACL request of the given resource.

Declaration
public bool UpdateACLRequest(string rightName, bool access, string byWho = "")
Parameters
Type Name Description
String rightName
Boolean access
String byWho
Returns
Type Description
Boolean

Events

| Improve this Doc View Source

OnPreStart

Declaration
public event Resource.OnPreStartHandler OnPreStart
Event Type
Type Description
Resource.OnPreStartHandler
| Improve this Doc View Source

OnStart

Declaration
public event Resource.OnStartHandler OnStart
Event Type
Type Description
Resource.OnStartHandler
| Improve this Doc View Source

OnStop

Declaration
public event Resource.OnStopHandler OnStop
Event Type
Type Description
Resource.OnStopHandler
  • Improve this Doc
  • View Source
Back to top Generated by DocFX