26 |
using RomCheater.Core; |
using RomCheater.Core; |
27 |
using System.Diagnostics; |
using System.Diagnostics; |
28 |
using System.Collections; |
using System.Collections; |
29 |
|
using Enterprise.Logging; |
30 |
|
|
31 |
namespace RomCheater.Serialization |
namespace RomCheater.Serialization |
32 |
{ |
{ |
322 |
{ |
{ |
323 |
if (this.cancel_method.Invoke()) |
if (this.cancel_method.Invoke()) |
324 |
{ |
{ |
325 |
logger.Warn.WriteLine("UpdateResultValuesFromMemory - operation cancelled at [ResultIndex=0x{0} ChunkCount=0x{1}]", i.ToString("X"), results.Length.ToString("X")); |
gLog.Warn.WriteLine("UpdateResultValuesFromMemory - operation cancelled at [ResultIndex=0x{0} ChunkCount=0x{1}]", i.ToString("X"), results.Length.ToString("X")); |
326 |
break; |
break; |
327 |
} |
} |
328 |
ulong value = 0; |
ulong value = 0; |
335 |
case SearchDataTypes._64bits: value = BitConverter.ToUInt64(data, 0); break; |
case SearchDataTypes._64bits: value = BitConverter.ToUInt64(data, 0); break; |
336 |
} |
} |
337 |
results[i].Value = value; |
results[i].Value = value; |
338 |
logger.Profiler.WriteLine("UpdateResultValuesFromMemory [ResultIndex=0x{0} ChunkCount=0x{1}] has taken a total of {2} seconds to complete", i.ToString("X"), results.Length.ToString("X"), st.Elapsed.TotalSeconds.ToString()); |
gLog.Profiler.WriteLine("UpdateResultValuesFromMemory [ResultIndex=0x{0} ChunkCount=0x{1}] has taken a total of {2} seconds to complete", i.ToString("X"), results.Length.ToString("X"), st.Elapsed.TotalSeconds.ToString()); |
339 |
|
|
340 |
|
|
341 |
string message = string.Format(" -> Updateing values [ResultIndex=0x{0} of ChunkCount=0x{1}]", i.ToString("X"), results.Length.ToString("X")); |
string message = string.Format(" -> Updateing values [ResultIndex=0x{0} of ChunkCount=0x{1}]", i.ToString("X"), results.Length.ToString("X")); |
346 |
} |
} |
347 |
} |
} |
348 |
st.Stop(); |
st.Stop(); |
349 |
logger.Profiler.WriteLine("UpdateResultValuesFromMemory [ChunkCount=0x{0}] took a total of {1} seconds to complete", results.Length.ToString("X"), st.Elapsed.TotalSeconds.ToString()); |
gLog.Profiler.WriteLine("UpdateResultValuesFromMemory [ChunkCount=0x{0}] took a total of {1} seconds to complete", results.Length.ToString("X"), st.Elapsed.TotalSeconds.ToString()); |
350 |
} |
} |
351 |
} |
} |
352 |
|
|
493 |
} |
} |
494 |
catch (Exception ex) |
catch (Exception ex) |
495 |
{ |
{ |
496 |
logger.Error.WriteLine("Failed to reader results..."); |
gLog.Error.WriteLine("Failed to reader results..."); |
497 |
logger.VerboseError.WriteLine(ex.ToString()); |
gLog.Verbose.Error.WriteLine(ex.ToString()); |
498 |
results =new StructResultType<ulong>[0]; |
results =new StructResultType<ulong>[0]; |
499 |
//results.TrimExcess(); |
//results.TrimExcess(); |
500 |
throw ex; |
throw ex; |