mta-mono/MultiTheftAuto/Resource.cs

122 lines
3.5 KiB
C#
Raw Normal View History

2015-12-12 10:10:23 +00:00
using System;
using System.Runtime.CompilerServices;
2015-12-12 10:10:23 +00:00
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MultiTheftAuto
{
public class Resource
2015-12-12 10:10:23 +00:00
{
#region Static properties
public static Element Root
{
get
{
return Resource.GetCurrent().GetRoot();
2015-12-12 10:10:23 +00:00
}
}
#endregion
#region Constuctors
[MethodImpl( MethodImplOptions.InternalCall )]
public extern Resource( string resourceName, string organizationalDir );
2015-12-12 10:10:23 +00:00
private Resource()
2015-12-12 10:10:23 +00:00
{
}
#endregion
#region Methods
[MethodImpl( MethodImplOptions.InternalCall )]
public extern Resource Copy( string newResourceName, string organizationalDir );
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern Element GetRoot();
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern Element GetMapRootElement( UInt32 resource, string map );
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern Element GetDynamicElementRoot();
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern bool RemoveFile( string filename );
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern string GetInfo( string attribute );
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern uint GetLastStartTime();
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern string GetLoadFailureReason();
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern uint GetLoadTime();
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern string GetName();
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern string GetState();
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern bool SetDefaultSetting( string settingName, string settingValue );
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern bool RemoveDefaultSetting( string settingName );
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern bool Start( bool persistent = false, bool startIncludedResources = true, bool loadServerConfigs = true, bool loadMaps = true, bool loadServerScripts = true, bool loadHTML = true, bool loadClientConfigs = true, bool loadClientScripts = true, bool loadFiles = true );
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern bool Restart();
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern bool Stop();
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern bool SetInfo( string attribute, string value );
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern bool Rename( string newResourceName, string organizationalPath );
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern bool Delete();
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern bool UpdateACLRequest( string rightName, bool bAccess, string byWho );
2015-12-12 10:10:23 +00:00
#endregion
#region Static methods
[MethodImpl( MethodImplOptions.InternalCall )]
public extern static bool Rename( string resourceName, string newResourceName, string organizationalPath );
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern static bool Delete( string resourceName );
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern static bool Refresh( bool refreshAll = false );
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern static Resource GetCurrent();
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern static Resource[] GetAll();
2015-12-12 10:10:23 +00:00
[MethodImpl( MethodImplOptions.InternalCall )]
public extern static Resource GetFromName( string resourceName );
2015-12-12 10:10:23 +00:00
#endregion
}
}