mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-27 21:06:08 +02:00
Server now processes session ids and stores the correct logged in user in the clientconnection object. Reserve character now creates a entry in the db.
This commit is contained in:
parent
c1e214175f
commit
f996f727dc
7 changed files with 152 additions and 71 deletions
57
FFXIVClassic_Lobby_Server/packets/PacketStructs.cs
Normal file
57
FFXIVClassic_Lobby_Server/packets/PacketStructs.cs
Normal file
|
@ -0,0 +1,57 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Lobby_Server.packets
|
||||
{
|
||||
class PacketStructs
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public unsafe struct SessionPacket
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public uint sequence;
|
||||
[FieldOffset(0x50)]
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)]
|
||||
public String version;
|
||||
[FieldOffset(0x70)]
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)]
|
||||
public String session;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct CharacterRequestPacket
|
||||
{
|
||||
public uint sequence;
|
||||
public uint unknown;
|
||||
public uint characterId;
|
||||
public uint unknown2;
|
||||
public byte slot;
|
||||
public byte command;
|
||||
public ushort worldId;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x20)]
|
||||
public String characterName;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x190)]
|
||||
public String characterInfoEncoded;
|
||||
}
|
||||
|
||||
public static unsafe CharacterRequestPacket toCharacterRequestStruct(byte[] bytes)
|
||||
{
|
||||
fixed (byte* pdata = &bytes[0])
|
||||
{
|
||||
return (CharacterRequestPacket)Marshal.PtrToStructure(new IntPtr(pdata), typeof(CharacterRequestPacket));
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe SessionPacket toSessionStruct(byte[] bytes)
|
||||
{
|
||||
fixed (byte* pdata = &bytes[0])
|
||||
{
|
||||
return (SessionPacket)Marshal.PtrToStructure(new IntPtr(pdata), typeof(SessionPacket));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue