Initial work to move all Server Side Character code to its own module.
This commit is contained in:
parent
afffa46ef2
commit
915e791406
11 changed files with 137 additions and 43 deletions
|
|
@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
using System;
|
||||
using System.IO;
|
||||
using TShockAPI.ServerSideCharacters;
|
||||
|
||||
namespace TShockAPI
|
||||
{
|
||||
|
|
@ -55,6 +56,14 @@ namespace TShockAPI
|
|||
get { return Path.Combine(TShock.SavePath, "config.json"); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Path to the file containing the config.
|
||||
/// </summary>
|
||||
internal static string ServerSideCharacterConfigPath
|
||||
{
|
||||
get { return Path.Combine(TShock.SavePath, "sscconfig.json"); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an empty file at the given path.
|
||||
/// </summary>
|
||||
|
|
@ -98,6 +107,12 @@ namespace TShockAPI
|
|||
}
|
||||
TShock.Config.Write(ConfigPath);
|
||||
|
||||
if (File.Exists(ServerSideCharacterConfigPath))
|
||||
{
|
||||
TShock.ServerSideCharacterConfig = ServerSideConfig.Read(ServerSideCharacterConfigPath);
|
||||
// Add all the missing config properties in the json file
|
||||
}
|
||||
TShock.ServerSideCharacterConfig.Write(ServerSideCharacterConfigPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue