Browse Source

Use new log system from Hack.Tools

master
BahaBulle 8 years ago
parent
commit
de5ac2a3bd
3 changed files with 25 additions and 17 deletions
  1. +6
    -1
      Hack.Xenosaga/Common/Variables.cs
  2. +16
    -15
      Hack.Xenosaga/Process/Unpack.cs
  3. +3
    -1
      Hack.Xenosaga/Xenosaga.cs

+ 6
- 1
Hack.Xenosaga/Common/Variables.cs View File

@ -1,4 +1,5 @@
using System.Text; using System.Text;
using Hack.Tools.TraceLog;
namespace Hack.Xenosaga.Common namespace Hack.Xenosaga.Common
{ {
@ -12,6 +13,8 @@ namespace Hack.Xenosaga.Common
public bool regroup; public bool regroup;
} }
public static TraceLog traceLog;
public const string dirUnpack = "01-UNPACK/"; public const string dirUnpack = "01-UNPACK/";
public const string dirExtract = "02-EXTRACT/"; public const string dirExtract = "02-EXTRACT/";
public const string dirInsert = "03-INSERT/"; public const string dirInsert = "03-INSERT/";
@ -19,6 +22,8 @@ namespace Hack.Xenosaga.Common
public const string dirFinal = "05-FINAL/"; public const string dirFinal = "05-FINAL/";
public const string tblCard = "TABLES/card_ANSI.tbl"; public const string tblCard = "TABLES/card_ANSI.tbl";
public const string tblEvt = "TABLES/evt_ANSI.tbl";
public const string tblEvtBox = "TABLES/evt_box_ANSI.tbl";
public const string tblEvtVideo = "TABLES/evt_video_ANSI.tbl";
public const string tblEvtItem = "TABLES/evtitem_ANSI.tbl";
} }
} }

+ 16
- 15
Hack.Xenosaga/Process/Unpack.cs View File

@ -3,6 +3,7 @@ using System.IO;
using System.Diagnostics; using System.Diagnostics;
using System.Text; using System.Text;
using Hack.Xenosaga.Common; using Hack.Xenosaga.Common;
using Hack.Tools.TraceLog;
namespace Hack.Xenosaga.Process namespace Hack.Xenosaga.Process
{ {
@ -506,28 +507,28 @@ namespace Hack.Xenosaga.Process
Directory.CreateDirectory(Variables.dirUnpack); Directory.CreateDirectory(Variables.dirUnpack);
outputName = string.Format("{0}{1}{2}", Variables.dirUnpack, indexName, _listExtension); outputName = string.Format("{0}{1}{2}", Variables.dirUnpack, indexName, _listExtension);
using (StreamWriter sw = new StreamWriter(outputName))
{
Functions.ManageListener(false, true, sw);
Variables.traceLog.Off(typeTraceListeners.CONSOLE);
Variables.traceLog.On(typeTraceListeners.FILE, outputName);
bIndexNbSector = readIndex(indexName, index);
index.SortBySector();
iIndexSize = bIndexNbSector * _sectorSize;
bIndexNbSector = readIndex(indexName, index);
index.SortBySector();
iIndexSize = bIndexNbSector * _sectorSize;
foreach (pathElement entryPath in index.getEntries())
foreach (pathElement entryPath in index.getEntries())
{
if (!entryPath.IsDirectory)
{ {
if (!entryPath.IsDirectory)
{
double d = (entryPath.Position - iIndexSize) / _maxSizeFile;
int id = (int)Math.Floor(d) + 1;
double d = (entryPath.Position - iIndexSize) / _maxSizeFile;
int id = (int)Math.Floor(d) + 1;
Trace.WriteLine(string.Format("{0,-36}Sector={1,-15}SizeIn={2,-15}SizeOut={3,-15}File=xenosaga.{4:D2}", entryPath.FullPath, entryPath.Sector, entryPath.SizeIn, entryPath.SizeOut, id + numFile));
}
Trace.WriteLine(string.Format("{0,-36}Sector={1,-15}SizeIn={2,-15}SizeOut={3,-15}File=xenosaga.{4:D2}", entryPath.FullPath, entryPath.Sector, entryPath.SizeIn, entryPath.SizeOut, id + numFile));
} }
Functions.ManageListener(true, false);
} }
Variables.traceLog.On(typeTraceListeners.CONSOLE);
Variables.traceLog.Off(typeTraceListeners.FILE, outputName);
Variables.traceLog.Close(outputName);
Trace.WriteLine("OK"); Trace.WriteLine("OK");
} }
catch (Exception ex) catch (Exception ex)


+ 3
- 1
Hack.Xenosaga/Xenosaga.cs View File

@ -1,6 +1,7 @@
using System.Diagnostics; using System.Diagnostics;
using Hack.Xenosaga.Common; using Hack.Xenosaga.Common;
using Hack.Xenosaga.Process; using Hack.Xenosaga.Process;
using Hack.Tools.TraceLog;
namespace Hack.Xenosaga namespace Hack.Xenosaga
{ {
@ -9,7 +10,8 @@ namespace Hack.Xenosaga
public static void Main(string[] args) public static void Main(string[] args)
{ {
Variables.stArgs listArgs; Variables.stArgs listArgs;
Functions.ManageListener(true);
Variables.traceLog = new TraceLog();
Variables.traceLog.On(typeTraceListeners.CONSOLE);
Trace.WriteLine("Hack.Xenosaga - (c) 2016 BahaBulle\n"); Trace.WriteLine("Hack.Xenosaga - (c) 2016 BahaBulle\n");


Loading…
Cancel
Save