Skip to content

Commit

Permalink
Merge pull request #4 from karaeren/http-bridge
Browse files Browse the repository at this point in the history
Http bridge
  • Loading branch information
karaeren authored May 23, 2022
2 parents a596231 + 56cab25 commit 45c4db7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions LostArkLogger/HttpBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public void Start()
{
EnqueueMessage("message", "Failed to initialize Npcap, using raw sockets instead. You can try to restart the app.");
}
else
{
EnqueueMessage("message", "Using Npcap!");
}

}

Expand Down
6 changes: 2 additions & 4 deletions LostArkLogger/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,13 +432,12 @@ void Device_OnPacketArrival_machina(Machina.Infrastructure.TCPConnection connect
var srcAddr = connection.RemoteIP;
if (srcAddr != currentIpAddr)
{
//onDebug?.Invoke((bytes.Length > 4).ToString() + ", " + BitConverter.ToUInt16(bytes, 2).ToString() + ", " + OpCodes.PKTAuthTokenResult + ", " + (bytes[0] == 0x1e).ToString());
//Console.WriteLine((OpCodes)BitConverter.ToUInt16(bytes, 2));
//Console.WriteLine(BitConverter.ToString(bytes));
if (currentIpAddr == 0xdeadbeef || (bytes.Length > 4 && GetOpCode(bytes) == OpCodes.PKTAuthTokenResult && bytes[0] == 0x1e))
{
onNewZone?.Invoke();
currentIpAddr = srcAddr;
fileName = logsPath + "\\LostArk_" + DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss") + ".log";
loggedPacketCount = 0;
}
else return;
}
Expand All @@ -465,7 +464,6 @@ void Device_OnPacketArrival_pcap(object sender, PacketCapture evt)
#pragma warning restore CS0618 // Type or member is obsolete
if (srcAddr != currentIpAddr)
{
var opcode = GetOpCode(bytes);
if (currentIpAddr == 0xdeadbeef || (bytes.Length > 4 && GetOpCode(bytes) == OpCodes.PKTAuthTokenResult && bytes[0] == 0x1e))
{
onNewZone?.Invoke();
Expand Down

0 comments on commit 45c4db7

Please sign in to comment.