Reorganized the packets to follow the format the map server follows.

This commit is contained in:
Filip Maj 2016-02-18 23:55:03 -05:00
parent 8c73f6e926
commit 23dcc1dafe
14 changed files with 141 additions and 103 deletions

View file

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Lobby_Server.packets.receive
{
class SessionPacket
{
public bool invalidPacket = false;
public UInt64 sequence;
public String session;
public String version;
public SessionPacket(byte[] data)
{
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryReader binReader = new BinaryReader(mem))
{
try
{
sequence = binReader.ReadUInt64();
binReader.ReadUInt32();
binReader.ReadUInt32();
session = Encoding.ASCII.GetString(binReader.ReadBytes(0x40)).Trim(new[] { '\0' });
version = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
}
catch (Exception){
invalidPacket = true;
}
}
}
}
}
}