2011-04-07 07:03:54 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using Ionic.Zlib;
|
|
|
|
|
|
2011-06-29 02:58:34 +00:00
|
|
|
|
namespace Substrate.Core
|
2011-04-07 07:03:54 +00:00
|
|
|
|
{
|
|
|
|
|
public class PlayerFile : NBTFile
|
|
|
|
|
{
|
|
|
|
|
public PlayerFile (string path)
|
|
|
|
|
: base(path)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PlayerFile (string path, string name)
|
|
|
|
|
: base("")
|
|
|
|
|
{
|
2011-06-03 05:16:12 +00:00
|
|
|
|
if (!Directory.Exists(path)) {
|
|
|
|
|
Directory.CreateDirectory(path);
|
|
|
|
|
}
|
|
|
|
|
|
2011-04-07 07:03:54 +00:00
|
|
|
|
string file = name + ".dat";
|
2011-07-24 18:47:52 +00:00
|
|
|
|
FileName = Path.Combine(path, file);
|
2011-04-07 07:03:54 +00:00
|
|
|
|
}
|
2011-08-14 16:27:52 +00:00
|
|
|
|
|
|
|
|
|
public static string NameFromFilename (string filename)
|
|
|
|
|
{
|
|
|
|
|
if (filename.EndsWith(".dat")) {
|
|
|
|
|
return filename.Remove(filename.Length - 4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return filename;
|
|
|
|
|
}
|
2011-04-07 07:03:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|