using System.Collections.Generic;
using System.ServiceModel;
namespace TGS.Interface.Components
{
///
/// For modifying the in game config
/// Most if not all of these will not apply until the next server reboot
///
[ServiceContract]
public interface ITGConfig
{
///
/// Returns the file contents of the specified server directory
/// Subdirectories will be prefixed with '/'
///
/// Subdirectory to enumerate, enumerates the root directory if null
/// null on success, error message on failure
/// This will be true if error is set to a message that indicates the current user does not have access to the specified file
/// A list of files in the enumerated static directory on success, null on failure
[OperationContract]
IList ListStaticDirectory(string subpath, out string error, out bool unauthorized);
///
/// Read from a static file
///
/// The path from the Static dir. E.g. config/config.txt
/// if true, the file will be read from the repository instead of the static dir
/// null on success, error message on failure
/// This will be true if error is set to a message that indicates the current user does not have access to the specified file
/// The full text of the file on success, null on failure
/// Along with implied disconnect exceptions, if the file exceeds transfer limits
[OperationContract]
string ReadText(string staticRelativePath, bool repo, out string error, out bool unauthorized);
///
/// Write to a static file
///
/// The path from the Static dir. E.g. config/config.txt
/// The full text of the config file
/// This will be true if error is set to a message that indicates the current user does not have access to the specified file
/// null on success, error message on failure
/// Along with implied disconnect exceptions, if the file exceeds transfer limits
[OperationContract]
string WriteText(string staticRelativePath, string data, out bool unauthorized);
///
/// Deletes the target static file
///
/// The path from the Static dir. E.g. config/config.txt
/// This will be true if error is set to a message that indicates the current user does not have access to the specified file
/// null on success, error message on failure
[OperationContract]
string DeleteFile(string staticRelativePath, out bool unauthorized);
}
}