mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-05-20 08:26:59 -04:00
More session handling code added.
This commit is contained in:
36
FFXIVClassic Proxy Server/Packets/Receive/HelloPacket.cs
Normal file
36
FFXIVClassic Proxy Server/Packets/Receive/HelloPacket.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_World_Server.Packets.Receive
|
||||
{
|
||||
class HelloPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public uint sessionId;
|
||||
|
||||
public HelloPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] readIn = new byte[12];
|
||||
binReader.BaseStream.Seek(0x14, SeekOrigin.Begin);
|
||||
binReader.Read(readIn, 0, 12);
|
||||
sessionId = UInt32.Parse(Encoding.ASCII.GetString(readIn));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -6,9 +6,12 @@ namespace FFXIVClassic_World_Server.Packets.Send.Login
|
||||
{
|
||||
class Login0x7ResponsePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x0008;
|
||||
public const uint PACKET_SIZE = 0x18;
|
||||
|
||||
public static SubPacket BuildPacket(uint actorID)
|
||||
{
|
||||
byte[] data = new byte[0x18];
|
||||
byte[] data = new byte[PACKET_SIZE];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
@@ -17,15 +20,14 @@ namespace FFXIVClassic_World_Server.Packets.Send.Login
|
||||
try
|
||||
{
|
||||
binWriter.Write((UInt32)actorID);
|
||||
binWriter.Write((UInt32)type);
|
||||
binWriter.Write((UInt32)Utils.UnixTimeStampUTC());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
{}
|
||||
}
|
||||
}
|
||||
|
||||
return BasePacket.CreatePacket(data, false, false);
|
||||
return new SubPacket(false, OPCODE, 0, 0, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user