mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-17 06:04:17 +01:00
Merge pull request #99 from ff-meli/master
This commit is contained in:
commit
299ca5daca
2 changed files with 11 additions and 4 deletions
|
|
@ -30,7 +30,10 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
||||||
public static Payload Process(BinaryReader reader)
|
public static Payload Process(BinaryReader reader)
|
||||||
{
|
{
|
||||||
Payload payload = null;
|
Payload payload = null;
|
||||||
if ((byte)reader.PeekChar() != START_BYTE)
|
|
||||||
|
var initialByte = reader.ReadByte();
|
||||||
|
reader.BaseStream.Position--;
|
||||||
|
if (initialByte != START_BYTE)
|
||||||
{
|
{
|
||||||
payload = ProcessText(reader);
|
payload = ProcessText(reader);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,11 +58,15 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
|
|
||||||
while (reader.BaseStream.Position < endOfStream)
|
while (reader.BaseStream.Position < endOfStream)
|
||||||
{
|
{
|
||||||
if ((byte)reader.PeekChar() == START_BYTE)
|
var nextByte = reader.ReadByte();
|
||||||
|
if (nextByte == START_BYTE)
|
||||||
|
{
|
||||||
|
// rewind since this byte isn't part of this payload
|
||||||
|
reader.BaseStream.Position--;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// not the most efficient, but the easiest
|
text.Add(nextByte);
|
||||||
text.Add(reader.ReadByte());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text.Count > 0)
|
if (text.Count > 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue