mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-06 22:50:30 -04:00
Removed NioTSO client and server
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
This commit is contained in:
parent
f12ba1502b
commit
22191ce648
591 changed files with 53264 additions and 3362 deletions
41
server/FSO.Server.Debug/PacketAnalyzer/ByteCountPacketAnalyzer.cs
Executable file
41
server/FSO.Server.Debug/PacketAnalyzer/ByteCountPacketAnalyzer.cs
Executable file
|
@ -0,0 +1,41 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace FSO.Server.Debug.PacketAnalyzer
|
||||
{
|
||||
public class ByteCountPacketAnalyzer : IPacketAnalyzer
|
||||
{
|
||||
#region IPacketAnalyzer Members
|
||||
|
||||
public List<PacketAnalyzerResult> Analyze(byte[] data)
|
||||
{
|
||||
var result = new List<PacketAnalyzerResult>();
|
||||
|
||||
for (var i = 0; i < data.Length; i++)
|
||||
{
|
||||
if (i + 4 < data.Length)
|
||||
{
|
||||
byte len1 = data[i];
|
||||
byte len2 = data[i + 1];
|
||||
byte len3 = data[i + 2];
|
||||
byte len4 = data[i + 3];
|
||||
|
||||
long len = len1 << 24 | len2 << 16 | len3 << 8 | len4;
|
||||
|
||||
if (len == data.Length - (i + 4))
|
||||
{
|
||||
result.Add(new PacketAnalyzerResult
|
||||
{
|
||||
Offset = i,
|
||||
Length = 4,
|
||||
Description = "byte-count(" + len + ")"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue