Skip to content

Commit

Permalink
3.0.5515.15265
Browse files Browse the repository at this point in the history
code cleanup and fix item parsing in chatcleaner
  • Loading branch information
Icehunter committed Feb 6, 2015
1 parent ba657fd commit a8d7cd1
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 14 deletions.
3 changes: 1 addition & 2 deletions FFXIVAPP.Client/Delegates/PCWorkerDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ public static IList<ActorEntity> GetUniqueNPCEntities()

#region Declarations

public static ActorEntity CurrentUser { get; set; }

private static IList<ActorEntity> _npcEntities = new List<ActorEntity>();

private static IList<ActorEntity> _uniqueNPCEntities = new List<ActorEntity>();
public static ActorEntity CurrentUser { get; set; }

#endregion
}
Expand Down
2 changes: 1 addition & 1 deletion FFXIVAPP.Client/Helpers/ActorEntityHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@

using System;
using System.Collections.Generic;
using FFXIVAPP.Client.Delegates;
using FFXIVAPP.Client.Memory;
using FFXIVAPP.Client.Properties;
using FFXIVAPP.Common.Core.Memory;
using FFXIVAPP.Common.Core.Memory.Enums;
using FFXIVAPP.Common.Helpers;
using FFXIVAPP.Client.Delegates;

namespace FFXIVAPP.Client.Helpers
{
Expand Down
25 changes: 18 additions & 7 deletions FFXIVAPP.Client/Memory/ChatCleaner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ private string ProcessFullLine(byte[] bytes)
{
var autoTranslateList = new List<byte>();
var newList = new List<byte>();
//var check = Encoding.UTF8.GetString(bytes.Take(4)
// .ToArray());
for (var x = 0; x < bytes.Count(); x++)
{
if (bytes[x] == 2)
Expand All @@ -133,14 +131,16 @@ private string ProcessFullLine(byte[] bytes)
//2 46 5 7 242 2 210 3
//2 29 1 3
var length = bytes[x + 2];
var limit = length - 1;
if (length > 1)
{
x = x + 3;
autoTranslateList.Add(Convert.ToByte('['));
while (bytes[x] != 3)
var translated = new byte[limit];
Buffer.BlockCopy(bytes, x, translated, 0, limit);
foreach (var b in translated)
{
autoTranslateList.AddRange(Encoding.UTF8.GetBytes(bytes[x].ToString("X2")));
x++;
autoTranslateList.AddRange(Encoding.UTF8.GetBytes(b.ToString("X2")));
}
autoTranslateList.Add(Convert.ToByte(']'));
string aCheckStr;
Expand All @@ -150,9 +150,16 @@ private string ProcessFullLine(byte[] bytes)
{
aCheckStr = "";
}
var atbyte = (!String.IsNullOrWhiteSpace(aCheckStr)) ? Encoding.UTF8.GetBytes(aCheckStr) : autoTranslateList.ToArray();
newList.AddRange(atbyte);
if (String.IsNullOrWhiteSpace(aCheckStr))
{
// TODO: implement showing or using in the chatlog
}
else
{
newList.AddRange(Encoding.UTF8.GetBytes(aCheckStr));
}
autoTranslateList.Clear();
x += limit;
}
else
{
Expand All @@ -166,15 +173,19 @@ private string ProcessFullLine(byte[] bytes)
break;
}
}
//var cleanedList = newList.Where(v => (v >= 0x0020 && v <= 0xD7FF) || (v >= 0xE000 && v <= 0xFFFD) || v == 0x0009 || v == 0x000A || v == 0x000D);
var cleaned = HttpUtility.HtmlDecode(Encoding.UTF8.GetString(newList.ToArray()))
.Replace(" ", " ");
autoTranslateList.Clear();
newList.Clear();
cleaned = Regex.Replace(cleaned, @"", "");
cleaned = Regex.Replace(cleaned, @"", "[HQ]");
cleaned = Regex.Replace(cleaned, @"", "");
cleaned = Regex.Replace(cleaned, @"�", "");
cleaned = Regex.Replace(cleaned, @"\[+0([12])010101([\w]+)?\]+", "");
cleaned = Regex.Replace(cleaned, @"\[+CF010101([\w]+)?\]+", "");
cleaned = Regex.Replace(cleaned, @"\[+..FF\w{6}\]+|\[+EC\]+", "");
cleaned = Regex.Replace(cleaned, @"\[\]+", "");
line = cleaned;
}
catch (Exception ex)
Expand Down
3 changes: 1 addition & 2 deletions FFXIVAPP.Client/Memory/MonsterWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
using FFXIVAPP.Common.Core.Memory;
using FFXIVAPP.Common.Core.Memory.Enums;
using NLog;
using FFXIVAPP.Client.Delegates;

namespace FFXIVAPP.Client.Memory
{
Expand Down Expand Up @@ -156,7 +155,7 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)

#region ActorEntity Handlers

bool firstTime = true;
var firstTime = true;

var monsterEntries = new List<ActorEntity>();
var pcEntries = new List<ActorEntity>();
Expand Down
2 changes: 1 addition & 1 deletion FFXIVAPP.Client/Memory/PlayerInfoWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
{
ID = (uint) MemoryHandler.Instance.GetInt32(address),
Name = MemoryHandler.Instance.GetString(address + 4),
Enmity = (uint)MemoryHandler.Instance.GetInt16(address + 72)
Enmity = (uint) MemoryHandler.Instance.GetInt16(address + 72)
};
if (enmityEntry.ID > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion FFXIVAPP.Client/Memory/TargetWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
{
try
{
var targetHateStructure = MemoryHandler.Instance.SigScanner.Locations["CHARMAP"] - 120584;// + 1136;
var targetHateStructure = MemoryHandler.Instance.SigScanner.Locations["CHARMAP"] - 120584; // + 1136;
var enmityEntries = new List<EnmityEntry>();
var targetEntity = new TargetEntity();
if (MemoryHandler.Instance.SigScanner.Locations.ContainsKey("TARGET"))
Expand Down
Binary file modified distribution/FFXIVAPP.Client.exe
Binary file not shown.
Binary file modified distribution/FFXIVAPP.Updater.exe
Binary file not shown.

0 comments on commit a8d7cd1

Please sign in to comment.